blob: b056afb19d60fc36f7d1a69987d28ead0422682c [file] [log] [blame]
Venkata Harish K Kajurbaaef362017-02-20 15:42:02 +00001#!/bin/bash
2
Jeremy Phelps48028ab2017-03-28 15:38:24 -05003DOCKER_REPOSITORY="nexus3.onap.org:10003"
Venkata Harish K Kajurbaaef362017-02-20 15:42:02 +00004SEARCH="aai-service";
Venkata Harish K Kajure4e19172017-03-07 07:04:28 +00005DATETIME_STAMP=$(date +%Y%m%dT%H%M%S);
Venkata Harish K Kajurda43c212017-03-09 22:17:50 +00006VERSION_FILE="version.properties"
7
8# Check for the version file
9# If it exists, load the version from that file
10# If not found, then use the current version as 1.1.0 for docker images
11if [ -f "$VERSION_FILE" ]; then
12 source $VERSION_FILE;
13 VERSION=$release_version;
14else
15 VERSION=1.1.0;
16fi
17
18
Venkata Harish K Kajure4e19172017-03-07 07:04:28 +000019SNAPSHOT_TAG=${VERSION}-SNAPSHOT-${DATETIME_STAMP};
20STAGING_TAG=${VERSION}-STAGING-${DATETIME_STAMP};
Venkata Harish K Kajurbaaef362017-02-20 15:42:02 +000021
22if [[ $PROJECT =~ $SEARCH ]] ; then
Venkata Harish K Kajure4e19172017-03-07 07:04:28 +000023
24 REPO_PATH=$DOCKER_REPOSITORY/openecomp/ajsc-aai;
25
26 docker tag $REPO_PATH:latest $REPO_PATH:$STAGING_TAG;
27 docker tag $REPO_PATH:latest $REPO_PATH:$SNAPSHOT_TAG;
28
Venkata Harish K Kajurbf07d0a2017-03-26 11:58:15 +000029 if [ "$VERSION" == "1.0.0" ]; then
30 docker tag $REPO_PATH:latest $REPO_PATH:1.0-STAGING-latest;
31 docker push $REPO_PATH:1.0-STAGING-latest;
Venkata Harish K Kajur8bd2ce32017-05-11 06:09:38 +000032 elif [ "$VERSION" == "1.1.0" ]; then
Venkata Harish K Kajurf2f06c92017-05-05 18:16:13 +000033 docker tag $REPO_PATH:latest $REPO_PATH:1.1-STAGING-latest;
34 docker push $REPO_PATH:1.0-STAGING-latest;
Venkata Harish K Kajurbf07d0a2017-03-26 11:58:15 +000035 else
36 docker push $REPO_PATH:latest;
37 fi
38
Venkata Harish K Kajure4e19172017-03-07 07:04:28 +000039 docker push $REPO_PATH:$STAGING_TAG;
40 docker push $REPO_PATH:$SNAPSHOT_TAG;
Venkata Harish K Kajurbaaef362017-02-20 15:42:02 +000041else
Venkata Harish K Kajur5d28ee82017-02-24 14:28:27 +000042 # Cut the prefix aai/ in example aai/model-loader
43 DOCKER_REPO_NAME=$(echo ${PROJECT} | cut -d"/" -f2-);
Venkata Harish K Kajure4e19172017-03-07 07:04:28 +000044
45 REPO_PATH=$DOCKER_REPOSITORY/openecomp/${DOCKER_REPO_NAME};
46
47 docker tag $REPO_PATH:latest $REPO_PATH:$STAGING_TAG;
48 docker tag $REPO_PATH:latest $REPO_PATH:$SNAPSHOT_TAG;
49
Venkata Harish K Kajurbf07d0a2017-03-26 11:58:15 +000050 if [ "$VERSION" == "1.0.0" ]; then
51 docker tag $REPO_PATH:latest $REPO_PATH:1.0-STAGING-latest;
52 docker push $REPO_PATH:1.0-STAGING-latest;
53 else
54 docker push $REPO_PATH:latest;
55 fi
56
Venkata Harish K Kajure4e19172017-03-07 07:04:28 +000057 docker push $REPO_PATH:$SNAPSHOT_TAG;
58 docker push $REPO_PATH:$STAGING_TAG;
Venkata Harish K Kajurbaaef362017-02-20 15:42:02 +000059fi