Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- set -e
- #setup vars
- repo=$1
- tag=$2
- usage () {
- echo "Need to specify repo as first arg, tag as second"
- exit 1
- }
- if [ -z "${repo}" ] ; then
- usage
- fi
- if [ -z "${tag}" ] ; then
- usage
- fi
- #cleanup
- rm -f push
- #pull base
- if [ ! -z "${base}" ] ; then
- docker pull "${base}"
- fi
- docker build -t "${repo}:${tag}" .
- docker tag "${repo}:${tag}" "${repo}:latest"
- echo "#!/bin/bash
- set -e
- docker push ${repo}:${tag}
- docker push ${repo}:latest
- rm push
- " > push
- chmod +x push
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement