build.sh 592 B

1234567891011121314151617181920212223
  1. #!/usr/bin/env bash
  2. registry_host="ccr.ccs.tencentyun.com/aionnect"
  3. project_name="hello-java"
  4. cd ..
  5. ./gradlew build
  6. cp -r build/libs/*.jar deploy/app.jar
  7. for item in $(docker images | grep -E "$registry_host/$project_name\s+\S*" -o);
  8. do
  9. if [[ $item != "$registry_host/$project_name" ]];
  10. then
  11. echo "remove $registry_host/$project_name:$item"
  12. docker rmi "$registry_host/$project_name:$item"
  13. fi
  14. done
  15. tag=$(date +%s)
  16. docker build --no-cache --disable-content-trust=true -t $registry_host/$project_name:$tag ./deploy
  17. #docker push $registry_host/$project_name:$tag