Update build-docker.sh

This commit is contained in:
2023-10-09 11:46:58 +08:00
parent e66ad05041
commit fad06ac96b
2 changed files with 6 additions and 4 deletions

View File

@@ -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") .
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}

View File

@@ -1,3 +0,0 @@
#!/bin/bash
echo ${KEYS_PATH}