Upgrade to global-jjb v0.17.0
[ci-management.git] / jjb / include-docker-blessing.sh
1 #!/bin/bash
2
3 if [ -z "$X" ];
4 then
5     echo "Error: no X version provided"
6     exit 1
7 fi
8
9 if [ -z "$Y" ];
10 then
11     echo "Error: no Y version provided"
12     exit 1
13 fi
14
15 if [ -z "$Z" ];
16 then
17     echo "Error: no Z version provided"
18     exit 1
19 fi
20
21 if [ -z "$PROJECT" ];
22 then
23     echo "Error: no project provided"
24     exit 1
25 fi
26
27 RELEASE_REPOSITORY="nexus3.onap.org:10002"
28 SNAPSHOT_REPOSITORY="nexus3.onap.org:10003"
29 STAGING_IMAGE="openecomp/$PROJECT:$X.$Y-STAGING-latest"
30 RELEASE_IMAGE="openecomp/$PROJECT:$X.$Y.$Z"
31
32 docker pull "$SNAPSHOT_REPOSITORY/$STAGING_IMAGE"
33 docker tag "$SNAPSHOT_REPOSITORY/$STAGING_IMAGE" "$RELEASE_REPOSITORY/$RELEASE_IMAGE"
34 docker push "$RELEASE_REPOSITORY/$RELEASE_IMAGE"