1
0
mirror of https://gitlab.com/packaging/gitea synced 2024-12-18 16:13:44 +00:00
gitea_packaging/.gitlab-ci/test.sh

30 lines
542 B
Bash
Raw Normal View History

2020-06-20 08:55:39 +00:00
#!/bin/bash
2020-06-20 09:13:42 +00:00
set -e
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
if [ ! -f /etc/init.d/gitea ]; then
install -m 755 "${CI_PROJECT_DIR}"/.gitlab-ci/init /etc/init.d/gitea
fi
2020-06-20 12:39:39 +00:00
start_gitea() {
/etc/init.d/gitea start
2020-06-20 12:39:39 +00:00
sleep 10
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() {
/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