-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdeploy.sh
executable file
·32 lines (23 loc) · 1.03 KB
/
deploy.sh
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
#!/bin/bash
if [ "${TRAVIS_PULL_REQUEST}" != "false" ];then
exit
fi
docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}
VERSION=$(docker run --rm -it nnm:latest /opt/nnm/bin/nnm -v | awk '/NNM/{print $2}')
MAJOR=$(echo ${VERSION} | cut -d '.' -f 1)
MINOR=$(echo ${VERSION} | cut -d '.' -f 2)
PATCH=$(echo ${VERSION} | cut -d '.' -f 3)
echo "Discovered Nessus Version ${VERSION} = ${MAJOR}.${MINOR}.${PATCH}"
docker tag nnm:latest ${RPRE}/${RNAME}:${MAJOR}
docker tag nnm:latest ${RPRE}/${RNAME}:${MAJOR}.${MINOR}
docker tag nnm:latest ${RPRE}/${RNAME}:${MAJOR}.${MINOR}.${PATCH}
docker tag nnm:latest ${RPRE}/${RNAME}:latest
echo "Images to be pushed: " \
"${RPRE}/${RNAME}:${MAJOR}, " \
"${RPRE}/${RNAME}:${MAJOR}.${MINOR}, " \
"${RPRE}/${RNAME}:${MAJOR}.${MINOR}.${PATCH}, " \
"${RPRE}/${RNAME}:latest"
docker push ${RPRE}/${RNAME}:${MAJOR}
docker push ${RPRE}/${RNAME}:${MAJOR}.${MINOR}
docker push ${RPRE}/${RNAME}:${MAJOR}.${MINOR}.${PATCH}
docker push ${RPRE}/${RNAME}:latest