Skip to content

Commit 0cfa8ee

Browse files
committed
CicleCI:
* updated test script * added check for tag when master branch is tested Signed-off-by: Marcel Wagner <[email protected]>
1 parent 1770d44 commit 0cfa8ee

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

.circleci/config.yml

+22-5
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ commands:
2424
cd platform-setup
2525
sudo ./setup-ubuntu16.04.sh
2626
setup-branch:
27-
description: "Setup branch"
27+
description: "Setup subbranches"
2828
steps:
2929
- run:
3030
shell: /bin/bash
31-
name: Setup branch
31+
name: Setup sub branches
3232
command: |
3333
sudo apt install jq
3434
# First find out Base Branch (if any)
@@ -78,12 +78,20 @@ commands:
7878
DOCKER_TAG="latest"
7979
if [ "<< parameters.tag >>" = "date" ]; then
8080
DOCKER_TAG=`date -I`
81+
DOCKER_PUSH_LATEST=true
8182
fi
8283
if [ "<< parameters.tag >>" = "tag" ]; then
83-
DOCKER_TAG=`git describe --tag` || exit 1
84+
DOCKER_TAG=`git describe --tags --exact-match` || exit 1
85+
fi
86+
echo Now trying to push with Tag ${DOCKER_TAG} push latest ${DOCKER_PUSH_LATEST}
87+
if [ ! -z "$PUSH_DRYRUN" ]; then
88+
make push-images
89+
if [ ! -z "$DOCKER_PUSH_LATEST" ]; then
90+
DOCKER_TAG="latest" make push-images
91+
fi
92+
else
93+
echo Only dry run mode. Not pushing to dockerhub!
8494
fi
85-
echo Now trying to push with Tag ${DOCKER_TAG}
86-
make push
8795
check-signed:
8896
description: "Check whether latest commit is signed"
8997
steps:
@@ -99,6 +107,14 @@ commands:
99107
echo "Commit is not signedoff"
100108
exit 1
101109
fi
110+
check-tagged:
111+
description: "Check whether latest commit is tagged"
112+
steps:
113+
- run:
114+
name: Check whether most recent commit is tagged
115+
shell: /bin/bash
116+
command: |
117+
git describe --tags --exact-match || exit 1
102118
jobs:
103119
build:
104120
executor: my-executor
@@ -113,6 +129,7 @@ jobs:
113129
executor: my-executor
114130
steps:
115131
- checkout
132+
- check-tagged
116133
- setup-build-environment
117134
- setup-branch
118135
- build-branch

0 commit comments

Comments
 (0)