2020-06-20 08:55:39 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2020-06-20 09:13:42 +00:00
|
|
|
set -e
|
|
|
|
|
2020-06-20 08:55:39 +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
|
|
|
|
|
|
|
|
start_gitea() {
|
|
|
|
systemctl start gitea
|
|
|
|
sleep 10
|
|
|
|
if ! systemctl is-active gitea; then
|
|
|
|
journalctl -lu gitea --no-pager
|
|
|
|
fi
|
|
|
|
curl -s localhost:3000/api/v1/version | jq -e '.version'
|
|
|
|
}
|
|
|
|
|
|
|
|
restart_gitea() {
|
|
|
|
systemctl stop gitea
|
|
|
|
start_gitea
|
|
|
|
}
|
|
|
|
|
2020-06-20 08:55:39 +00:00
|
|
|
apt-get -qq update
|
2020-06-20 12:39:39 +00:00
|
|
|
apt-get -qqy install curl jq
|