Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reorganize workflows so that they are all dependent on the same tests…
Browse files Browse the repository at this point in the history
…uite passing

Case RE-1026: Testsuit.yml as parent to OpenStack workflows.

Changelog:
davelcpanelnet authored and Travis Holloway committed Dec 11, 2024

Verified

This commit was signed with the committer’s verified signature.
watson Thomas Watson
1 parent c23818c commit c9c15d7
Showing 15 changed files with 73 additions and 838 deletions.
22 changes: 12 additions & 10 deletions .github/workflows/openstack-centos-7.yml
Original file line number Diff line number Diff line change
@@ -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:
23 changes: 13 additions & 10 deletions .github/workflows/openstack-cloudlinux-7.yml
Original file line number Diff line number Diff line change
@@ -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
633 changes: 0 additions & 633 deletions .github/workflows/openstack-ubuntu-20.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/openstack/centos-7/main.tf
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions .github/workflows/openstack/centos-7/variables.tf
Original file line number Diff line number Diff line change
@@ -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
}
2 changes: 1 addition & 1 deletion .github/workflows/openstack/cloudlinux-7/main.tf
Original file line number Diff line number Diff line change
@@ -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
8 changes: 8 additions & 0 deletions .github/workflows/openstack/cloudlinux-7/variables.tf
Original file line number Diff line number Diff line change
@@ -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
}
2 changes: 1 addition & 1 deletion .github/workflows/openstack/prune_openstack
Original file line number Diff line number Diff line change
@@ -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";
5 changes: 0 additions & 5 deletions .github/workflows/openstack/ubuntu-20.04/cloud-config.yaml

This file was deleted.

6 changes: 0 additions & 6 deletions .github/workflows/openstack/ubuntu-20.04/cloud-init.yml

This file was deleted.

82 changes: 0 additions & 82 deletions .github/workflows/openstack/ubuntu-20.04/main.tf

This file was deleted.

7 changes: 0 additions & 7 deletions .github/workflows/openstack/ubuntu-20.04/outputs.tf

This file was deleted.

63 changes: 0 additions & 63 deletions .github/workflows/openstack/ubuntu-20.04/variables.tf

This file was deleted.

31 changes: 29 additions & 2 deletions .github/workflows/testsuite.yml
Original file line number Diff line number Diff line change
@@ -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

17 changes: 0 additions & 17 deletions t/integration/ubuntu20-to-ubuntu-22/complete.t

This file was deleted.

0 comments on commit c9c15d7

Please sign in to comment.