|
1 | 1 | --- |
2 | | -name: Convert 1 compiler to legacy |
| 2 | +name: Convert compiler to legacy |
3 | 3 | on: |
4 | 4 | pull_request: |
5 | 5 | paths: |
|
31 | 31 | required: true |
32 | 32 | default: 'false' |
33 | 33 | jobs: |
34 | | - install: |
35 | | - name: Install and convert compilers to legacy |
| 34 | + convert_compiler: |
| 35 | + name: Convert compilers to legacy |
36 | 36 | runs-on: ubuntu-20.04 |
37 | 37 | env: |
38 | 38 | BOLT_GEM: true |
@@ -159,3 +159,107 @@ jobs: |
159 | 159 | cat request.json || true; echo |
160 | 160 | echo ::endgroup:: |
161 | 161 | fi |
| 162 | + install: |
| 163 | + name: Install PE with legacy compilers |
| 164 | + runs-on: ubuntu-20.04 |
| 165 | + env: |
| 166 | + BOLT_GEM: true |
| 167 | + BOLT_DISABLE_ANALYTICS: true |
| 168 | + LANG: en_US.UTF-8 |
| 169 | + steps: |
| 170 | + - name: Start SSH session |
| 171 | + if: ${{ github.event.inputs.ssh-debugging == 'true' }} |
| 172 | + uses: luchihoratiu/debug-via-ssh@main |
| 173 | + with: |
| 174 | + NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }} |
| 175 | + SSH_PASS: ${{ secrets.SSH_PASS }} |
| 176 | + - name: Checkout Source |
| 177 | + uses: actions/checkout@v2 |
| 178 | + - name: Activate Ruby 2.7 |
| 179 | + uses: ruby/setup-ruby@v1 |
| 180 | + with: |
| 181 | + ruby-version: '2.7' |
| 182 | + bundler-cache: true |
| 183 | + - name: Print bundle environment |
| 184 | + if: ${{ github.repository_owner == 'puppetlabs' }} |
| 185 | + run: | |
| 186 | + echo ::group::info:bundler |
| 187 | + bundle env |
| 188 | + echo ::endgroup:: |
| 189 | + - name: Provision test cluster |
| 190 | + timeout-minutes: 15 |
| 191 | + run: | |
| 192 | + echo ::group::prepare |
| 193 | + mkdir -p $HOME/.ssh |
| 194 | + echo 'Host *' > $HOME/.ssh/config |
| 195 | + echo ' ServerAliveInterval 150' >> $HOME/.ssh/config |
| 196 | + echo ' ServerAliveCountMax 2' >> $HOME/.ssh/config |
| 197 | + bundle exec rake spec_prep |
| 198 | + echo ::endgroup:: |
| 199 | + echo ::group::provision |
| 200 | + bundle exec bolt plan run peadm_spec::provision_test_cluster \ |
| 201 | + --modulepath spec/fixtures/modules \ |
| 202 | + provider=provision_service \ |
| 203 | + image=almalinux-cloud/almalinux-8 \ |
| 204 | + architecture=large-with-dr |
| 205 | + echo ::endgroup:: |
| 206 | + echo ::group::certnames |
| 207 | + bundle exec bolt plan run peadm_spec::add_inventory_hostnames \ |
| 208 | + --inventory spec/fixtures/litmus_inventory.yaml \ |
| 209 | + --modulepath spec/fixtures/modules \ |
| 210 | + --no-host-key-check \ |
| 211 | + inventory_file=spec/fixtures/litmus_inventory.yaml |
| 212 | + echo ::endgroup:: |
| 213 | + echo ::group::info:request |
| 214 | + cat request.json || true; echo |
| 215 | + echo ::endgroup:: |
| 216 | + echo ::group::info:inventory |
| 217 | + sed -e 's/password: .*/password: "[redacted]"/' < spec/fixtures/litmus_inventory.yaml || true |
| 218 | + echo ::endgroup:: |
| 219 | + - name: Set up yq |
| 220 | + uses: frenck/action-setup-yq@v1 |
| 221 | + with: |
| 222 | + version: v4.30.5 |
| 223 | + - name: Create the params.json file |
| 224 | + run: | |
| 225 | + primary=$(yq '.groups[].targets[] | select(.vars.role == "primary") | .name' spec/fixtures/litmus_inventory.yaml) |
| 226 | + compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 1) |
| 227 | + legacy_compiler=$(yq '.groups[].targets[] | select(.vars.role == "compiler") | .name' spec/fixtures/litmus_inventory.yaml | head -n 2) |
| 228 | + jq -n --arg primary_host "$primary" \ |
| 229 | + --argjson legacy_compilers '[$legacy_compiler]' \ |
| 230 | + --argjson compiler_hosts '[$compiler]' \ |
| 231 | + --arg version "2023.8.0" \ |
| 232 | + --arg console_password "${{ secrets.CONSOLE_PASSWORD }}" \ |
| 233 | + '{primary_host: $primary_host, legacy_compilers: $legacy_compilers, compiler_hosts: $compiler_hosts, version: $version, console_password: $console_password}' > params.json |
| 234 | + - name: Install PE with legacy compilers |
| 235 | + timeout-minutes: 120 |
| 236 | + run: | |
| 237 | + echo ::group::params.json |
| 238 | + cat params.json |
| 239 | + echo ::endgroup:: |
| 240 | + echo ::group::install |
| 241 | + bundle exec bolt plan run peadm::install \ |
| 242 | + --inventoryfile spec/fixtures/litmus_inventory.yaml \ |
| 243 | + --modulepath spec/fixtures/modules \ |
| 244 | + @params.json |
| 245 | + echo ::endgroup:: |
| 246 | + - name: Wait as long as the file ${HOME}/pause file is present |
| 247 | + if: ${{ always() && github.event.inputs.ssh-debugging == 'true' }} |
| 248 | + run: | |
| 249 | + while [ -f "${HOME}/pause" ] ; do |
| 250 | + echo "${HOME}/pause present, sleeping for 60 seconds..." |
| 251 | + sleep 60 |
| 252 | + done |
| 253 | + echo "${HOME}/pause absent, continuing workflow." |
| 254 | + - name: Tear down test cluster |
| 255 | + if: ${{ always() }} |
| 256 | + continue-on-error: true |
| 257 | + run: |- |
| 258 | + if [ -f spec/fixtures/litmus_inventory.yaml ]; then |
| 259 | + echo ::group::tear_down |
| 260 | + bundle exec rake 'litmus:tear_down' |
| 261 | + echo ::endgroup:: |
| 262 | + echo ::group::info:request |
| 263 | + cat request.json || true; echo |
| 264 | + echo ::endgroup:: |
| 265 | + fi |
0 commit comments