Merge pull request #461 from dannyrb/master

Test improved docker image tagging
This commit is contained in:
Danny Brown 2019-05-21 13:01:48 -04:00 committed by GitHub
commit 87cf8c210c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 39 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,29 @@ jobs:
name: Publish Docs
command: yarn run docs:publish
docker_publish:
<<: *defaults
steps:
- attach_workspace:
at: ~/repo
- run:
name: Skip if no new NPM version was released
command: |
#
#
if [[ ! -e /tmp/updated-version ]]; then
exit 1
fi
- 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} ohif/$IMAGE_NAME:latest .
echo $DOCKER_PWD | docker login -u $DOCKER_LOGIN --password-stdin
docker push ohif/$IMAGE_NAME:{{ checksum "/tmp/updated-version" }}.${CIRCLE_BUILD_NUM}
docker push ohif/$IMAGE_NAME:latest
workflows:
version: 2
@ -136,3 +145,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"
}
]
]
}