summaryrefslogtreecommitdiffstats
path: root/jjb/include-docker-blessing.sh
blob: 0c843f790a82cd65c6b4a07a2b03e701341140b2 (plain)
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
30
31
32
33
34
#!/bin/bash

if [ -z "$X" ];
then
    echo "Error: no X version provided"
    exit 1
fi

if [ -z "$Y" ];
then
    echo "Error: no Y version provided"
    exit 1
fi

if [ -z "$Z" ];
then
    echo "Error: no Z version provided"
    exit 1
fi

if [ -z "$PROJECT" ];
then
    echo "Error: no project provided"
    exit 1
fi

RELEASE_REPOSITORY="nexus3.onap.org:10002"
SNAPSHOT_REPOSITORY="nexus3.onap.org:10003"
STAGING_IMAGE="openecomp/$PROJECT:$X.$Y-STAGING-latest"
RELEASE_IMAGE="openecomp/$PROJECT:$X.$Y.$Z"

docker pull "$SNAPSHOT_REPOSITORY/$STAGING_IMAGE"
docker tag "$SNAPSHOT_REPOSITORY/$STAGING_IMAGE" "$RELEASE_REPOSITORY/$RELEASE_IMAGE"
docker push "$RELEASE_REPOSITORY/$RELEASE_IMAGE"