Compare commits
4 Commits
82859337f5
...
c27ca59315
| Author | SHA1 | Date |
|---|---|---|
|
|
c27ca59315 | |
|
|
ea4d582621 | |
|
|
51731a79d5 | |
|
|
ce31451749 |
|
|
@ -1,3 +1,4 @@
|
||||||
|
# build:0
|
||||||
labels:
|
labels:
|
||||||
hostname: "macmini7"
|
hostname: "macmini7"
|
||||||
clone:
|
clone:
|
||||||
|
|
@ -7,6 +8,7 @@ clone:
|
||||||
partial: false
|
partial: false
|
||||||
depth: 1
|
depth: 1
|
||||||
steps:
|
steps:
|
||||||
|
# Build Step for staging Branch
|
||||||
build-staging:
|
build-staging:
|
||||||
name: build-staging
|
name: build-staging
|
||||||
image: woodpeckerci/plugin-docker-buildx
|
image: woodpeckerci/plugin-docker-buildx
|
||||||
|
|
@ -16,6 +18,14 @@ steps:
|
||||||
commands:
|
commands:
|
||||||
- echo "Building application for staging branch"
|
- echo "Building application for staging branch"
|
||||||
- echo "$${REGISTRY_PASSWORD}" | docker login -u "$${REGISTRY_USER}" --password-stdin git.nixc.us
|
- echo "$${REGISTRY_PASSWORD}" | docker login -u "$${REGISTRY_USER}" --password-stdin git.nixc.us
|
||||||
|
# ################################################
|
||||||
|
# ######### Build a remote image locally #########
|
||||||
|
# ################################################
|
||||||
|
# - apk add --no-cache git
|
||||||
|
# - git clone --depth 1 https://github.com/Eugeny/tabby-web.git ./docker/tabby/
|
||||||
|
# # - cd ./docker/tabby/
|
||||||
|
# # - docker build -t your-image-name .
|
||||||
|
# ################################################
|
||||||
- echo compose build
|
- echo compose build
|
||||||
- docker compose -f docker-compose.staging.yml build
|
- docker compose -f docker-compose.staging.yml build
|
||||||
when:
|
when:
|
||||||
|
|
@ -38,6 +48,31 @@ steps:
|
||||||
- echo "$${REGISTRY_PASSWORD}" | docker login -u "$${REGISTRY_USER}" --password-stdin git.nixc.us
|
- echo "$${REGISTRY_PASSWORD}" | docker login -u "$${REGISTRY_USER}" --password-stdin git.nixc.us
|
||||||
- echo compose push
|
- echo compose push
|
||||||
- docker compose -f docker-compose.staging.yml push
|
- docker compose -f docker-compose.staging.yml push
|
||||||
|
- docker stack deploy --with-registry-auth -c ./stack.staging.yml $${CI_REPO_NAME}-staging
|
||||||
|
|
||||||
|
# # Wait for Deploy to Complete
|
||||||
|
# wait-for-deploy-staging:
|
||||||
|
# name: wait-for-deploy-staging
|
||||||
|
# image: woodpeckerci/plugin-git
|
||||||
|
# commands:
|
||||||
|
# - echo "Waiting for staging deploy step to complete rollout."
|
||||||
|
# - sleep 60
|
||||||
|
# when:
|
||||||
|
# - branch: main
|
||||||
|
# - event: push
|
||||||
|
|
||||||
|
# # Run Automated Tests on staging Branch
|
||||||
|
# test-staging:
|
||||||
|
# name: run-tests-staging
|
||||||
|
# image: git.nixc.us/colin/playwright:latest
|
||||||
|
# secrets: [ base_url ]
|
||||||
|
# when:
|
||||||
|
# - branch: main
|
||||||
|
# - event: push
|
||||||
|
# - path:
|
||||||
|
# include: [ 'tests/', 'src/','docker-compose.staging.yml', 'docker-compose.production.yml', '*.tests.ts' ] # Specify paths relevant to tests
|
||||||
|
# volumes:
|
||||||
|
# - /var/run/docker.sock:/var/run/docker.sock:ro
|
||||||
|
|
||||||
cleanup-staging:
|
cleanup-staging:
|
||||||
name: cleanup-staging
|
name: cleanup-staging
|
||||||
|
|
@ -50,9 +85,13 @@ steps:
|
||||||
volumes:
|
volumes:
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
commands:
|
commands:
|
||||||
|
# - docker stack rm $${CI_REPO_NAME}-staging
|
||||||
|
## added fault tolerance for docker stack rm
|
||||||
|
- for i in {1..5}; do docker stack rm ${CI_REPO_NAME}-staging && break || sleep 10; done
|
||||||
- docker compose -f docker-compose.staging.yml down
|
- docker compose -f docker-compose.staging.yml down
|
||||||
- docker compose -f docker-compose.staging.yml rm -f
|
- docker compose -f docker-compose.staging.yml rm -f
|
||||||
|
|
||||||
|
# Build Step for staging Branch
|
||||||
build-build-push-production:
|
build-build-push-production:
|
||||||
name: build-build-push-production
|
name: build-build-push-production
|
||||||
image: woodpeckerci/plugin-docker-buildx
|
image: woodpeckerci/plugin-docker-buildx
|
||||||
|
|
@ -71,6 +110,7 @@ steps:
|
||||||
- path:
|
- path:
|
||||||
include: [ 'stack.production.yml', 'stack.staging.yml', 'docker-compose.staging.yml', 'docker-compose.production.yml', 'Dockerfile', '*.tests.ts' ]
|
include: [ 'stack.production.yml', 'stack.staging.yml', 'docker-compose.staging.yml', 'docker-compose.production.yml', 'Dockerfile', '*.tests.ts' ]
|
||||||
|
|
||||||
|
# Deploy to Production Branch
|
||||||
deploy-production:
|
deploy-production:
|
||||||
name: deploy-production
|
name: deploy-production
|
||||||
image: woodpeckerci/plugin-docker-buildx
|
image: woodpeckerci/plugin-docker-buildx
|
||||||
|
|
@ -79,6 +119,34 @@ steps:
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
commands:
|
commands:
|
||||||
- echo "$${REGISTRY_PASSWORD}" | docker login -u "$${REGISTRY_USER}" --password-stdin git.nixc.us
|
- echo "$${REGISTRY_PASSWORD}" | docker login -u "$${REGISTRY_USER}" --password-stdin git.nixc.us
|
||||||
|
- docker stack deploy --with-registry-auth -c ./stack.production.yml $${CI_REPO_NAME}
|
||||||
when:
|
when:
|
||||||
- branch: production
|
- branch: production
|
||||||
- event: push
|
- event: push
|
||||||
|
# - path:
|
||||||
|
# include: [ 'stack.production.yml', 'stack.staging.yml', 'docker-compose.staging.yml', 'docker-compose.production.yml', 'Dockerfile', '*.tests.ts' ]
|
||||||
|
|
||||||
|
|
||||||
|
# # Wait for Deploy to Complete
|
||||||
|
# wait-for-deploy-production:
|
||||||
|
# name: wait-for-deploy-production
|
||||||
|
# image: woodpeckerci/plugin-git
|
||||||
|
# commands:
|
||||||
|
# - echo "Waiting for deploy step to complete rollout."
|
||||||
|
# - sleep 60
|
||||||
|
# when:
|
||||||
|
# - branch: production
|
||||||
|
# - event: push
|
||||||
|
|
||||||
|
# # Run Post-Deployment Smoke Tests
|
||||||
|
# post-deploy-smoke-tests-git-nixc-us:
|
||||||
|
# name: run-post-deploy-smoke-tests-git-nixc-us
|
||||||
|
# image: git.nixc.us/colin/playwright:latest
|
||||||
|
# # secrets: [TEST_USER, TEST_PASSWORD]
|
||||||
|
# environment:
|
||||||
|
# - BASE_URL=https://git.nixc.us
|
||||||
|
# when:
|
||||||
|
# - branch: production
|
||||||
|
# - event: push
|
||||||
|
# # - path:
|
||||||
|
# # include: [ 'stack.production.yml', 'stack.staging.yml', 'docker-compose.staging.yml', 'docker-compose.production.yml', 'Dockerfile', '*.tests.ts' ]
|
||||||
Loading…
Reference in New Issue