diff --git a/build-docker.sh b/build-docker.sh index 6b42feb..64321b9 100644 --- a/build-docker.sh +++ b/build-docker.sh @@ -3,7 +3,12 @@ JAR_NAME=`ls target | grep api-|grep -v original` JAR_VERSION=${JAR_NAME%.*} JAR_VERSION=${JAR_VERSION#*-} +BUILD_TIME=$(date "+%Y%m%d%H%M%S") mkdir target/extracted java -Djarmode=layertools -jar target/*.jar extract --destination target/extracted -docker build -t hub.fatweb.top/fatweb-api:latest -t hub.fatweb.top/fatweb-api:$JAR_VERSION -t hub.fatweb.top/fatweb-api:$JAR_VERSION-$(date "+%Y%m%d%H%M%S") . \ No newline at end of file +docker build -t hub.fatweb.top/fatweb-api:latest -t hub.fatweb.top/fatweb-api:$JAR_VERSION -t hub.fatweb.top/fatweb-api:$JAR_VERSION-${BUILD_TIME} . +cat "${KEYS_PATH}/docker.password" | docker login hub.fatweb.top -u jenkins --password-stdin +docker push hub.fatweb.top/fatweb-api:latest +docker push hub.fatweb.top/fatweb-api:$JAR_VERSION +docker push hub.fatweb.top/fatweb-api:$JAR_VERSION-${BUILD_TIME} \ No newline at end of file diff --git a/push-docker.sh b/push-docker.sh deleted file mode 100644 index 8c4887a..0000000 --- a/push-docker.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -echo ${KEYS_PATH} \ No newline at end of file