Skip to content

Commit

Permalink
CI: turn off CircleCI; switch from merkely to kosli
Browse files Browse the repository at this point in the history
  • Loading branch information
JonJagger committed Aug 21, 2022
1 parent 46cda99 commit 3e5e3f7
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 37 deletions.
File renamed without changes.
25 changes: 15 additions & 10 deletions .circleci/merkely_log_deployment.sh
Expand Up @@ -7,33 +7,38 @@ readonly MERKELY_OWNER=cyber-dojo
readonly MERKELY_PIPELINE=languages-start-points

# - - - - - - - - - - - - - - - - - - -
merkely_fingerprint()
kosli_fingerprint()
{
echo "docker://${CYBER_DOJO_LANGUAGES_START_POINTS_IMAGE}:${CYBER_DOJO_LANGUAGES_START_POINTS_TAG}"
}

# - - - - - - - - - - - - - - - - - - -
merkely_log_deployment()
kosli_log_deployment()
{
local -r ENVIRONMENT="${1}"
local -r HOSTNAME="${2}"

VERSIONER_URL=https://raw.githubusercontent.com/cyber-dojo/versioner/master
export $(curl "${VERSIONER_URL}/app/.env")
export CYBER_DOJO_LANGUAGES_START_POINTS_TAG="${CIRCLE_SHA1:0:7}"
docker pull ${CYBER_DOJO_LANGUAGES_START_POINTS_IMAGE}:${CYBER_DOJO_LANGUAGES_START_POINTS_TAG}

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_FINGERPRINT=$(kosli_fingerprint) \
--env MERKELY_DESCRIPTION="Deployed to ${ENVIRONMENT} in Github Actions pipeline" \
--env MERKELY_ENVIRONMENT="${ENVIRONMENT}" \
--env MERKELY_CI_BUILD_URL=${CIRCLE_BUILD_URL} \
--env MERKELY_API_TOKEN=${MERKELY_API_TOKEN} \
--env MERKELY_HOST="${HOSTNAME}" \
--rm \
--volume /var/run/docker.sock:/var/run/docker.sock \
${MERKELY_CHANGE}
}
}

# - - - - - - - - - - - - - - - - - - -
VERSIONER_URL=https://raw.githubusercontent.com/cyber-dojo/versioner/master
export $(curl "${VERSIONER_URL}/app/.env")
export CYBER_DOJO_LANGUAGES_START_POINTS_TAG="${CIRCLE_SHA1:0:7}"
docker pull ${CYBER_DOJO_LANGUAGES_START_POINTS_IMAGE}:${CYBER_DOJO_LANGUAGES_START_POINTS_TAG}

readonly ENVIRONMENT="${1}"
readonly HOSTNAME="${2}"
kosli_log_deployment "${ENVIRONMENT}" "${HOSTNAME}"
3 changes: 3 additions & 0 deletions .github/workflows/force-ci-run
@@ -0,0 +1,3 @@
167
Edit this file for a quick way to force a CI run.
Useful when you need to pick up a new start-points-base image.
12 changes: 5 additions & 7 deletions .github/workflows/main.yml
Expand Up @@ -38,7 +38,7 @@ jobs:
ecr_registry: 244531986313.dkr.ecr.eu-central-1.amazonaws.com
service_name: languages-start-points
gh_actions_iam_role_name: gh_actions_services

deploy-staging:
needs: [pre-build, build-test-push]
uses: cyber-dojo/reusable-actions-workflows/.github/workflows/deploy.yml@master
Expand All @@ -51,10 +51,9 @@ jobs:
gh_actions_iam_role_name: gh_actions_services
environment_url: https://beta.cyber-dojo.org
environment_name: staging
cyber_dojo_env_name: beta
cyber_dojo_env_name_aws: aws-beta
kosli_staging_host: https://staging.app.merkely.com
kosli_production_host: https://app.merkely.com
kosli_staging_host: https://staging.app.kosli.com
kosli_production_host: https://app.kosli.com
circle_sha1: ${{ github.sha }}
circle_build_url: ${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}

