adding docker template blessing
[ci-management.git] / jjb / include-docker-blessing.sh
1 #!/bin/bash
2
3 if [ -z "$VERSION" ];
4 then
5     echo "Error: no version provided"
6     exit 1
7 fi
8
9 if [ -z "$TIMESTAMP" ];
10 then
11     echo "Error: no timestamp provided"
12     exit 1
13 fi
14
15 if [ -z "$PROJECT" ];
16 then
17     echo "Error: no project provided"
18     exit 1
19 fi
20
21 RELEASE_REPOSITORY="nexus3.openecomp.org:10002"
22 SNAPSHOT_REPOSITORY="nexus3.openecomp.org:10003"
23 STAGING_IMAGE="openecomp/$PROJECT:$VERSION-STAGING-$TIMESTAMP"
24 RELEASE_IMAGE="openecomp/$PROJECT:$VERSION"
25
26 docker pull "$SNAPSHOT_REPOSITORY/$STAGING_IMAGE"
27 docker tag "$SNAPSHOT_REPOSITORY/$STAGING_IMAGE" "$RELEASE_REPOSITORY/$RELEASE_IMAGE"
28 docker push "$RELEASE_REPOSITORY/$RELEASE_IMAGE"