Skip to content

Commit aa37682

Browse files
authored
Added arm image for Gitea (#55)
Added while loop to wait for Gitea startup before starting configuration process
1 parent 1d86b7f commit aa37682

File tree

2 files changed

+17
-8
lines changed

2 files changed

+17
-8
lines changed

.circleci/config.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ jobs:
2626
cd prod && docker buildx build --load --tag cidersecurity/goat-prod:latest . && cd ..
2727
cd jenkins-server && docker buildx build --load --tag cidersecurity/goat-jenkins-server:latest . && cd ..
2828
cd jenkins-agent && docker buildx build --load --tag cidersecurity/goat-jenkins-agent:latest . && cd ..
29+
cd gitea && docker buildx build --load --tag cidersecurity/goat-gitea:latest . && cd ..
2930
30-
docker-compose -f docker-compose-dev.yaml up -d gitlab gitlab-runner prod jenkins-server jenkins-agent
31-
docker-compose -f docker-compose-dev.yaml up -d --build gitea ctfd localstack docker
31+
docker-compose -f docker-compose-dev.yaml up -d gitlab gitlab-runner prod jenkins-server jenkins-agent gitea
32+
docker-compose -f docker-compose-dev.yaml up -d --build ctfd localstack docker
3233
- run:
3334
name: Install testing dependencies
3435
command: |
@@ -66,23 +67,22 @@ jobs:
6667
cd prod && docker buildx build --push --build-arg VERSION=$VERSION --build-arg COMMIT_SHA=$CIRCLE_SHA1 --platform linux/amd64,linux/arm64/v8 --tag cidersecurity/goat-prod:latest . && cd ..
6768
cd jenkins-server && docker buildx build --push --build-arg VERSION=$VERSION --build-arg COMMIT_SHA=$CIRCLE_SHA1 --platform linux/amd64,linux/arm64/v8 --tag cidersecurity/goat-jenkins-server:latest . && cd ..
6869
cd jenkins-agent && docker buildx build --push --build-arg VERSION=$VERSION --build-arg COMMIT_SHA=$CIRCLE_SHA1 --platform linux/amd64,linux/arm64/v8 --tag cidersecurity/goat-jenkins-agent:latest . && cd ..
70+
cd gitea && docker buildx build --push --build-arg VERSION=$VERSION --build-arg COMMIT_SHA=$CIRCLE_SHA1 --platform linux/amd64,linux/arm64/v8 --tag cidersecurity/goat-gitea:latest . && cd ..
6971
70-
docker-compose -f docker-compose-dev.yaml build --build-arg VERSION=$VERSION --build-arg COMMIT_SHA=$CIRCLE_SHA1 gitea ctfd
71-
docker-compose -f docker-compose-dev.yaml push gitea ctfd
72+
docker-compose -f docker-compose-dev.yaml build --build-arg VERSION=$VERSION --build-arg COMMIT_SHA=$CIRCLE_SHA1 ctfd
73+
docker-compose -f docker-compose-dev.yaml push ctfd
7274
- run:
7375
name: Push version
7476
command: |
75-
docker tag $ORG/goat-gitea:latest $ORG/goat-gitea:$VERSION
7677
docker tag $ORG/goat-ctfd:latest $ORG/goat-ctfd:$VERSION
77-
78-
docker push $ORG/goat-gitea:$VERSION
7978
docker push $ORG/goat-ctfd:$VERSION
8079
8180
cd gitlab && docker buildx build --push --build-arg VERSION=$VERSION --build-arg COMMIT_SHA=$CIRCLE_SHA1 --platform linux/amd64,linux/arm64/v8 --tag cidersecurity/goat-gitlab:$VERSION . && cd ..
8281
cd gitlab-runner && docker buildx build --push --build-arg VERSION=$VERSION --build-arg COMMIT_SHA=$CIRCLE_SHA1 --platform linux/amd64,linux/arm64/v8 --tag cidersecurity/goat-gitlab-runner:$VERSION . && cd ..
8382
cd prod && docker buildx build --push --build-arg VERSION=$VERSION --build-arg COMMIT_SHA=$CIRCLE_SHA1 --platform linux/amd64,linux/arm64/v8 --tag cidersecurity/goat-prod:$VERSION . && cd ..
8483
cd jenkins-server && docker buildx build --push --build-arg VERSION=$VERSION --build-arg COMMIT_SHA=$CIRCLE_SHA1 --platform linux/amd64,linux/arm64/v8 --tag cidersecurity/goat-jenkins-server:$VERSION . && cd ..
8584
cd jenkins-agent && docker buildx build --push --build-arg VERSION=$VERSION --build-arg COMMIT_SHA=$CIRCLE_SHA1 --platform linux/amd64,linux/arm64/v8 --tag cidersecurity/goat-jenkins-agent:$VERSION . && cd ..
85+
cd gitea && docker buildx build --push --build-arg VERSION=$VERSION --build-arg COMMIT_SHA=$CIRCLE_SHA1 --platform linux/amd64,linux/arm64/v8 --tag cidersecurity/goat-gitea:$VERSION . && cd ..
8686
8787
workflows:
8888
version: 2

gitea/run.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,16 @@ set -m
33
USERNAME=red_queen
44
PASSWORD=ciderland5#
55
/usr/bin/entrypoint &
6-
sleep 40
6+
while true
7+
do
8+
gitea_status_code=$(curl --write-out %{http_code} --silent --output /dev/null localhost:3000/ )
9+
if [ "$gitea_status_code" -eq 200 ]; then
10+
echo "Gitea ready. Continue with setup..."
11+
break
12+
fi
13+
echo "Gitea is not ready. Waiting 5 seconds..."
14+
sleep 5
15+
done
716
su -c "gitea admin user create --username $USERNAME --password $PASSWORD --email queen@localhost --admin" git
817
cd /setup
918
python3 -m giteacasc /setup/gitea.yaml -u $USERNAME -p $PASSWORD

0 commit comments

Comments
 (0)