Try using latest version to bump docker image tag

This commit is contained in:
dannyrb 2019-05-21 12:53:15 -04:00
parent e848cedbaf
commit 5feb29422c
2 changed files with 33 additions and 15 deletions

View File

@ -70,21 +70,7 @@ jobs:
# attempting to run it from a `pr`, which is not the case
- run:
name: Publish using Semantic Release
command: npx semantic-release --debug --dry-run
docker_publish:
<<: *defaults
steps:
- attach_workspace:
at: ~/repo
- setup_remote_docker:
docker_layer_caching: true
- run:
name: Build and push Docker image
command: |
docker build -t ohif/$IMAGE_NAME:$TAG .
echo $DOCKER_PWD | docker login -u $DOCKER_LOGIN --password-stdin
docker push ohif/$IMAGE_NAME:$TAG
command: npx semantic-release --debug
docs_publish:
<<: *defaults
@ -106,6 +92,23 @@ jobs:
name: Publish Docs
command: yarn run docs:publish
docker_publish:
<<: *defaults
steps:
- attach_workspace:
at: ~/repo
- run:
name: Skip if no new version
command: [ ! -e /tmp/updated-version ] || exit 1
- setup_remote_docker:
docker_layer_caching: true
- run:
name: Build and push Docker image
command: |
docker build -t ohif/$IMAGE_NAME:{{ checksum "/tmp/updated-version" }}.${CIRCLE_BUILD_NUM} .
echo $DOCKER_PWD | docker login -u $DOCKER_LOGIN --password-stdin
docker push ohif/$IMAGE_NAME:{{ checksum "/tmp/updated-version" }}.${CIRCLE_BUILD_NUM}
workflows:
version: 2
@ -136,3 +139,4 @@ workflows:
- docker_publish:
requires:
- build_and_test
- npm_publish

14
.releaserc Normal file
View File

@ -0,0 +1,14 @@
{
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
"@semantic-release/github",
[
"@semantic-release/exec",
{
"publishCmd": "echo ${nextRelease.version} > /tmp/updated-version"
}
]
]
}