Expand All @@ -70,9 +69,8 @@ jobs:
gh_actions_iam_role_name: gh_actions_services
environment_url: https://prod.cyber-dojo.org
environment_name: production
cyber_dojo_env_name: prod
cyber_dojo_env_name_aws: aws-prod
kosli_staging_host: https://staging.app.merkely.com
kosli_production_host: https://app.merkely.com
kosli_staging_host: https://staging.app.kosli.com
kosli_production_host: https://app.kosli.com
circle_sha1: ${{ github.sha }}
circle_build_url: ${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}}
2 changes: 1 addition & 1 deletion LICENSE.md
@@ -1,4 +1,4 @@
Copyright (c) 2021, [CyberDojo Foundation](http://blog.cyber-dojo.org/2015/08/cyber-dojo-foundation.html)
Copyright (c) 2022, [CyberDojo Foundation](http://blog.cyber-dojo.org/2015/08/cyber-dojo-foundation.html)
All rights reserved.


Expand Down
3 changes: 1 addition & 2 deletions README.md
@@ -1,5 +1,4 @@

[![CircleCI](https://circleci.com/gh/cyber-dojo/languages-start-points.svg?style=svg)](https://circleci.com/gh/cyber-dojo/languages-start-points)
![Github Action (main)](https://github.com/cyber-dojo/languages-start-points/actions/workflows/main.yml/badge.svg)

- A docker-containerized micro-service for [https://cyber-dojo.org](http://cyber-dojo.org).
- The data source for the `choose a language & test-framework` page.
Expand Down
12 changes: 6 additions & 6 deletions build_test_publish.sh
Expand Up @@ -6,7 +6,7 @@ readonly TMP_DIR=$(mktemp -d /tmp/cyber-dojo.languages-start-points.XXXXXXXXX)
trap "rm -rf ${TMP_DIR} > /dev/null" INT EXIT
source "${SH_DIR}/echo_versioner_env_vars.sh"
export $(echo_versioner_env_vars)
source "${SH_DIR}/merkely.sh"
source "${SH_DIR}/kosli.sh"

# - - - - - - - - - - - - - - - - - - - - - - - -
build_test_tag()
Expand Down Expand Up @@ -61,21 +61,21 @@ cyber_dojo()
# - - - - - - - - - - - - - - - - - - - - - - - -
on_ci()
{
[ -n "${CIRCLECI:-}" ]
[ -n "${CI:-}" ]
}

# - - - - - - - - - - - - - - - - - - - - - - - -
if on_ci; then
merkely_declare_pipeline https://staging.app.merkely.com
merkely_declare_pipeline https://app.merkely.com
kosli_declare_pipeline https://staging.app.kosli.com
kosli_declare_pipeline https://app.kosli.com
fi

build_test_tag

if on_ci; then
docker push "$(image_name):latest"
docker push "$(image_name):$(git_commit_tag)"
merkely_log_artifact https://staging.app.merkely.com
merkely_log_artifact https://app.merkely.com
kosli_log_artifact https://staging.app.kosli.com
kosli_log_artifact https://app.kosli.com
fi

22 changes: 11 additions & 11 deletions sh/merkely.sh → sh/kosli.sh
Expand Up @@ -8,13 +8,13 @@ readonly MERKELY_PIPELINE=languages-start-points


# - - - - - - - - - - - - - - - - - - -
merkely_fingerprint()
kosli_fingerprint()
{
echo "docker://${CYBER_DOJO_LANGUAGES_START_POINTS_IMAGE}:${CYBER_DOJO_LANGUAGES_START_POINTS_TAG}"
}

# - - - - - - - - - - - - - - - - - - -
merkely_declare_pipeline()
kosli_declare_pipeline()
{
local -r hostname="${1}"

Expand All @@ -30,15 +30,15 @@ merkely_declare_pipeline()
}

# - - - - - - - - - - - - - - - - - - -
merkely_log_artifact()
kosli_log_artifact()
{
local -r hostname="${1}"

docker run \
--env MERKELY_COMMAND=log_artifact \
--env MERKELY_OWNER=${MERKELY_OWNER} \
--env MERKELY_PIPELINE=${MERKELY_PIPELINE} \
--env MERKELY_FINGERPRINT=$(merkely_fingerprint) \
--env MERKELY_FINGERPRINT=$(kosli_fingerprint) \
--env MERKELY_IS_COMPLIANT=TRUE \
--env MERKELY_ARTIFACT_GIT_COMMIT=${CYBER_DOJO_LANGUAGES_START_POINTS_SHA} \
--env MERKELY_ARTIFACT_GIT_URL=https://github.com/${MERKELY_OWNER}/${MERKELY_PIPELINE}/commit/${CYBER_DOJO_LANGUAGES_START_POINTS_SHA} \
Expand All @@ -54,29 +54,29 @@ merkely_log_artifact()
# - - - - - - - - - - - - - - - - - - - - - - - -
on_ci()
{
[ -n "${CIRCLECI:-}" ]
[ -n "${CI:-}" ]
}

# - - - - - - - - - - - - - - - - - - -
on_ci_merkely_declare_pipeline()
on_ci_kosli_declare_pipeline()
{
if ! on_ci ; then
return
fi

merkely_declare_pipeline https://staging.app.merkely.com
merkely_declare_pipeline https://app.merkely.com
kosli_declare_pipeline https://staging.app.kosli.com
kosli_declare_pipeline https://app.kosli.com
}

# - - - - - - - - - - - - - - - - - - -
on_ci_merkely_log_artifact()
on_ci_kosli_log_artifact()
{
if ! on_ci ; then
return
fi

merkely_log_artifact https://staging.app.merkely.com
merkely_log_artifact https://app.merkely.com
kosli_log_artifact https://staging.app.kosli.com
kosli_log_artifact https://app.kosli.com
}


0 comments on commit 3e5e3f7

Please sign in to comment.