Update build-docker.sh #5

Merged
FatttSnake merged 1 commits from FatttSnake into dev 2023-10-09 11:59:00 +08:00
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}