-
Notifications
You must be signed in to change notification settings - Fork 34
/
deploy.sh
executable file
·33 lines (24 loc) · 1.12 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
33
#!/bin/bash
if [ "${TRAVIS_PULL_REQUEST}" != "false" ];then
exit
fi
docker login -u ${DOCKER_USERNAME} -p ${DOCKER_PASSWORD}
VERSION=$(docker run --rm -it nessus_scanner:latest \
/opt/nessus/sbin/nessusd --version | awk '{print $3}' | head -n1)
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 nessus_scanner:latest ${RPRE}/${RNAME}:${MAJOR}
docker tag nessus_scanner:latest ${RPRE}/${RNAME}:${MAJOR}.${MINOR}
docker tag nessus_scanner:latest ${RPRE}/${RNAME}:${MAJOR}.${MINOR}.${PATCH}
docker tag nessus_scanner: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