release.sh 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #!/bin/bash
  2. version=`cat VERSION`
  3. echo "version: $version"
  4. cp ../source/bin/main ../../../deploy/MIVA/source/bin/
  5. cp ../lib/* ../../../deploy/MIVA/lib
  6. # cp -rf ../source/config/* ../../../deploy/MIVA/source/config/
  7. echo "version: $version" > ../../../deploy/MIVA/version
  8. ./clear.sh
  9. # run build
  10. ./build.sh
  11. # tag source
  12. cd ../
  13. git add -A
  14. git commit -m "version $version"
  15. git tag -a "$version" -m "version $version"
  16. git push MIVA master
  17. git push --tags MIVA master
  18. # tag deploy
  19. cd ../../deploy/MIVA
  20. git add -A
  21. git commit -m "version $version"
  22. git tag -a "$version" -m "version $version"
  23. git push origin master
  24. git push --tags origin master
  25. # SET THE FOLLOWING VARIABLES
  26. # docker hub username
  27. USERNAME=192.168.31.174:8080/miva
  28. IMAGE=mivainfer
  29. docker tag $USERNAME/$IMAGE:latest $USERNAME/$IMAGE:$version
  30. IMAGE=mivadb
  31. docker tag $USERNAME/$IMAGE:latest $USERNAME/$IMAGE:$version
  32. # push it
  33. # mivainfer
  34. IMAGE=mivainfer
  35. docker push $USERNAME/$IMAGE:latest
  36. docker push $USERNAME/$IMAGE:$version
  37. # mivadb
  38. IMAGE=mivadb
  39. docker push $USERNAME/$IMAGE:latest
  40. docker push $USERNAME/$IMAGE:$version
  41. # remove
  42. IMAGE=mivadb
  43. docker rmi $USERNAME/$IMAGE:latest
  44. docker rmi $USERNAME/$IMAGE:$version
  45. IMAGE=mivainfer
  46. docker rmi $USERNAME/$IMAGE:latest
  47. docker rmi $USERNAME/$IMAGE:$version