|
| 1 | +--- |
| 2 | +name: Add replica matrix |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + paths: |
| 6 | + - .github/workflows/**/* |
| 7 | + - spec/**/* |
| 8 | + - lib/**/* |
| 9 | + - tasks/**/* |
| 10 | + - functions/**/* |
| 11 | + - types/**/* |
| 12 | + - plans/**/* |
| 13 | + - hiera/**/* |
| 14 | + - manifests/**/* |
| 15 | + - templates/**/* |
| 16 | + - files/**/* |
| 17 | + - metadata.json |
| 18 | + - Rakefile |
| 19 | + - Gemfile |
| 20 | + - provision.yaml |
| 21 | + - .rspec |
| 22 | + - .rubocop.yml |
| 23 | + - .puppet-lint.rc |
| 24 | + - .fixtures.yml |
| 25 | + branches: [main] |
| 26 | + workflow_dispatch: {} |
| 27 | +jobs: |
| 28 | + test-add-replica: |
| 29 | + name: PE ${{ matrix.version }} ${{ matrix.architecture }} on ${{ matrix.image }} |
| 30 | + runs-on: ubuntu-20.04 |
| 31 | + env: |
| 32 | + BOLT_GEM: true |
| 33 | + BOLT_DISABLE_ANALYTICS: true |
| 34 | + LANG: en_US.UTF-8 |
| 35 | + strategy: |
| 36 | + fail-fast: false |
| 37 | + matrix: |
| 38 | + architecture: [standard, standard-with-dr, large, extra-large] |
| 39 | + version: [2023.8.0] |
| 40 | + image: [almalinux-cloud/almalinux-8] |
| 41 | + steps: |
| 42 | + - name: Checkout Source |
| 43 | + uses: actions/checkout@v2 |
| 44 | + - name: Activate Ruby 2.7 |
| 45 | + uses: ruby/setup-ruby@v1 |
| 46 | + with: |
| 47 | + ruby-version: '2.7' |
| 48 | + bundler-cache: true |
| 49 | + - name: Print bundle environment |
| 50 | + if: ${{ github.repository_owner == 'puppetlabs' }} |
| 51 | + run: | |
| 52 | + echo ::group::info:bundler |
| 53 | + bundle env |
| 54 | + echo ::endgroup:: |
| 55 | + - name: Provision test cluster (specified architecture and a spare replica) |
| 56 | + timeout-minutes: 15 |
| 57 | + run: | |
| 58 | + echo ::group::prepare |
| 59 | + mkdir -p $HOME/.ssh |
| 60 | + echo 'Host *' > $HOME/.ssh/config |
| 61 | + echo ' ServerAliveInterval 150' >> $HOME/.ssh/config |
| 62 | + echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config |
| 63 | + bundle exec rake spec_prep |
| 64 | + echo ::endgroup:: |
| 65 | + echo ::group::provision |
| 66 | + bundle exec bolt plan run peadm_spec::provision_test_cluster \ |
| 67 | + --modulepath spec/fixtures/modules \ |
| 68 | + provider=provision_service \ |
| 69 | + image=${{ matrix.image }} \ |
| 70 | + architecture=${{ matrix.architecture }}-and-spare-replica |
| 71 | + echo ::endgroup:: |
| 72 | + echo ::group::info:request |
| 73 | + cat request.json || true; echo |
| 74 | + echo ::endgroup:: |
| 75 | + echo ::group::info:inventory |
| 76 | + sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true |
| 77 | + echo ::endgroup:: |
| 78 | + - name: Install PE on test cluster |
| 79 | + timeout-minutes: 120 |
| 80 | + run: | |
| 81 | + bundle exec bolt plan run peadm_spec::install_test_cluster \ |
| 82 | + --inventoryfile spec/fixtures/litmus_inventory.yaml \ |
| 83 | + --modulepath spec/fixtures/modules \ |
| 84 | + architecture=${{ matrix.architecture }} \ |
| 85 | + version=${{ matrix.version }} \ |
| 86 | + console_password=${{ secrets.CONSOLE_PASSWORD }} \ |
| 87 | + code_manager_auto_configure=true |
| 88 | + - name: Run add_replica plan |
| 89 | + timeout-minutes: 60 |
| 90 | + run: | |
| 91 | + bundle exec bolt plan run peadm_spec::add_replica -v \ |
| 92 | + --inventoryfile spec/fixtures/litmus_inventory.yaml \ |
| 93 | + --modulepath spec/fixtures/modules \ |
| 94 | + --stream |
| 95 | + - name: Verify that replica was added |
| 96 | + timeout-minutes: 10 |
| 97 | + run: | |
| 98 | + bundle exec bolt plan run peadm_spec::verify_replica -v \ |
| 99 | + --inventoryfile spec/fixtures/litmus_inventory.yaml \ |
| 100 | + --modulepath spec/fixtures/modules |
| 101 | + - name: Tear down test cluster |
| 102 | + if: ${{ always() }} |
| 103 | + continue-on-error: true |
| 104 | + run: |- |
| 105 | + if [ -f spec/fixtures/litmus_inventory.yaml ]; then |
| 106 | + echo ::group::tear_down |
| 107 | + bundle exec rake 'litmus:tear_down' |
| 108 | + echo ::endgroup:: |
| 109 | + echo ::group::info:request |
| 110 | + cat request.json || true; echo |
| 111 | + echo ::endgroup:: |
| 112 | + fi |
0 commit comments