Comments (2)
Actually I have an idea - I can use a post build hook to see if I can tag the image and push there.
from circleci-orbs.
Yeah that totally worked! Here is what I did if anyone else needs in the future. The idea here is that we want to build on pull requests, but not on merge to master. The first block here will build the container, and preview the tag based on querying the software inside:
version: 2.1
orbs:
# https://circleci.com/orbs/registry/orb/circleci/docker-publish
docker-publish: circleci/[email protected]
workflows:
# This workflow will be run on all branches but master (to test)
build_without_publishing_job:
jobs:
- docker-publish/publish:
image: singularityhub/sif
deploy: false
tag: latest
filters:
branches:
ignore: master
after_build:
- run:
name: Preview Docker Tag for Build
command: |
DOCKER_TAG=$(docker run singularityhub/sif:latest --version)
echo "Version for Docker tag is ${DOCKER_TAG}"
And this second block is the same, but deploy is set to True (This is the default) and we add a docker tag command.
# This workflow will deploy images on merge to master only
docker_with_lifecycle:
jobs:
- docker-publish/publish:
image: singularityhub/sif
tag: latest
filters:
branches:
only: master
after_build:
- run:
name: Publish Docker Tag with SIF Python Version
command: |
DOCKER_TAG=$(docker run singularityhub/sif:latest --version)
echo "Version for Docker tag is ${DOCKER_TAG}"
docker tag singularityhub/sif:latest singularityhub/sif:${DOCKER_TAG}
I originally had a docker push in that run block, but actually it isn't needed because the final push will include both containers in the namespace (singularityhub/sif) will push both. Huzzah! Here are the containers on Docker Hub -> https://cloud.docker.com/u/singularityhub/repository/registry-1.docker.io/singularityhub/sif
from circleci-orbs.
Related Issues (20)
- aws-code-deploy fails to check the existence of deployment group with extra arguments passed HOT 1
- Break circleci/aws-s3 orb into its own repository HOT 4
- Break circleci/codecov-clojure orb into its own repository HOT 4
- Break circleci/codecov orb into its own repository HOT 4
- Break circleci/gradle orb into its own repository HOT 3
- Break circleci/heroku orb into its own repository HOT 3
- Break circleci/lein-nvd orb into its own repository HOT 4
- Break circleci/maven orb into its own repository HOT 3
- Break circleci/rollbar orb into its own repository HOT 5
- Break circleci/aws-code-deploy orb into its own repository HOT 4
- circleci/aws-code-deploy isn't on readme HOT 2
- AWS Code Deploy orb missing descriptions for commands HOT 3
- codecov-clojure orb missing description for job HOT 2
- circleci/codecov-clojure and circleci/codecov aren't in the registry HOT 1
- Filesystem doesn't support posix ACLs HOT 1
- `--dry-run` spelling HOT 2
- howto: s3 orb override endpoint HOT 1
- Broken [email protected] (Succeeded deploy fails) HOT 5
- Heroku Orb environment spin up error HOT 1
- AWS-S3 orb not working, "aws: command not found" HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from circleci-orbs.