From a936ed7efc4507a2537ee1b7ed78310148016b2c Mon Sep 17 00:00:00 2001 From: David Lanning Date: Thu, 5 Dec 2024 17:23:42 +0000 Subject: [PATCH] Reorganize workflows so that they are all dependent on the same testsuite passing Case RE-1026: Testsuit.yml as parent to OpenStack workflows. Changelog: --- .github/workflows/openstack-centos-7.yml | 58 +- .github/workflows/openstack-cloudlinux-7.yml | 59 +- .github/workflows/openstack-ubuntu-20.yml | 633 ------------------ .github/workflows/openstack/centos-7/main.tf | 2 +- .../workflows/openstack/centos-7/variables.tf | 8 + .../workflows/openstack/cloudlinux-7/main.tf | 2 +- .../openstack/cloudlinux-7/variables.tf | 8 + .github/workflows/openstack/prune_openstack | 2 +- .github/workflows/openstack/reboot_watch | 2 +- .../openstack/ubuntu-20.04/cloud-config.yaml | 5 - .../openstack/ubuntu-20.04/cloud-init.yml | 6 - .../workflows/openstack/ubuntu-20.04/main.tf | 82 --- .../openstack/ubuntu-20.04/outputs.tf | 7 - .../openstack/ubuntu-20.04/variables.tf | 63 -- .github/workflows/testsuite.yml | 31 +- .../ubuntu20-to-ubuntu-22/complete.t | 17 - 16 files changed, 110 insertions(+), 875 deletions(-) delete mode 100644 .github/workflows/openstack-ubuntu-20.yml delete mode 100644 .github/workflows/openstack/ubuntu-20.04/cloud-config.yaml delete mode 100644 .github/workflows/openstack/ubuntu-20.04/cloud-init.yml delete mode 100644 .github/workflows/openstack/ubuntu-20.04/main.tf delete mode 100644 .github/workflows/openstack/ubuntu-20.04/outputs.tf delete mode 100644 .github/workflows/openstack/ubuntu-20.04/variables.tf delete mode 100644 t/integration/ubuntu20-to-ubuntu-22/complete.t diff --git a/.github/workflows/openstack-centos-7.yml b/.github/workflows/openstack-centos-7.yml index 0a033bb7..62c5557f 100644 --- a/.github/workflows/openstack-centos-7.yml +++ b/.github/workflows/openstack-centos-7.yml @@ -1,14 +1,17 @@ name: "Test Run: centos-7" on: - push: - branches: - - "main" - - '!docs' - tags-ignore: - - "*" - pull_request: workflow_dispatch: + inputs: + message: + description: 'Build description CentOS 7' + + workflow_run: + workflows: ["TestSuite"] + types: + - completed + + workflow_call: concurrency: group: ${{ github.workflow }}-${{ github.ref }}-openstack-centos-7 @@ -17,6 +20,8 @@ concurrency: env: TF_VAR_application_credential_id: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }} TF_VAR_application_credential_secret: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }} + TF_VAR_github_repository: ${{ github.repository }} + TF_VAR_github_run_id: ${{ github.run_id }} TF_VAR_ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} TF_VAR_ssh_public_key: ${{ secrets.SSH_PUBLIC_KEY }} TF_VAR_os_auth_region: ${{ secrets.OS_AUTH_REGION }} @@ -32,10 +37,7 @@ env: tf_working_directory: "${{ github.workspace }}/.github/workflows/openstack/centos-7" jobs: - testsuite: - uses: ./.github/workflows/testsuite.yml terraform_openstack_create: - needs: [testsuite] runs-on: self-hosted defaults: run: @@ -68,7 +70,7 @@ jobs: - name: Upload Terraform State File as Artifact uses: actions/upload-artifact@v4.4.3 with: - name: ${{ github.run_id }}-terraform.tfstate + name: ${{ github.run_id }}-centos7-terraform.tfstate path: "${{ github.workspace }}/.github/workflows/openstack/centos-7" - name: Terraform Output File Create @@ -83,7 +85,7 @@ jobs: - name: Upload VM Output uses: actions/upload-artifact@v4.4.3 with: - name: ${{ github.run_id }}-vm_ip + name: ${{ github.run_id }}-centos7-vm_ip path: ${{ github.workspace }}/${{ github.run_id }}-vm_ip overwrite: true @@ -96,7 +98,7 @@ jobs: - name: Download VM IP uses: actions/download-artifact@v4.1.8 with: - name: ${{ github.run_id }}-vm_ip + name: ${{ github.run_id }}-centos7-vm_ip path: ${{ github.workspace }}/ - name: Get VM IP from Artifact @@ -149,7 +151,7 @@ jobs: - name: Download VM IP uses: actions/download-artifact@v4.1.8 with: - name: ${{ github.run_id }}-vm_ip + name: ${{ github.run_id }}-centos7-vm_ip path: ${{ github.workspace }}/ - name: Get VM IP from Artifact @@ -184,7 +186,7 @@ jobs: - name: Download VM IP uses: actions/download-artifact@v4.1.8 with: - name: ${{ github.run_id }}-vm_ip + name: ${{ github.run_id }}-centos7-vm_ip path: ${{ github.workspace }}/ - name: Get VM IP from Artifact @@ -226,7 +228,7 @@ jobs: - name: Download VM IP uses: actions/download-artifact@v4.1.8 with: - name: ${{ github.run_id }}-vm_ip + name: ${{ github.run_id }}-centos7-vm_ip path: ${{ github.workspace }}/ - name: Get VM IP from Artifact @@ -253,7 +255,7 @@ jobs: - name: Download VM IP uses: actions/download-artifact@v4.1.8 with: - name: ${{ github.run_id }}-vm_ip + name: ${{ github.run_id }}-centos7-vm_ip path: ${{ github.workspace }}/ - name: Get VM IP from Artifact @@ -291,7 +293,7 @@ jobs: - name: Download VM IP uses: actions/download-artifact@v4.1.8 with: - name: ${{ github.run_id }}-vm_ip + name: ${{ github.run_id }}-centos7-vm_ip path: ${{ github.workspace }}/ - name: Get VM IP from Artifact @@ -318,7 +320,7 @@ jobs: - name: Download VM IP uses: actions/download-artifact@v4.1.8 with: - name: ${{ github.run_id }}-vm_ip + name: ${{ github.run_id }}-centos7-vm_ip path: ${{ github.workspace }}/ - name: Get VM IP from Artifact @@ -356,7 +358,7 @@ jobs: - name: Download VM IP uses: actions/download-artifact@v4.1.8 with: - name: ${{ github.run_id }}-vm_ip + name: ${{ github.run_id }}-centos7-vm_ip path: ${{ github.workspace }}/ - name: Get VM IP from Artifact @@ -383,7 +385,7 @@ jobs: - name: Download VM IP uses: actions/download-artifact@v4.1.8 with: - name: ${{ github.run_id }}-vm_ip + name: ${{ github.run_id }}-centos7-vm_ip path: ${{ github.workspace }}/ - name: Get VM IP from Artifact @@ -420,7 +422,7 @@ jobs: - name: Download VM IP uses: actions/download-artifact@v4.1.8 with: - name: ${{ github.run_id }}-vm_ip + name: ${{ github.run_id }}-centos7-vm_ip path: ${{ github.workspace }}/ - name: Get VM IP from Artifact @@ -447,7 +449,7 @@ jobs: - name: Download VM IP uses: actions/download-artifact@v4.1.8 with: - name: ${{ github.run_id }}-vm_ip + name: ${{ github.run_id }}-centos7-vm_ip path: ${{ github.workspace }}/ - name: Get VM IP from Artifact @@ -484,7 +486,7 @@ jobs: - name: Download VM IP uses: actions/download-artifact@v4.1.8 with: - name: ${{ github.run_id }}-vm_ip + name: ${{ github.run_id }}-centos7-vm_ip path: ${{ github.workspace }}/ - name: Get VM IP from Artifact @@ -511,7 +513,7 @@ jobs: - name: Download VM IP uses: actions/download-artifact@v4.1.8 with: - name: ${{ github.run_id }}-vm_ip + name: ${{ github.run_id }}-centos7-vm_ip path: ${{ github.workspace }}/ - name: Get VM IP from Artifact @@ -548,7 +550,7 @@ jobs: - name: Download VM IP uses: actions/download-artifact@v4.1.8 with: - name: ${{ github.run_id }}-vm_ip + name: ${{ github.run_id }}-centos7-vm_ip path: ${{ github.workspace }}/ - name: Get VM IP from Artifact @@ -575,7 +577,7 @@ jobs: - name: Download VM IP uses: actions/download-artifact@v4.1.8 with: - name: ${{ github.run_id }}-vm_ip + name: ${{ github.run_id }}-centos7-vm_ip path: ${{ github.workspace }}/ - name: Get VM IP from Artifact @@ -612,7 +614,7 @@ jobs: - name: Download Terraform State uses: actions/download-artifact@v4.1.8 with: - name: ${{ github.run_id }}-terraform.tfstate + name: ${{ github.run_id }}-centos7-terraform.tfstate path: "${{ github.workspace }}/.github/workflows/openstack/centos-7/terraform" diff --git a/.github/workflows/openstack-cloudlinux-7.yml b/.github/workflows/openstack-cloudlinux-7.yml index 672fe019..33a90310 100644 --- a/.github/workflows/openstack-cloudlinux-7.yml +++ b/.github/workflows/openstack-cloudlinux-7.yml @@ -1,14 +1,17 @@ name: "Test Run: cloudlinux-7" on: - push: - branches: - - "main" - - '!docs' - tags-ignore: - - "*" - pull_request: workflow_dispatch: + inputs: + message: + description: 'Build description CloudLinux 7' + + workflow_run: + workflows: ["TestSuite"] + types: + - completed + + workflow_call: concurrency: group: ${{ github.workflow }}-${{ github.ref }}-openstack-cloudlinux-7 @@ -17,6 +20,8 @@ concurrency: env: TF_VAR_application_credential_id: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }} TF_VAR_application_credential_secret: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }} + TF_VAR_github_repository: ${{ github.repository }} + TF_VAR_github_run_id: ${{ github.run_id }} TF_VAR_ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} TF_VAR_ssh_public_key: ${{ secrets.SSH_PUBLIC_KEY }} TF_VAR_os_auth_region: ${{ secrets.OS_AUTH_REGION }} @@ -32,10 +37,7 @@ env: tf_working_directory: "${{ github.workspace }}/.github/workflows/openstack/cloudlinux-7" jobs: - testsuite: - uses: ./.github/workflows/testsuite.yml terraform_openstack_create: - needs: [testsuite] runs-on: self-hosted defaults: run: @@ -56,6 +58,7 @@ jobs: - name: Terraform Plan id: plan run: | + env terraform plan -no-color - name: Terraform Apply @@ -68,7 +71,7 @@ jobs: - name: Upload Terraform State File as Artifact uses: actions/upload-artifact@v4.4.3 with: - name: ${{ github.run_id }}-terraform.tfstate + name: ${{ github.run_id }}-cloudlinux7-terraform.tfstate path: "${{ github.workspace }}/.github/workflows/openstack/cloudlinux-7" - name: Terraform Output File Create @@ -83,7 +86,7 @@ jobs: - name: Upload VM Output uses: actions/upload-artifact@v4.4.3 with: - name: ${{ github.run_id }}-vm_ip + name: ${{ github.run_id }}-cloudlinux7-vm_ip path: ${{ github.workspace }}/${{ github.run_id }}-vm_ip overwrite: true @@ -96,7 +99,7 @@ jobs: - name: Download VM IP uses: actions/download-artifact@v4.1.8 with: - name: ${{ github.run_id }}-vm_ip + name: ${{ github.run_id }}-cloudlinux7-vm_ip path: ${{ github.workspace }}/ - name: Get VM IP from Artifact @@ -149,7 +152,7 @@ jobs: - name: Download VM IP uses: actions/download-artifact@v4.1.8 with: - name: ${{ github.run_id }}-vm_ip + name: ${{ github.run_id }}-cloudlinux7-vm_ip path: ${{ github.workspace }}/ - name: Get VM IP from Artifact @@ -184,7 +187,7 @@ jobs: - name: Download VM IP uses: actions/download-artifact@v4.1.8 with: - name: ${{ github.run_id }}-vm_ip + name: ${{ github.run_id }}-cloudlinux7-vm_ip path: ${{ github.workspace }}/ - name: Get VM IP from Artifact @@ -251,7 +254,7 @@ jobs: - name: Download VM IP uses: actions/download-artifact@v4.1.8 with: - name: ${{ github.run_id }}-vm_ip + name: ${{ github.run_id }}-cloudlinux7-vm_ip path: ${{ github.workspace }}/ - name: Get VM IP from Artifact @@ -278,7 +281,7 @@ jobs: - name: Download VM IP uses: actions/download-artifact@v4.1.8 with: - name: ${{ github.run_id }}-vm_ip + name: ${{ github.run_id }}-cloudlinux7-vm_ip path: ${{ github.workspace }}/ - name: Get VM IP from Artifact @@ -316,7 +319,7 @@ jobs: - name: Download VM IP uses: actions/download-artifact@v4.1.8 with: - name: ${{ github.run_id }}-vm_ip + name: ${{ github.run_id }}-cloudlinux7-vm_ip path: ${{ github.workspace }}/ - name: Get VM IP from Artifact @@ -343,7 +346,7 @@ jobs: - name: Download VM IP uses: actions/download-artifact@v4.1.8 with: - name: ${{ github.run_id }}-vm_ip + name: ${{ github.run_id }}-cloudlinux7-vm_ip path: ${{ github.workspace }}/ - name: Get VM IP from Artifact @@ -381,7 +384,7 @@ jobs: - name: Download VM IP uses: actions/download-artifact@v4.1.8 with: - name: ${{ github.run_id }}-vm_ip + name: ${{ github.run_id }}-cloudlinux7-vm_ip path: ${{ github.workspace }}/ - name: Get VM IP from Artifact @@ -408,7 +411,7 @@ jobs: - name: Download VM IP uses: actions/download-artifact@v4.1.8 with: - name: ${{ github.run_id }}-vm_ip + name: ${{ github.run_id }}-cloudlinux7-vm_ip path: ${{ github.workspace }}/ - name: Get VM IP from Artifact @@ -445,7 +448,7 @@ jobs: - name: Download VM IP uses: actions/download-artifact@v4.1.8 with: - name: ${{ github.run_id }}-vm_ip + name: ${{ github.run_id }}-cloudlinux7-vm_ip path: ${{ github.workspace }}/ - name: Get VM IP from Artifact @@ -472,7 +475,7 @@ jobs: - name: Download VM IP uses: actions/download-artifact@v4.1.8 with: - name: ${{ github.run_id }}-vm_ip + name: ${{ github.run_id }}-cloudlinux7-vm_ip path: ${{ github.workspace }}/ - name: Get VM IP from Artifact @@ -509,7 +512,7 @@ jobs: - name: Download VM IP uses: actions/download-artifact@v4.1.8 with: - name: ${{ github.run_id }}-vm_ip + name: ${{ github.run_id }}-cloudlinux7-vm_ip path: ${{ github.workspace }}/ - name: Get VM IP from Artifact @@ -536,7 +539,7 @@ jobs: - name: Download VM IP uses: actions/download-artifact@v4.1.8 with: - name: ${{ github.run_id }}-vm_ip + name: ${{ github.run_id }}-cloudlinux7-vm_ip path: ${{ github.workspace }}/ - name: Get VM IP from Artifact @@ -573,7 +576,7 @@ jobs: - name: Download VM IP uses: actions/download-artifact@v4.1.8 with: - name: ${{ github.run_id }}-vm_ip + name: ${{ github.run_id }}-cloudlinux7-vm_ip path: ${{ github.workspace }}/ - name: Get VM IP from Artifact @@ -600,7 +603,7 @@ jobs: - name: Download VM IP uses: actions/download-artifact@v4.1.8 with: - name: ${{ github.run_id }}-vm_ip + name: ${{ github.run_id }}-cloudlinux7-vm_ip path: ${{ github.workspace }}/ - name: Get VM IP from Artifact @@ -637,7 +640,7 @@ jobs: - name: Download Terraform State uses: actions/download-artifact@v4.1.8 with: - name: ${{ github.run_id }}-terraform.tfstate + name: ${{ github.run_id }}-cloudlinux7-terraform.tfstate path: "${{ github.workspace }}/.github/workflows/openstack/cloudlinux-7/terraform" - name: Stage Files & Show Artifact Paths diff --git a/.github/workflows/openstack-ubuntu-20.yml b/.github/workflows/openstack-ubuntu-20.yml deleted file mode 100644 index 72e67aa1..00000000 --- a/.github/workflows/openstack-ubuntu-20.yml +++ /dev/null @@ -1,633 +0,0 @@ -name: "Test Run: ubuntu-20.04" - -on: - push: - branches: - - "main" - - '!docs' - tags-ignore: - - "*" - pull_request: - workflow_dispatch: - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }}-openstack-ubuntu-20.04 - cancel-in-progress: true - -env: - TF_VAR_application_credential_id: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }} - TF_VAR_application_credential_secret: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }} - TF_VAR_github_repository: ${{ github.repository }} - TF_VAR_github_run_id: ${{ github.run_id }} - TF_VAR_ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} - TF_VAR_ssh_public_key: ${{ secrets.SSH_PUBLIC_KEY }} - TF_VAR_os_auth_region: ${{ secrets.OS_AUTH_REGION }} - TF_VAR_os_auth_url: ${{ secrets.OS_AUTH_URL }} - TF_VAR_os_interface: ${{ secrets.OS_INTERFACE }} - TF_VAR_os_project_domain_name: ${{ secrets.OS_PROJECT_DOMAIN_NAME }} - TF_VAR_os_password: ${{ secrets.OS_PASSWORD }} - TF_VAR_os_project_id: ${{ secrets.OS_PROJECT_ID }} - TF_VAR_os_project_domain_id: ${{ secrets.OS_PROJECT_DOMAIN_ID }} - TF_VAR_os_project_name: ${{ secrets.OS_PROJECT_NAME }} - TF_VAR_os_region_name: ${{ secrets.OS_REGION_NAME }} - TF_VAR_os_username: ${{ secrets.OS_USERNAME }} - tf_working_directory: "${{ github.workspace }}/.github/workflows/openstack/ubuntu-20.04" - -jobs: - testsuite: - uses: ./.github/workflows/testsuite.yml - terraform_openstack_create: - needs: [testsuite] - runs-on: self-hosted - defaults: - run: - working-directory: "${{ github.workspace }}/.github/workflows/openstack/ubuntu-20.04" - steps: - - uses: actions/checkout@v4 - - name: Terraform fmt - id: fmt - run: | - terraform fmt -check - continue-on-error: true - - - name: Terraform Init - id: init - run: | - terraform init - - - name: Terraform Plan - id: plan - run: | - terraform plan -no-color - - - name: Terraform Apply - id: apply - run: | - pwd - terraform apply -no-color -auto-approve - mv -v .terraform.lock.hcl terraform.lock.hcl - - - name: Upload Terraform State File as Artifact - uses: actions/upload-artifact@v4.4.3 - with: - name: ${{ github.run_id }}-terraform.tfstate - path: "${{ github.workspace }}/.github/workflows/openstack/ubuntu-20.04" - - - name: Terraform Output File Create - run: | - terraform output -json > ${{ github.run_id }}-tf.out.json - - - name: Make vm_ip file from Terraform Output File - id: get_vm_ip - run: | - echo "$(jq -r '.address.value' ${{ github.run_id }}-tf.out.json)" > ${{ github.workspace }}/${{ github.run_id }}-vm_ip - - - name: Upload VM Output - uses: actions/upload-artifact@v4.4.3 - with: - name: ${{ github.run_id }}-vm_ip - path: ${{ github.workspace }}/${{ github.run_id }}-vm_ip - overwrite: true - - clone_elevate_repo: - runs-on: self-hosted - needs: terraform_openstack_create - outputs: - VM_IP: ${{ steps.VM_IP.outputs.VM_IP }} - steps: - - name: Download VM IP - uses: actions/download-artifact@v4.1.8 - with: - name: ${{ github.run_id }}-vm_ip - path: ${{ github.workspace }}/ - - - name: Get VM IP from Artifact - id: VM_IP - run: | - echo "VM_IP=$(cat ${{ github.run_id }}-vm_ip)" >> "$GITHUB_OUTPUT" - cat ${{ github.run_id }}-vm_ip > VM_IP - - - name: Checkout Repo and Commit - if: github.event_name != 'pull_request' - uses: appleboy/ssh-action@v1.1.0 - with: - host: ${{ steps.VM_IP.outputs.VM_IP }} - username: 'root' - key: ${{ secrets.SSH_PRIVATE_KEY }} - port: '22' - script: | - cd /opt - echo "## [INFO]: ${{ github.ref }}" - echo "## [INFO]: ${{ github.ref_name }}" - echo "## [INFO}: ${{ github.repository }}" - git clone --depth 1 --branch ${{ github.ref_name }} https://github.com/${{ github.repository }}.git - hostname && pwd && ls -la - cd /opt/$(echo ${{ github.repository }} | cut -d / -f2) - git status - - - name: Checking out Repo and Pull Request - if: github.event_name == 'pull_request' - uses: appleboy/ssh-action@v1.1.0 - with: - host: ${{ steps.VM_IP.outputs.VM_IP }} - username: 'root' - key: ${{ secrets.SSH_PRIVATE_KEY }} - port: '22' - script: | - cd /opt - echo "[DEBUG]: ${{ github.ref }}" - echo "[DEBUG]: ${{ github.head_ref }}" - echo "## [INFO}: ${{ github.repository }}" - git clone --depth 1 --branch ${{ github.head_ref }} https://github.com/${{ github.repository }}.git - cd /opt/$(echo ${{ github.repository }} | cut -d / -f2) - git status - - setup_integration_checks: - runs-on: self-hosted - needs: clone_elevate_repo - outputs: - VM_IP: ${{ steps.VM_IP.outputs.VM_IP }} - steps: - - name: Download VM IP - uses: actions/download-artifact@v4.1.8 - with: - name: ${{ github.run_id }}-vm_ip - path: ${{ github.workspace }}/ - - - name: Get VM IP from Artifact - id: VM_IP - run: | - echo "VM_IP=$(cat ${{ github.run_id }}-vm_ip)" >> "$GITHUB_OUTPUT" - cat ${{ github.run_id }}-vm_ip > VM_IP - - - name: Export VM_IP to env - env: - VM_IP: ${{ steps.VM_IP.outputs.VM_IP }} - run: echo "VM_IP is ${{ steps.VM_IP.outputs.VM_IP }}" - - - name: Setup for Integration Checks Prior to Running Elevate - uses: appleboy/ssh-action@v1.1.0 - with: - host: ${{ steps.VM_IP.outputs.VM_IP }} - username: 'root' - key: ${{ secrets.SSH_PRIVATE_KEY }} - port: '22' - script: | - REPODIR=$(echo ${{ github.repository }} | cut -d / -f2) - chmod -v +x /opt/${REPODIR}/t/integration/setup - /opt/${REPODIR}/t/integration/setup - - start_elevate: - runs-on: self-hosted - needs: setup_integration_checks - outputs: - VM_IP: ${{ steps.VM_IP.outputs.VM_IP }} - steps: - - name: Download VM IP - uses: actions/download-artifact@v4.1.8 - with: - name: ${{ github.run_id }}-vm_ip - path: ${{ github.workspace }}/ - - - name: Get VM IP from Artifact - id: VM_IP - run: | - echo "VM_IP=$(cat ${{ github.run_id }}-vm_ip)" >> "$GITHUB_OUTPUT" - cat ${{ github.run_id }}-vm_ip > VM_IP - - - name: Export VM_IP to env - env: - VM_IP: ${{ steps.VM_IP.outputs.VM_IP }} - run: echo "VM_IP is ${{ steps.VM_IP.outputs.VM_IP }}" - - - name: Starting Elevate - uses: appleboy/ssh-action@v1.1.0 - with: - host: ${{ steps.VM_IP.outputs.VM_IP }} - username: 'root' - key: ${{ secrets.SSH_PRIVATE_KEY }} - port: '22' - timeout: 30m - command_timeout: 30m - script: | - REPODIR=$(echo ${{ github.repository }} | cut -d / -f2) - cp -pv /opt/${REPODIR}/elevate-cpanel /scripts/elevate-cpanel - cp -pv /opt/${REPODIR}/.github/workflows/openstack/status_marker /scripts/status_marker - cp -pv /opt/${REPODIR}/.github/workflows/openstack/reboot_watch /scripts/reboot_watch - chmod -v +x /scripts/elevate-cpanel - apt-get update - until /usr/local/cpanel/cpkeyclt; do echo "Retrying /usr/local/cpanel/cpkeyct until it passes..."; sleep 5; done - /scripts/elevate-cpanel --non-interactive --skip-cpanel-version-check --start & - exit 0 - - wait_for_stage_1_reboot: - runs-on: self-hosted - needs: start_elevate - outputs: - VM_IP: ${{ steps.VM_IP.outputs.VM_IP }} - steps: - - name: Download VM IP - uses: actions/download-artifact@v4.1.8 - with: - name: ${{ github.run_id }}-vm_ip - path: ${{ github.workspace }}/ - - - name: Get VM IP from Artifact - id: VM_IP - run: | - echo "VM_IP=$(cat ${{ github.run_id }}-vm_ip)" >> "$GITHUB_OUTPUT" - cat ${{ github.run_id }}-vm_ip > VM_IP - - - name: Export VM_IP to env - env: - VM_IP: ${{ steps.VM_IP.outputs.VM_IP }} - run: echo "VM_IP is ${{ steps.VM_IP.outputs.VM_IP }}" - - name: Wait For VM to Come Back From Initial Reboot - working-directory: "./.github/workflows/openstack/" - run: | - ./ssh_retry ${{ steps.VM_IP.outputs.VM_IP }} - - watch_for_stage_2_reboot: - runs-on: self-hosted - needs: wait_for_stage_1_reboot - outputs: - VM_IP: ${{ steps.VM_IP.outputs.VM_IP }} - steps: - - name: Download VM IP - uses: actions/download-artifact@v4.1.8 - with: - name: ${{ github.run_id }}-vm_ip - path: ${{ github.workspace }}/ - - - name: Get VM IP from Artifact - id: VM_IP - run: | - echo "VM_IP=$(cat ${{ github.run_id }}-vm_ip)" >> "$GITHUB_OUTPUT" - cat ${{ github.run_id }}-vm_ip > VM_IP - - - name: Export VM_IP to env - env: - VM_IP: ${{ steps.VM_IP.outputs.VM_IP }} - run: echo "VM_IP is ${{ steps.VM_IP.outputs.VM_IP }}" - - name: Monitor Elevate for Reboot from Stage 1 into Stage 2 - uses: appleboy/ssh-action@v1.1.0 - with: - host: ${{ steps.VM_IP.outputs.VM_IP }} - username: 'root' - key: ${{ secrets.SSH_PRIVATE_KEY }} - port: '22' - timeout: 60m - command_timeout: 30m - debug: true - script: | - /scripts/status_marker 1 - tail -n40 -F /var/log/elevate-cpanel.log & - sleep .5 - REBOOT_STRING="Rebooting into stage 2 of 5" RETVAL=1 /scripts/reboot_watch - - wait_for_stage_2_reboot: - runs-on: self-hosted - needs: watch_for_stage_2_reboot - outputs: - VM_IP: ${{ steps.VM_IP.outputs.VM_IP }} - steps: - - name: Download VM IP - uses: actions/download-artifact@v4.1.8 - with: - name: ${{ github.run_id }}-vm_ip - path: ${{ github.workspace }}/ - - - name: Get VM IP from Artifact - id: VM_IP - run: | - echo "VM_IP=$(cat ${{ github.run_id }}-vm_ip)" >> "$GITHUB_OUTPUT" - cat ${{ github.run_id }}-vm_ip > VM_IP - - - name: Export VM_IP to env - env: - VM_IP: ${{ steps.VM_IP.outputs.VM_IP }} - run: echo "VM_IP is ${{ steps.VM_IP.outputs.VM_IP }}" - - name: Wait For VM to Come Back From Stage 2 Reboot - working-directory: "./.github/workflows/openstack/" - run: | - ./ssh_retry ${{ steps.VM_IP.outputs.VM_IP }} - - watch_for_stage_3_reboot: - runs-on: self-hosted - needs: wait_for_stage_2_reboot - outputs: - VM_IP: ${{ steps.VM_IP.outputs.VM_IP }} - steps: - - name: Download VM IP - uses: actions/download-artifact@v4.1.8 - with: - name: ${{ github.run_id }}-vm_ip - path: ${{ github.workspace }}/ - - - name: Get VM IP from Artifact - id: VM_IP - run: | - echo "VM_IP=$(cat ${{ github.run_id }}-vm_ip)" >> "$GITHUB_OUTPUT" - cat ${{ github.run_id }}-vm_ip > VM_IP - - - name: Export VM_IP to env - env: - VM_IP: ${{ steps.VM_IP.outputs.VM_IP }} - run: echo "VM_IP is ${{ steps.VM_IP.outputs.VM_IP }}" - - name: Monitor Elevate for Stage 3 Reboot - uses: appleboy/ssh-action@v1.1.0 - with: - host: ${{ steps.VM_IP.outputs.VM_IP }} - username: 'root' - key: ${{ secrets.SSH_PRIVATE_KEY }} - port: '22' - timeout: 60m - command_timeout: 30m - debug: true - script: | - /scripts/status_marker 2 - tail -n40 -F /var/log/elevate-cpanel.log & - sleep .5 - REBOOT_STRING="Rebooting into stage 3 of 5" RETVAL=1 /scripts/reboot_watch - - wait_for_stage_3_reboot: - runs-on: self-hosted - needs: watch_for_stage_3_reboot - outputs: - VM_IP: ${{ steps.VM_IP.outputs.VM_IP }} - steps: - - name: Download VM IP - uses: actions/download-artifact@v4.1.8 - with: - name: ${{ github.run_id }}-vm_ip - path: ${{ github.workspace }}/ - - - name: Get VM IP from Artifact - id: VM_IP - run: | - echo "VM_IP=$(cat ${{ github.run_id }}-vm_ip)" >> "$GITHUB_OUTPUT" - cat ${{ github.run_id }}-vm_ip > VM_IP - - - name: Export VM_IP to env - env: - VM_IP: ${{ steps.VM_IP.outputs.VM_IP }} - run: echo "VM_IP is ${{ steps.VM_IP.outputs.VM_IP }}" - - name: Wait For VM to Come Back From Stage 3 Reboot - working-directory: "./.github/workflows/openstack/" - run: | - ./ssh_retry ${{ steps.VM_IP.outputs.VM_IP }} - - watch_for_stage_4_reboot: - runs-on: self-hosted - needs: wait_for_stage_3_reboot - outputs: - VM_IP: ${{ steps.VM_IP.outputs.VM_IP }} - steps: - - name: Download VM IP - uses: actions/download-artifact@v4.1.8 - with: - name: ${{ github.run_id }}-vm_ip - path: ${{ github.workspace }}/ - - - name: Get VM IP from Artifact - id: VM_IP - run: | - echo "VM_IP=$(cat ${{ github.run_id }}-vm_ip)" >> "$GITHUB_OUTPUT" - cat ${{ github.run_id }}-vm_ip > VM_IP - - - name: Export VM_IP to env - env: - VM_IP: ${{ steps.VM_IP.outputs.VM_IP }} - run: echo "VM_IP is ${{ steps.VM_IP.outputs.VM_IP }}" - - name: Monitor Elevate for Stage 4 Reboot - uses: appleboy/ssh-action@v1.1.0 - with: - host: ${{ steps.VM_IP.outputs.VM_IP }} - username: 'root' - key: ${{ secrets.SSH_PRIVATE_KEY }} - port: '22' - timeout: 30m - command_timeout: 30m - script: | - /scripts/status_marker 3 - tail -n40 -F /var/log/elevate-cpanel.log & - sleep .5 - REBOOT_STRING="Rebooting into stage 4 of 5" RETVAL=1 /scripts/reboot_watch - - wait_for_stage_4_reboot: - runs-on: self-hosted - needs: watch_for_stage_4_reboot - outputs: - VM_IP: ${{ steps.VM_IP.outputs.VM_IP }} - steps: - - name: Download VM IP - uses: actions/download-artifact@v4.1.8 - with: - name: ${{ github.run_id }}-vm_ip - path: ${{ github.workspace }}/ - - - name: Get VM IP from Artifact - id: VM_IP - run: | - echo "VM_IP=$(cat ${{ github.run_id }}-vm_ip)" >> "$GITHUB_OUTPUT" - cat ${{ github.run_id }}-vm_ip > VM_IP - - - name: Export VM_IP to env - env: - VM_IP: ${{ steps.VM_IP.outputs.VM_IP }} - run: echo "VM_IP is ${{ steps.VM_IP.outputs.VM_IP }}" - - name: Wait For VM to Come Back From Stage 4 Reboot - working-directory: "./.github/workflows/openstack/" - run: | - ./ssh_retry ${{ steps.VM_IP.outputs.VM_IP }} - - watch_for_stage_5_reboot: - runs-on: self-hosted - needs: wait_for_stage_4_reboot - outputs: - VM_IP: ${{ steps.VM_IP.outputs.VM_IP }} - steps: - - name: Download VM IP - uses: actions/download-artifact@v4.1.8 - with: - name: ${{ github.run_id }}-vm_ip - path: ${{ github.workspace }}/ - - - name: Get VM IP from Artifact - id: VM_IP - run: | - echo "VM_IP=$(cat ${{ github.run_id }}-vm_ip)" >> "$GITHUB_OUTPUT" - cat ${{ github.run_id }}-vm_ip > VM_IP - - - name: Export VM_IP to env - env: - VM_IP: ${{ steps.VM_IP.outputs.VM_IP }} - run: echo "VM_IP is ${{ steps.VM_IP.outputs.VM_IP }}" - - name: Monitor Elevate for Stage 5 Reboot - uses: appleboy/ssh-action@v1.1.0 - with: - host: ${{ steps.VM_IP.outputs.VM_IP }} - username: 'root' - key: ${{ secrets.SSH_PRIVATE_KEY }} - port: '22' - timeout: 45m - command_timeout: 35m - script: | - /scripts/status_marker 4 - tail -n40 -F /var/log/elevate-cpanel.log & - sleep .5 - REBOOT_STRING="Rebooting into stage 5 of 5" RETVAL=1 /scripts/reboot_watch - - wait_for_stage_5_reboot: - runs-on: self-hosted - needs: watch_for_stage_5_reboot - outputs: - VM_IP: ${{ steps.VM_IP.outputs.VM_IP }} - steps: - - name: Download VM IP - uses: actions/download-artifact@v4.1.8 - with: - name: ${{ github.run_id }}-vm_ip - path: ${{ github.workspace }}/ - - - name: Get VM IP from Artifact - id: VM_IP - run: | - echo "VM_IP=$(cat ${{ github.run_id }}-vm_ip)" >> "$GITHUB_OUTPUT" - cat ${{ github.run_id }}-vm_ip > VM_IP - - - name: Export VM_IP to env - env: - VM_IP: ${{ steps.VM_IP.outputs.VM_IP }} - run: echo "VM_IP is ${{ steps.VM_IP.outputs.VM_IP }}" - - name: Wait For VM to Come Back From Stage 5 Reboot - working-directory: "./.github/workflows/openstack/" - run: | - ./ssh_retry ${{ steps.VM_IP.outputs.VM_IP }} - - watch_for_final_reboot: - runs-on: self-hosted - needs: wait_for_stage_5_reboot - outputs: - VM_IP: ${{ steps.VM_IP.outputs.VM_IP }} - steps: - - name: Download VM IP - uses: actions/download-artifact@v4.1.8 - with: - name: ${{ github.run_id }}-vm_ip - path: ${{ github.workspace }}/ - - - name: Get VM IP from Artifact - id: VM_IP - run: | - echo "VM_IP=$(cat ${{ github.run_id }}-vm_ip)" >> "$GITHUB_OUTPUT" - cat ${{ github.run_id }}-vm_ip > VM_IP - - - name: Export VM_IP to env - env: - VM_IP: ${{ steps.VM_IP.outputs.VM_IP }} - run: echo "VM_IP is ${{ steps.VM_IP.outputs.VM_IP }}" - - name: Monitor Elevate for Final Reboot - uses: appleboy/ssh-action@v1.1.0 - with: - host: ${{ steps.VM_IP.outputs.VM_IP }} - username: 'root' - key: ${{ secrets.SSH_PRIVATE_KEY }} - port: '22' - timeout: 45m - command_timeout: 35m - script: | - /scripts/status_marker 5 - tail -n40 -F /var/log/elevate-cpanel.log & - sleep 2.5 - SKIP_PID_CHECK=1 REBOOT_STRING="Doing final reboot" RETVAL=1 /scripts/reboot_watch - - wait_for_final_reboot: - runs-on: self-hosted - needs: watch_for_final_reboot - outputs: - VM_IP: ${{ steps.VM_IP.outputs.VM_IP }} - steps: - - name: Download VM IP - uses: actions/download-artifact@v4.1.8 - with: - name: ${{ github.run_id }}-vm_ip - path: ${{ github.workspace }}/ - - - name: Get VM IP from Artifact - id: VM_IP - run: | - echo "VM_IP=$(cat ${{ github.run_id }}-vm_ip)" >> "$GITHUB_OUTPUT" - cat ${{ github.run_id }}-vm_ip > VM_IP - - - name: Export VM_IP to env - env: - VM_IP: ${{ steps.VM_IP.outputs.VM_IP }} - run: echo "VM_IP is ${{ steps.VM_IP.outputs.VM_IP }}" - - name: Wait For VM to Come Back From Final Reboot - working-directory: "./.github/workflows/openstack/" - run: | - ./ssh_retry ${{ steps.VM_IP.outputs.VM_IP }} - - verify_upgraded_os: - runs-on: self-hosted - needs: wait_for_final_reboot - outputs: - VM_IP: ${{ steps.VM_IP.outputs.VM_IP }} - steps: - - name: Download VM IP - uses: actions/download-artifact@v4.1.8 - with: - name: ${{ github.run_id }}-vm_ip - path: ${{ github.workspace }}/ - - - name: Get VM IP from Artifact - id: VM_IP - run: | - echo "VM_IP=$(cat ${{ github.run_id }}-vm_ip)" >> "$GITHUB_OUTPUT" - cat ${{ github.run_id }}-vm_ip > VM_IP - - - name: Export VM_IP to env - env: - VM_IP: ${{ steps.VM_IP.outputs.VM_IP }} - run: echo "VM_IP is ${{ steps.VM_IP.outputs.VM_IP }}" - - name: Verify End Result Integration Tests - uses: appleboy/ssh-action@v1.1.0 - with: - host: ${{ steps.VM_IP.outputs.VM_IP }} - username: 'root' - key: ${{ secrets.SSH_PRIVATE_KEY }} - port: '22' - timeout: 5m - command_timeout: 1m - script: | - REPODIR=$(echo ${{ github.repository }} | cut -d / -f2) - /usr/local/cpanel/3rdparty/bin/prove -lvm /opt/${REPODIR}/t/integration/ubuntu7-to-almalinux8/*.t - /usr/local/cpanel/3rdparty/bin/prove -lvm /opt/${REPODIR}/t/integration/*.t - - terraform_openstack_destroy: - runs-on: self-hosted - needs: verify_upgraded_os - defaults: - run: - working-directory: "${{ github.workspace }}/.github/workflows/openstack/ubuntu-20.04" - steps: - - name: Download Terraform State - uses: actions/download-artifact@v4.1.8 - with: - name: ${{ github.run_id }}-terraform.tfstate - path: "${{ github.workspace }}/.github/workflows/openstack/ubuntu-20.04/terraform" - - - - name: Stage Files & Show Artifact Paths - run: | - cd ${{ github.workspace }}/.github/workflows/openstack/ubuntu-20.04/terraform/ - mv -v terraform.lock.hcl .terraform.lock.hcl - find ${{ github.workspace }}/.github/workflows/openstack/ubuntu-20.04/ - - - name: Initialize Terraform & Destroy - run: | - cd ${{ github.workspace }}/.github/workflows/openstack/ubuntu-20.04/terraform/ - rm -Rfv .terraform || true - terraform init - terraform destroy -no-color -auto-approve diff --git a/.github/workflows/openstack/centos-7/main.tf b/.github/workflows/openstack/centos-7/main.tf index 22f1cedd..8cd0c920 100644 --- a/.github/workflows/openstack/centos-7/main.tf +++ b/.github/workflows/openstack/centos-7/main.tf @@ -49,7 +49,7 @@ resource "openstack_compute_keypair_v2" "tf_remote_key" { } resource "openstack_compute_instance_v2" "elevatevm" { - name = "elevate.github.cpanel.net" + name = "${var.github_run_id}.${var.github_repository}.github.cpanel.net" image_id = data.openstack_images_image_ids_v2.images.ids[0] flavor_name = var.flavor_name key_pair = openstack_compute_keypair_v2.tf_remote_key.name diff --git a/.github/workflows/openstack/centos-7/variables.tf b/.github/workflows/openstack/centos-7/variables.tf index 7806ea96..4e22473e 100644 --- a/.github/workflows/openstack/centos-7/variables.tf +++ b/.github/workflows/openstack/centos-7/variables.tf @@ -11,6 +11,14 @@ variable "application_credential_secret" { type = string } +variable "github_repository" { + type = string +} + +variable "github_run_id" { + type = string +} + variable "os_password" { type = string } diff --git a/.github/workflows/openstack/cloudlinux-7/main.tf b/.github/workflows/openstack/cloudlinux-7/main.tf index 22f1cedd..8cd0c920 100644 --- a/.github/workflows/openstack/cloudlinux-7/main.tf +++ b/.github/workflows/openstack/cloudlinux-7/main.tf @@ -49,7 +49,7 @@ resource "openstack_compute_keypair_v2" "tf_remote_key" { } resource "openstack_compute_instance_v2" "elevatevm" { - name = "elevate.github.cpanel.net" + name = "${var.github_run_id}.${var.github_repository}.github.cpanel.net" image_id = data.openstack_images_image_ids_v2.images.ids[0] flavor_name = var.flavor_name key_pair = openstack_compute_keypair_v2.tf_remote_key.name diff --git a/.github/workflows/openstack/cloudlinux-7/variables.tf b/.github/workflows/openstack/cloudlinux-7/variables.tf index c9df47af..03c577fe 100644 --- a/.github/workflows/openstack/cloudlinux-7/variables.tf +++ b/.github/workflows/openstack/cloudlinux-7/variables.tf @@ -11,6 +11,14 @@ variable "application_credential_secret" { type = string } +variable "github_repository" { + type = string +} + +variable "github_run_id" { + type = string +} + variable "os_password" { type = string } diff --git a/.github/workflows/openstack/prune_openstack b/.github/workflows/openstack/prune_openstack index 11c08bfe..1872570d 100755 --- a/.github/workflows/openstack/prune_openstack +++ b/.github/workflows/openstack/prune_openstack @@ -8,7 +8,7 @@ use warnings; # Static constants use constant { KEY_NAME => "deletethis", - VM_NAME => "$ENV{'TF_VAR_github_repository'}.github.cpanel.net", + VM_NAME => "$ENV{TF_VAR_github_repository}.github.cpanel.net", }; my $openstack_path = "/usr/bin/openstack" if -x "/usr/bin/openstack"; diff --git a/.github/workflows/openstack/reboot_watch b/.github/workflows/openstack/reboot_watch index e0637852..6af34bad 100755 --- a/.github/workflows/openstack/reboot_watch +++ b/.github/workflows/openstack/reboot_watch @@ -34,7 +34,7 @@ sub _check_elevate_log_for_REBOOT_STRING { # Lines that match ERROR or FATAL are an indication that the script # has failed or is about to fail - if ( $line =~ /\[(?:ERROR|FATAL)\]|Please fix the detected issues before performing the elevation process/ ) { + if ( $line =~ /\[(?:ERROR|FATAL|Please fix the detected issues before performing the elevation process)\]|Please fix the detected issues before performing the elevation process/ ) { if ( _script_has_failed() ) { # If it failed due to temporary mirror issues, diff --git a/.github/workflows/openstack/ubuntu-20.04/cloud-config.yaml b/.github/workflows/openstack/ubuntu-20.04/cloud-config.yaml deleted file mode 100644 index 0445e91b..00000000 --- a/.github/workflows/openstack/ubuntu-20.04/cloud-config.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- - users: - - name: root - lock_passwd: false - disable_root: false \ No newline at end of file diff --git a/.github/workflows/openstack/ubuntu-20.04/cloud-init.yml b/.github/workflows/openstack/ubuntu-20.04/cloud-init.yml deleted file mode 100644 index 1602682e..00000000 --- a/.github/workflows/openstack/ubuntu-20.04/cloud-init.yml +++ /dev/null @@ -1,6 +0,0 @@ -#cloud-config -disable_root: false -ssh_pwauth: true -hostname: host -fqdn: host.domain.tbd -prefer_fqdn_over_hostname: true diff --git a/.github/workflows/openstack/ubuntu-20.04/main.tf b/.github/workflows/openstack/ubuntu-20.04/main.tf deleted file mode 100644 index 8cd0c920..00000000 --- a/.github/workflows/openstack/ubuntu-20.04/main.tf +++ /dev/null @@ -1,82 +0,0 @@ -# Define required providers -terraform { - required_version = ">= 0.14.0" - required_providers { - openstack = { - source = "terraform-provider-openstack/openstack" - version = "~> 1.54.1" - } - } -} - -# Configure the OpenStack Provider -provider "openstack" { - user_name = var.user - application_credential_id = var.application_credential_id - application_credential_secret = var.application_credential_secret - auth_url = "https://keystone.hou-01.cloud.prod.cpanel.net:5000/v3" - region = var.os_auth_region -} - -data "openstack_images_image_ids_v2" "images" { - name_regex = var.image_name - sort = "updated_at" -} - -data "template_cloudinit_config" "config" { - gzip = true - base64_encode = true - - part { - content_type = "text/cloud-config" - content = "cloud-config.yaml" - } -} - -resource "tls_private_key" "ssh" { - algorithm = "ECDSA" - ecdsa_curve = "P384" -} - -resource "random_string" "keyname" { - length = 22 - special = false -} - -resource "openstack_compute_keypair_v2" "tf_remote_key" { - name = "${random_string.keyname.result}-deletethis" - public_key = tls_private_key.ssh.public_key_openssh -} - -resource "openstack_compute_instance_v2" "elevatevm" { - name = "${var.github_run_id}.${var.github_repository}.github.cpanel.net" - image_id = data.openstack_images_image_ids_v2.images.ids[0] - flavor_name = var.flavor_name - key_pair = openstack_compute_keypair_v2.tf_remote_key.name - user_data = data.template_cloudinit_config.config.rendered - network { - name = "hou-prod-external" - } - - provisioner "remote-exec" { - inline = [<> /root/.ssh/id_ed25519 - echo "${var.ssh_public_key}" >> /root/.ssh/authorized_keys - echo 'waiting on cloud-init...' - cloud-init status --wait > /dev/null || true - EOF - ] - connection { - type = "ssh" - agent = "false" - host = self.access_ip_v4 - user = "root" - script_path = "/root/elevate_bootstrap" - private_key = tls_private_key.ssh.private_key_pem - } - } -} - diff --git a/.github/workflows/openstack/ubuntu-20.04/outputs.tf b/.github/workflows/openstack/ubuntu-20.04/outputs.tf deleted file mode 100644 index 396221f0..00000000 --- a/.github/workflows/openstack/ubuntu-20.04/outputs.tf +++ /dev/null @@ -1,7 +0,0 @@ -output "address" { - value = openstack_compute_instance_v2.elevatevm.access_ip_v4 -} - -output "id" { - value = openstack_compute_instance_v2.elevatevm.id -} \ No newline at end of file diff --git a/.github/workflows/openstack/ubuntu-20.04/variables.tf b/.github/workflows/openstack/ubuntu-20.04/variables.tf deleted file mode 100644 index a2d1959e..00000000 --- a/.github/workflows/openstack/ubuntu-20.04/variables.tf +++ /dev/null @@ -1,63 +0,0 @@ -variable "user" { - type = string - default = "resu" -} - -variable "application_credential_id" { - type = string -} - -variable "application_credential_secret" { - type = string -} - -variable "os_password" { - type = string -} - -variable "github_repository" { - type = string -} - -variable "github_run_id" { - type = string -} - -variable "os_auth_region" { - type = string -} - -variable "os_auth_url" { - type = string -} - -variable "os_project_domain_name" { - type = string -} - -variable "ssh_private_key" { - type = string - description = "SSH private key matching the public key added to the VMs /root/.ssh/authorized_keys file to allow user access." - sensitive = true -} - -variable "ssh_public_key" { - type = string - description = "SSH public key matching the public key added to the VMs /root/.ssh/authorized_keys file to allow user access." - sensitive = true -} - -variable "image_name" { - type = string - default = "11.118.0.* on Ubuntu 20.04" -} - -variable "cpanel_release_version" { - type = string - default = "110" -} - -variable "flavor_name" { - type = string - default = "c2.d20.r2048" -} diff --git a/.github/workflows/testsuite.yml b/.github/workflows/testsuite.yml index e50fe92c..2233b4ee 100644 --- a/.github/workflows/testsuite.yml +++ b/.github/workflows/testsuite.yml @@ -1,4 +1,4 @@ -name: testsuite +name: TestSuite on: push: @@ -9,12 +9,29 @@ on: - "*" pull_request: workflow_dispatch: - workflow_call: concurrency: group: ${{ github.workflow }}-${{ github.ref }}-testsuite cancel-in-progress: true +env: + TF_VAR_application_credential_id: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }} + TF_VAR_application_credential_secret: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }} + TF_VAR_github_repository: ${{ github.repository }} + TF_VAR_github_run_id: ${{ github.run_id }} + TF_VAR_ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }} + TF_VAR_ssh_public_key: ${{ secrets.SSH_PUBLIC_KEY }} + TF_VAR_os_auth_region: ${{ secrets.OS_AUTH_REGION }} + TF_VAR_os_auth_url: ${{ secrets.OS_AUTH_URL }} + TF_VAR_os_interface: ${{ secrets.OS_INTERFACE }} + TF_VAR_os_project_domain_name: ${{ secrets.OS_PROJECT_DOMAIN_NAME }} + TF_VAR_os_password: ${{ secrets.OS_PASSWORD }} + TF_VAR_os_project_id: ${{ secrets.OS_PROJECT_ID }} + TF_VAR_os_project_domain_id: ${{ secrets.OS_PROJECT_DOMAIN_ID }} + TF_VAR_os_project_name: ${{ secrets.OS_PROJECT_NAME }} + TF_VAR_os_region_name: ${{ secrets.OS_REGION_NAME }} + TF_VAR_os_username: ${{ secrets.OS_USERNAME }} + jobs: testsuite: env: @@ -61,3 +78,13 @@ jobs: - name: Run tests run: prove -lv -It/lib t/*.t + CentOS-7: + needs: testsuite + uses: ./.github/workflows/openstack-centos-7.yml + secrets: inherit + + CloudLinux-7: + needs: testsuite + uses: ./.github/workflows/openstack-cloudlinux-7.yml + secrets: inherit + diff --git a/t/integration/ubuntu20-to-ubuntu-22/complete.t b/t/integration/ubuntu20-to-ubuntu-22/complete.t deleted file mode 100644 index 27a500aa..00000000 --- a/t/integration/ubuntu20-to-ubuntu-22/complete.t +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/local/cpanel/3rdparty/bin/perl - -# Copyright 2024 WebPros International, LLC -# All rights reserved. -# copyright@cpanel.net http://cpanel.net -# This code is subject to the cPanel license. Unauthorized copying is prohibited. - -use lib '/usr/local/cpanel/'; - -use Cpanel::OS (); - -use Test::More; - -is( Cpanel::OS->distro(), 'ubuntu', 'System is Ubuntu after upgrade.' ); -is( Cpanel::OS->major(), '22', 'Verson 22 of OS.' ); - -done_testing();