Skip to content

Commit 1036130

Browse files
committed
Script to publish docker images
1 parent 1a4cafd commit 1036130

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ jobs:
2727
path: ~/junit
2828
- store_artifacts:
2929
path: ~/junit
30+
- run: ./publish-docker-images.sh

publish-docker-images.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#! /bin/bash -e
2+
3+
DOCKER_COMPOSE_PREFIX=$(echo ${PWD##*/} | sed -e 's/-//g')_
4+
5+
DOCKER_REPO=msapatterns
6+
REMOTE_PREFIX=eventuateio-local
7+
8+
$PREFIX docker login -u ${DOCKER_USER_ID?} -p ${DOCKER_PASSWORD?}
9+
10+
IMAGES="ftgo-consumer-service ftgo-order-service ftgo-restaurant-order-service ftgo-restaurant-service ftgo-accounting-service ftgo-order-history-service ftgo-api-gateway"
11+
12+
function tagAndPush() {
13+
LOCAL=$1
14+
REMOTE="$2"
15+
FULL_LOCAL=${DOCKER_COMPOSE_PREFIX?}$LOCAL
16+
FULL_REMOTE="$DOCKER_REPO/$REMOTE:latest"
17+
18+
$PREFIX docker tag $FULL_LOCAL $FULL_REMOTE
19+
$PREFIX docker push $FULL_REMOTE
20+
}
21+
22+
for image in $IMAGES ; do
23+
tagAndPush $image $image
24+
done

0 commit comments

Comments
 (0)