2020-06-20 08:55:39 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-06-20 09:13:42 +00:00
|
|
|
set -e
|
|
|
|
|
2023-05-27 10:26:07 +00:00
|
|
|
VERSION=$(echo "${CI_COMMIT_TAG#*v}" | cut -d'+' -f1)
|
|
|
|
PATCHLEVEL=$(echo "${CI_COMMIT_TAG}" | cut -d'+' -f2)
|
2020-06-20 12:39:39 +00:00
|
|
|
export VERSION PATCHLEVEL
|
|
|
|
|
2024-05-28 06:50:17 +00:00
|
|
|
if [ ! -f /etc/init.d/gitea ]; then
|
2024-05-28 06:55:48 +00:00
|
|
|
cp -v "${CI_PROJECT_DIR}"/.gitlab-ci/init /etc/init.d/gitea
|
2024-05-28 06:50:17 +00:00
|
|
|
fi
|
|
|
|
|
2020-06-20 12:39:39 +00:00
|
|
|
start_gitea() {
|
2024-05-28 06:50:17 +00:00
|
|
|
/etc/init.d/gitea start
|
2020-06-20 12:39:39 +00:00
|
|
|
sleep 10
|
2024-05-28 06:50:17 +00:00
|
|
|
if ! /etc/init.d/gitea status | grep 'gitea is running'; then
|
|
|
|
cat /var/lib/gitea/log/gitea.log
|
2020-06-20 12:39:39 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
restart_gitea() {
|
2024-05-28 06:50:17 +00:00
|
|
|
/etc/init.d/gitea stop
|
2020-06-20 12:39:39 +00:00
|
|
|
start_gitea
|
|
|
|
}
|
|
|
|
|
2020-06-20 13:01:07 +00:00
|
|
|
sleep 5
|
|
|
|
|
2020-06-20 12:53:29 +00:00
|
|
|
apt-get update
|
|
|
|
apt-get -y install curl jq
|