Skip to content

Commit

Permalink
Force CI run
Browse files Browse the repository at this point in the history
  • Loading branch information
JonJagger committed Aug 22, 2021
1 parent 0c8573c commit 7c952da
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
18 changes: 9 additions & 9 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ jobs:
steps:
- checkout
- run:
name: Authenticate with gcloud, deploy to beta with helm, log deployment to beta in Merkely
name: Authenticate with gcloud, deploy to beta with helm
command: |
source ./.circleci/deploy_to_namespace.sh
deploy_to_namespace beta
log-deployment-to-beta-to-merkely:
log-beta-deployment-to-merkely:
docker:
- image: ubuntu-2004:202008-01
steps:
- checkout
- run:
name: Authenticate with gcloud, deploy to beta with helm, log deployment to beta in Merkely
name: Log beta deployment to Merkely
command: |
source ./.circleci/merkely_log_deployment.sh
merkely_log_deployment beta https://staging.app.merkely.com
Expand All @@ -44,19 +44,19 @@ jobs:
steps:
- checkout
- run:
name: Authenticate with gcloud, deploy to prod with helm, log deployment to prod in Merkely
name: Authenticate with gcloud, deploy to prod with helm
command: |
source ./.circleci/deploy_to_namespace.sh
deploy_to_namespace prod
log-deployment-to-prod-to-merkely:
log-prod-deployment-to-merkely:
docker:
- image: ubuntu-2004:202008-01
steps:
- checkout
- run:
name: Authenticate with gcloud, deploy to prod with helm, log deployment to prod in Merkely
name: Log prod deployment to Merkely
command: |
source ./.circleci/merkely_log_deployment.sh
merkely_log_deployment prod https://staging.app.merkely.com
Expand Down Expand Up @@ -95,19 +95,19 @@ workflows:
context: cyberdojo-context
requires: [ build-test-publish ]

- log-deployment-to-beta-to-merkely:
- log-beta-deployment-to-merkely:
context: cyberdojo-context
requires: [ deploy-to-beta-env ]

- approve-to-prod-env:
type: approval
requires: [ deploy-to-beta-env-and-log-deployment-to-merkely ]
requires: [ log-beta-deployment-to-merkely ]

- deploy-to-prod-env:
context: cyberdojo-context
requires: [ approve-to-prod-env ]

- log-deployment-to-prod-to-merkely:
- log-prod-deployment-to-merkely:
context: cyberdojo-context
requires: [ deploy-to-prod-env ]

Expand Down
2 changes: 1 addition & 1 deletion .circleci/force-ci-run
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
Edit this file for a quick way to force a CI run
137
138
24 changes: 12 additions & 12 deletions .circleci/merkely_log_deployment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,34 @@
# - - - - - - - - - - - - - - - - - - -
merkely_log_deployment()
{
local -r environment="${1}"
local -r hostname="${2}"
local -r MERKELY_ENVIRONMENT="${1}"
local -r MERKELY_HOST="${2}"
local -r MERKELY_OWNER=cyber-dojo
local -r MERKELY_PIPELINE=differ

# set CYBER_DOJO_DIFFER_IMAGE, CYBER_DOJO_DIFFER_TAG
# Set CYBER_DOJO_DIFFER_IMAGE, CYBER_DOJO_DIFFER_TAG
local -r VERSIONER_URL=https://raw.githubusercontent.com/cyber-dojo/versioner/master
export $(curl "${VERSIONER_URL}/app/.env")
export CYBER_DOJO_DIFFER_TAG="${CIRCLE_SHA1:0:7}"
local -r CYBER_DOJO_DIFFER_TAG="${CIRCLE_SHA1:0:7}"

# get image so fingerprint() works
# Pull image so merkely_fingerprint() works
echo "${DOCKER_PASS}" | docker login --username "${DOCKER_USER}" --password-stdin
docker pull ${CYBER_DOJO_DIFFER_IMAGE}:${CYBER_DOJO_DIFFER_TAG}

local -r MERKELY_CHANGE=merkely/change:latest
local -r MERKELY_OWNER=cyber-dojo
local -r MERKELY_PIPELINE=differ
docker logout

docker run \
--env MERKELY_COMMAND=log_deployment \
--env MERKELY_OWNER=${MERKELY_OWNER} \
--env MERKELY_PIPELINE=${MERKELY_PIPELINE} \
--env MERKELY_FINGERPRINT=$(merkely_fingerprint) \
--env MERKELY_DESCRIPTION="Deployed to ${environment} in circleci pipeline" \
--env MERKELY_ENVIRONMENT="${environment}" \
--env MERKELY_ENVIRONMENT="${MERKELY_ENVIRONMENT}" \
--env MERKELY_CI_BUILD_URL=${CIRCLE_BUILD_URL} \
--env MERKELY_API_TOKEN=${MERKELY_API_TOKEN} \
--env MERKELY_HOST="${hostname}" \
--env MERKELY_HOST="${MERKELY_HOST}" \
--rm \
--volume /var/run/docker.sock:/var/run/docker.sock \
${MERKELY_CHANGE}
merkely/change:latest
}

# - - - - - - - - - - - - - - - - - - -
Expand Down

0 comments on commit 7c952da

Please sign in to comment.