Update build-docker.sh: add snapshot judgment #6
@@ -7,8 +7,18 @@ BUILD_TIME=$(date "+%Y%m%d%H%M%S")
|
|||||||
|
|
||||||
mkdir target/extracted
|
mkdir target/extracted
|
||||||
java -Djarmode=layertools -jar target/*.jar extract --destination target/extracted
|
java -Djarmode=layertools -jar target/*.jar extract --destination target/extracted
|
||||||
|
|
||||||
|
if [[ "${JAR_VERSION}" =~ ^.*SNAPSHOT$ ]]
|
||||||
|
then
|
||||||
|
docker build -t hub.fatweb.top/fatweb-api:snapshot-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:snapshot-latest
|
||||||
|
docker push hub.fatweb.top/fatweb-api:$JAR_VERSION
|
||||||
|
docker push hub.fatweb.top/fatweb-api:$JAR_VERSION-${BUILD_TIME}
|
||||||
|
else
|
||||||
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} .
|
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
|
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:latest
|
||||||
docker push hub.fatweb.top/fatweb-api:$JAR_VERSION
|
docker push hub.fatweb.top/fatweb-api:$JAR_VERSION
|
||||||
docker push hub.fatweb.top/fatweb-api:$JAR_VERSION-${BUILD_TIME}
|
docker push hub.fatweb.top/fatweb-api:$JAR_VERSION-${BUILD_TIME}
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user