You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 12 Next »

TeamCity

JetBrains TeamCity is the main CI/CD service for building, testing and releasing Apache Ignite and it's components.

TeamCity 1

URL: https://ci.ignite.apache.org/

TeamCity 2

URL: https://ci2.ignite.apache.org/

TC1 → TC2 syncing

Current scheme of keeping consistency between 2 instances of TeamCity instances.

Build configuration settings

  1. TC1 is set to keep it's settings via enabled Versioned Settings option.
    Storage format is XML, editing in UI is allowed (for continuous usual usage of the system by users).
  2. The code currently is stored in separate GitHub repository. Main branch is tc1.
  3. Each edit in TC1 results in commit to repository with corresponding change set.
  4. After each commit the build configuration in TC2 [Tools] / TC1 to TC2 sync is triggered, which takes code from tc1, modifies it with tc1-to-tc2-sync.sh script and pushes updated code to tc2 branch.
    This build exists on TC1 too for editing, but VCS trigger is disabled in TC1 and enabled in TC2, TC2 runs this build.
  5. TC2 is set to keep it's settings via enabled Versioned Settings option too, but from different branch as main (tc2).
    Storage format is XML too, editing in UI is not allowed (to keep TC2 as "replica only" mode)
  6. TC2's configuration is re-rendered according changes from tc2 branch after each run of sync build.

Secrets

  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

      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

      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

      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

      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

      cd /<target-teamcity-data-dir>/config/project
      find . -name credentials.json -exec rm -v {} \;
      unzip credentialsJSON.zip *
    8. Restart TeamCity instance

      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

Users / Groups / Roles


Travis CI


Backlog issues

  1. TC: Introduce automated instructions for preparing Linux and Windows agents.
  2. TC: Remove obsolete secret tokens.
  3. TC: Introduce Kotlin DSL based settings (instead of XML).
  • No labels