Skip to content

Commit 8d84d98

Browse files
authored
Merge pull request #6 from BlockClusterApp/image-update
Image update
2 parents 62115be + 56e037f commit 8d84d98

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

.circleci/build-end-notification.sh

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
#!/usr/bin/env bash
22

3-
echo "Haven't implemented it."
3+
. ./.circleci/export-env-vars.sh
4+
5+
curl -X POST \
6+
"${API_HOST}/api/networks/update-container-images" \
7+
-H "authorization: ${NETWORK_UPDATE_ID}:${NETWORK_UPDATE_KEY}" \
8+
-H 'cache-control: no-cache' \
9+
-H 'content-type: application/x-www-form-urlencoded' \
10+
-d "container=impulse&imageTag=${NODE_ENV}-${COMMIT_HASH}"
411

512
exit 0;

.circleci/config.yml

+3
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ jobs:
5555
- run:
5656
name: "Docker push"
5757
command: ./.circleci/docker-push.sh
58+
- run:
59+
name: "Network Update"
60+
command: ./.circleci/build-end-notification.sh
5861

5962
workflows:
6063
version: 2

.circleci/export-env-vars.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,19 @@ export COMMIT_HASH=${CIRCLE_SHA1}
55
if [ "$CIRCLE_BRANCH" = "master" ] || [ "$CIRCLE_TAG" = "production" ];
66
then
77
export NODE_ENV="production"
8-
elif [ "$CIRCLE_BRANCH" = "staging" ] || [ "$CIRCLE_TAG" = "staging" ] || [ "$CIRCLE_BRANCH" = "staging" ];
8+
export API_HOST="https://app.blockcluster.io"
9+
elif [ "$CIRCLE_BRANCH" = "staging" ] || [ "$CIRCLE_TAG" = "staging" ];
910
then
1011
export NODE_ENV="staging"
12+
export API_HOST="https://staging.blockcluster.io"
1113
elif [ "$CIRCLE_BRANCH" = "test" ] || [ "$CIRCLE_TAG" = "test" ];
1214
then
1315
export NODE_ENV="test"
16+
export API_HOST="https://test.blockcluster.io"
1417
else
1518
export NODE_ENV="dev"
19+
export API_HOST="https://dev.blockcluster.io"
1620
fi
1721

22+
1823
export IMAGE_NAME='402432300121.dkr.ecr.us-west-2.amazonaws.com/impulse'

0 commit comments

Comments
 (0)