docker.sh 345 B

123456789101112131415
  1. #!/bin/sh -e
  2. name=${CONTAINER_IMAGE}/server
  3. # build and publish Docker image (gitlab-ci)
  4. docker build . \
  5. -t ${name}:${CI_COMMIT_SHA} \
  6. -t ${name}:${CI_COMMIT_REF_NAME} \
  7. -t ${name}:latest
  8. docker push ${name}:${CI_COMMIT_SHA}
  9. docker push ${name}:${CI_COMMIT_REF_NAME}
  10. [ "$CI_COMMIT_BRANCH" = master ] && docker push ${name}:latest
  11. exit 0