File: build_push_docker.sh

package info (click to toggle)
picard-tools 2.18.25+dfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 101,284 kB
  • sloc: java: 69,309; xml: 266; sh: 220; makefile: 38
file content (29 lines) | stat: -rwxr-xr-x 850 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env bash

# This script is used to build and deploy docker images for Picard

if [[ "$1" == "" ]]
then
    echo "Usage: build_push_docker.sh <git-tag>"
    exit 1
fi

declare -r TAG=${1}

declare -r PICARD_TAG=broadinstitute/picard:${TAG}
declare -r PICARD_CLOUD_TAG=us.gcr.io/broad-gotc-prod/picard-cloud:${TAG}

echo "Will build and push the following docker images:"
echo ${PICARD_TAG}
echo ${PICARD_CLOUD_TAG}

read -p "Is this really what you want to do? " -n 1 -r
echo    # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
    docker build -t ${PICARD_TAG} --build-arg build_command=shadowJar --build-arg jar_name=picard.jar .
    docker build -t ${PICARD_CLOUD_TAG} --build-arg build_command=cloudJar --build-arg jar_name=picardcloud.jar .

    docker push ${PICARD_TAG}
    gcloud docker -- push ${PICARD_CLOUD_TAG}
fi