Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. After 1st sync it is required to enter secrets value represented by Tokens (in Versions Settings option).
    Current list of secrets:
  2. Instead of entering values in Tokens, it is possible to copy values from sources TeamCity instances as follows:
    1. Search for credentialsJSON settings in repository with settings

      Code Block
      languagebash
      grep -R 'credentialsJSON:' .teamcity/ | \
        sed -r 's|(.):.param name="(.)".value="(.)" .|\1 :: \2=\3|' | \
        sed -r 's| spec=.||'


    2. Search for occurrences of UUIDs in <source-teamcity-host>:/<teamcity-data-dir>/config/project

      Code Block
      languagebash
      cd /<source-teamcity-data-dir>/config/project
      find . -name credentials.json | while read file; do
          echo "${file}"
          grep --color -E '(<UUID-1>|UUID-2|...|<UUID-n>)|$' "${file}"
      done


    3. Remove not matched UUIDs (they will not be colored) by editing files manually.
    4. Copy updated credentials.json files to some folder

      Code Block
      languagebash
      cd /<source-teamcity-data-dir>/config/project
      mkdir -pv /tmp/credentialsJSON
      find . -name credentials.json | while read file; do
          cp -v --parents "${file}" /tmp/credentialsJSON
      done


    5. Pack secrets in archive

      Code Block
      languagebash
      cd /tmp/credentialsJSON
      zip -r ../credentialsJSON.zip *


    6. Copy archive to target TeamCity instance <source-teamcity-host>:/<teamcity-data-dir>/config/project
    7. Find local secrets and remove them

      Code Block
      languagebash
      cd /<target-teamcity-data-dir>/config/project
      find . -name credentials.json -exec rm -v {} \;
      unzip credentialsJSON.zip *


    8. Restart TeamCity instance

      Code Block
      languagebash
      cd /<target-teamcity-server-dir>
      bash bin/teamcity-server.sh stop
      ...
      bash bin/teamcity-server.sh start


    9. Check /<target-teamcity-server-dir>/logs/teamcity-server.log that TeamCity instance started correctly

...