build-and-push-docker.sh 415 B

12345678910
  1. #!/usr/bin/env bash
  2. dockerImage=registry.cn-shenzhen.aliyuncs.com/jetlinks/jetlinks-standalone:$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
  3. ./mvnw clean package -Dmaven.test.skip=true -Dmaven.build.timestamp="$(date "+%Y-%m-%d %H:%M:%S")"
  4. if [ $? -ne 0 ];then
  5. echo "构建失败!"
  6. else
  7. cd ./jetlinks-standalone || exit
  8. docker build -t "$dockerImage" . && docker push "$dockerImage"
  9. fi