Skip to content

Commit

Permalink
CI: reusable actions still point to .circleci dir so update .circleci…
Browse files Browse the repository at this point in the history
…/merkely_log_deployment.sh
  • Loading branch information
JonJagger committed Aug 20, 2022
1 parent bf6d08b commit 23b2eb7
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 11 deletions.
18 changes: 10 additions & 8 deletions .circleci/merkely_log_deployment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@
export ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
readonly SCRIPTS_DIR="${ROOT_DIR}/scripts"

source "${SCRIPTS_DIR}/config.sh"
source "${SCRIPTS_DIR}/echo_versioner_env_vars.sh"
source "${SCRIPTS_DIR}/merkely_echo_env_vars.sh"
source "${SCRIPTS_DIR}/merkely_fingerprint.sh"
pushd "${ROOT_DIR}/scripts"
source "./config.sh"
source "./echo_versioner_env_vars.sh"
source "./kosli_echo_env_vars.sh"
source "./kosli_fingerprint.sh"
popd

export $(echo_versioner_env_vars)
export $(merkely_echo_env_vars)
export $(kosli_echo_env_vars)

# - - - - - - - - - - - - - - - - - - -
merkely_log_deployment()
kosli_log_deployment()
{
local -r environment="${1}"
local -r hostname="${2}"
Expand All @@ -35,5 +37,5 @@ merkely_log_deployment()
# - - - - - - - - - - - - - - - - - - -
docker pull $(server_image):$(image_tag)

merkely_log_deployment "${1}" https://staging.app.merkely.com
merkely_log_deployment "${1}" https://app.merkely.com
kosli_log_deployment "${1}" https://staging.app.kosli.com
kosli_log_deployment "${1}" https://app.kosli.com
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

Development
-----------
To build the images, bring up the containers, and wait till they are alive and healthy, and run the tests:
To build the images, bring up the containers, wait till they are alive and healthy, and run the tests:
```bash
$ ./build_test_publish.sh
```
Expand All @@ -19,8 +19,8 @@ Use: ./build_test_publish.sh [server|client] [ID...]
No options runs all server tests, then all client tests
Options:
server run from inside the server container (unit tests)
client run from inside the client container (integration tests)
server only run unit-tests from inside the server container
client only run integration-tests from inside the client container
ID... run only the tests matching the given IDs
-h|--help show this help
```
Expand Down
38 changes: 38 additions & 0 deletions scripts/kosli_log_deployment.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash -Eeu

pushd "${ROOT_DIR}/scripts"
source "./config.sh"
source "./echo_versioner_env_vars.sh"
source "./merkely_echo_env_vars.sh"
source "./merkely_fingerprint.sh"
popd

export $(echo_versioner_env_vars)
export $(merkely_echo_env_vars)

# - - - - - - - - - - - - - - - - - - -
merkely_log_deployment()
{
local -r environment="${1}"
local -r hostname="${2}"

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_CI_BUILD_URL=${CIRCLE_BUILD_URL} \
--env MERKELY_HOST="${hostname}" \
--env MERKELY_API_TOKEN=${MERKELY_API_TOKEN} \
--rm \
--volume /var/run/docker.sock:/var/run/docker.sock \
${MERKELY_CHANGE}
}

# - - - - - - - - - - - - - - - - - - -
docker pull $(server_image):$(image_tag)

kosli_log_deployment "${1}" https://staging.app.kosli.com
kosli_log_deployment "${1}" https://app.kosli.com

0 comments on commit 23b2eb7

Please sign in to comment.