feat: add initial multi-environment CI/CD pipeline POC #3
@@ -70,7 +70,7 @@ jobs:
|
|||||||
docker stop ci-test || true
|
docker stop ci-test || true
|
||||||
docker rm ci-test || true
|
docker rm ci-test || true
|
||||||
docker run -d --name ci-test \
|
docker run -d --name ci-test \
|
||||||
--network host \
|
-p 0:80 \
|
||||||
-e APP_ENV=ci \
|
-e APP_ENV=ci \
|
||||||
-e APP_VERSION=ci-${{ gitea.sha }} \
|
-e APP_VERSION=ci-${{ gitea.sha }} \
|
||||||
-e BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
|
-e BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
|
||||||
@@ -78,8 +78,9 @@ jobs:
|
|||||||
-e GIT_BRANCH=${{ gitea.ref_name }} \
|
-e GIT_BRANCH=${{ gitea.ref_name }} \
|
||||||
-e DEPLOY_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
|
-e DEPLOY_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ") \
|
||||||
ci-image:latest
|
ci-image:latest
|
||||||
|
CI_PORT=$(docker port ci-test 80 | cut -d: -f2)
|
||||||
for i in $(seq 1 12); do
|
for i in $(seq 1 12); do
|
||||||
if curl -sf http://localhost:80/health > /dev/null 2>&1; then
|
if curl -sf http://localhost:$CI_PORT/health > /dev/null 2>&1; then
|
||||||
echo "::notice::Health check passed"
|
echo "::notice::Health check passed"
|
||||||
docker logs ci-test 2>&1 || true
|
docker logs ci-test 2>&1 || true
|
||||||
docker stop ci-test
|
docker stop ci-test
|
||||||
|
|||||||
Reference in New Issue
Block a user