06.svn-createReleaseBranch.bash 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. set -e
  2. # source 06.svn-createReleaseBranch.bash
  3. #---------------------------------------------------------------------
  4. # args
  5. args_="
  6. export codePath=/root/docker-cache/jenkins/jenkins_home/workspace/Sers/develop/20/code-with-prod-version
  7. export SVN_PATH=svn://svn.ki.lith.cloud/Sers
  8. export SVN_USERNAME=jenkins
  9. export SVN_PASSWORD=**
  10. export versionSuffix=.158
  11. # "
  12. # remove spaces
  13. versionSuffix=${versionSuffix// /}
  14. docker run -i --rm -v $codePath:/root/svn \
  15. -e codePath="$codePath" -e SVN_PATH="$SVN_PATH" -e SVN_USERNAME="$SVN_USERNAME" -e SVN_PASSWORD="$SVN_PASSWORD" -e versionSuffix="$versionSuffix" \
  16. docker.lith.cloud:8/dockerhub/serset/svn-client bash -c '
  17. set -e
  18. echo "06.svn-createReleaseBranch.bash"
  19. echo "06.svn-createReleaseBranch.bash --> #1 change version in csproj and commit to develop branch"
  20. echo "06.svn-createReleaseBranch.bash --> #1.1 pull code from develop branch"
  21. codePath=/root/svn/branch-develop
  22. mkdir -p $codePath;cd $codePath;
  23. svn checkout $SVN_PATH/branches/develop $codePath --username $SVN_USERNAME --password $SVN_PASSWORD --no-auth-cache > /dev/null;
  24. echo "06.svn-createReleaseBranch.bash --> #1.2 change version in csproj"
  25. export versionSuffix=$versionSuffix
  26. cd $codePath/Publish/DevOps2/build-bash; source 20.change-app-version.bash;
  27. echo "appVersion: [$appVersion] -> [$nextAppVersion]"
  28. export appVersion=$nextAppVersion
  29. cd $codePath;
  30. echo "06.svn-createReleaseBranch.bash --> #1.3 commit to develop branch"
  31. svn commit $codePath -m "[tag] Sers $appVersion" --username $SVN_USERNAME --password $SVN_PASSWORD --no-auth-cache
  32. echo "06.svn-createReleaseBranch.bash --> #2 merge to trunk"
  33. echo "06.svn-createReleaseBranch.bash --> #2.1 pull code from trunk branch"
  34. codePath=/root/svn/branch-trunk
  35. mkdir -p $codePath;cd $codePath;
  36. svn checkout $SVN_PATH/trunk $codePath --username $SVN_USERNAME --password $SVN_PASSWORD --no-auth-cache > /dev/null;
  37. echo "06.svn-createReleaseBranch.bash --> #2.2 merge to trunk"
  38. svn merge $SVN_PATH/branches/develop --username $SVN_USERNAME --password $SVN_PASSWORD --no-auth-cache
  39. echo "06.svn-createReleaseBranch.bash --> #2.3 commit to trunk branch"
  40. svn commit $codePath -m "[trunk] merge from develop:$appVersion" --username $SVN_USERNAME --password $SVN_PASSWORD --no-auth-cache
  41. echo "06.svn-createReleaseBranch.bash --> #3 create tag branch from trunk"
  42. echo "appVersion: $appVersion"
  43. svn copy $SVN_PATH/trunk $SVN_PATH/tags/$appVersion -m "[tag] Sers $appVersion" --username $SVN_USERNAME --password $SVN_PASSWORD --no-auth-cache
  44. '