Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Community deploy #657

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/image-pull-and-tag.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Migrate Images to GHCR
name: Migrate Images to QUAY

on:
push:
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/testing-deploy-openstack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: testing-openstack-deploy

on:
workflow_run:
workflows:
- Migrate Images to QUAY
types:
- completed
workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-22.04

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Python environment
run: sudo apt-get update && sudo apt-get install -y python3-pip

- name: Install requirements
run: pip3 install -r testing/requirements.txt

- name: Create OpenStack config directory
run: mkdir -p ~/.config/openstack

- name: Retrieve clouds.yaml from GitHub secrets
env:
CLOUDS_YAML: ${{ secrets.CLOUDS_YAML }}
run: |
echo "$CLOUDS_YAML" > ~/.config/openstack/clouds.yaml

- name: Retrieve env.yaml from GitHub secrets
env:
ENV_YAML: ${{ secrets.ENV_YAML }}
run: |
echo "$ENV_YAML" > ~/env.yaml

- name: Run deployment script
run: bash testing/doit.sh

- name: Cleanup
if: always()
run: bash testing/cleanup.sh
98 changes: 98 additions & 0 deletions testing/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
heat_template_version: wallaby

description: Build genestack for testing

parameters:
in_net:
type: string
description: Internal network name

ext_net:
type: string
description: External network for floating IP

image_name:
type: string
description: Image name for the VMs

key_pair:
type: string
description: Key pair name for the VMs
default: "genestack-keypair"

flavor_name:
type: string
description: Flavor name for the VMs

security_group:
type: string
description: Security group for the VMs

name1:
type: string
description: Name of first machine
default: "controller1"

name2:
type: string
description: Name of second machine
default: "controller2"

name3:
type: string
description: Name of third machine
default: "controller3"

resources:
genestack_keypair:
type: OS::Nova::KeyPair
properties:
name: "genestack-keypair"
public_key: { get_file: ./key.pub }

genestack_machine1:
type: OS::Heat::Stack
properties:
template: { get_file: single.yaml }
parameters:
internal: {get_param: in_net }
external: {get_param: ext_net }
image: {get_param: image_name }
flavor: {get_param: flavor_name }
keys: { get_resource: genestack_keypair }
sec_group: {get_param: security_group }
name: {get_param: name1 }

genestack_machine2:
type: OS::Heat::Stack
properties:
template: { get_file: single.yaml }
parameters:
internal: {get_param: in_net }
external: {get_param: ext_net }
image: {get_param: image_name }
flavor: {get_param: flavor_name }
keys: { get_resource: genestack_keypair }
sec_group: {get_param: security_group }
name: {get_param: name2 }

genestack_machine3:
type: OS::Heat::Stack
properties:
template: { get_file: single.yaml }
parameters:
internal: {get_param: in_net }
external: {get_param: ext_net }
image: {get_param: image_name }
flavor: {get_param: flavor_name }
keys: { get_resource: genestack_keypair }
sec_group: {get_param: security_group }
name: {get_param: name3 }

outputs:
all_out:
description: ip addresses of the 3 machines
value:
- { get_attr: [genestack_machine1, outputs, vm_ip] }
- { get_attr: [genestack_machine2, outputs, vm_ip] }
- { get_attr: [genestack_machine3, outputs, vm_ip] }
5 changes: 5 additions & 0 deletions testing/cleanup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
cd testing
rm ./key*
rm ./inventory.yaml
yes y | openstack --os-cloud default stack delete testing
Loading
Loading