Skip to content

Commit

Permalink
Added arm image for Gitea (#55)
Browse files Browse the repository at this point in the history
Added while loop to wait for Gitea startup before starting configuration process
  • Loading branch information
TupleType authored Apr 23, 2023
1 parent 1d86b7f commit aa37682
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
14 changes: 7 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ jobs:
cd prod && docker buildx build --load --tag cidersecurity/goat-prod:latest . && cd ..
cd jenkins-server && docker buildx build --load --tag cidersecurity/goat-jenkins-server:latest . && cd ..
cd jenkins-agent && docker buildx build --load --tag cidersecurity/goat-jenkins-agent:latest . && cd ..
cd gitea && docker buildx build --load --tag cidersecurity/goat-gitea:latest . && cd ..
docker-compose -f docker-compose-dev.yaml up -d gitlab gitlab-runner prod jenkins-server jenkins-agent
docker-compose -f docker-compose-dev.yaml up -d --build gitea ctfd localstack docker
docker-compose -f docker-compose-dev.yaml up -d gitlab gitlab-runner prod jenkins-server jenkins-agent gitea
docker-compose -f docker-compose-dev.yaml up -d --build ctfd localstack docker
- run:
name: Install testing dependencies
command: |
Expand Down Expand Up @@ -66,23 +67,22 @@ jobs:
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 ..
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 ..
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 ..
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 ..
docker-compose -f docker-compose-dev.yaml build --build-arg VERSION=$VERSION --build-arg COMMIT_SHA=$CIRCLE_SHA1 gitea ctfd
docker-compose -f docker-compose-dev.yaml push gitea ctfd
docker-compose -f docker-compose-dev.yaml build --build-arg VERSION=$VERSION --build-arg COMMIT_SHA=$CIRCLE_SHA1 ctfd
docker-compose -f docker-compose-dev.yaml push ctfd
- run:
name: Push version
command: |
docker tag $ORG/goat-gitea:latest $ORG/goat-gitea:$VERSION
docker tag $ORG/goat-ctfd:latest $ORG/goat-ctfd:$VERSION
docker push $ORG/goat-gitea:$VERSION
docker push $ORG/goat-ctfd:$VERSION
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 ..
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 ..
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 ..
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 ..
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 ..
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 ..
workflows:
version: 2
Expand Down
11 changes: 10 additions & 1 deletion gitea/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,16 @@ set -m
USERNAME=red_queen
PASSWORD=ciderland5#
/usr/bin/entrypoint &
sleep 40
while true
do
gitea_status_code=$(curl --write-out %{http_code} --silent --output /dev/null localhost:3000/ )
if [ "$gitea_status_code" -eq 200 ]; then
echo "Gitea ready. Continue with setup..."
break
fi
echo "Gitea is not ready. Waiting 5 seconds..."
sleep 5
done
su -c "gitea admin user create --username $USERNAME --password $PASSWORD --email queen@localhost --admin" git
cd /setup
python3 -m giteacasc /setup/gitea.yaml -u $USERNAME -p $PASSWORD
Expand Down

0 comments on commit aa37682

Please sign in to comment.