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

feat: Add terraform-deploy reusable workflow #59

Merged
merged 6 commits into from
Sep 12, 2024

Conversation

orfeas-k
Copy link
Contributor

@orfeas-k orfeas-k commented Sep 9, 2024

Add terraform-deploy.yaml reusable workflow that deploys the charm using
the terraform module and waits for environment steady state. This essentially
transforms https://github.com/canonical/sunbeam-terraform/blob/main/.github/workflows/deploy.yml
into a reusable workflow. As per juju-wait help command, the environment is
considered in a steady state once all hooks have completed running and there
are no hooks queued to run, on all units. This means that the check will succeed
if the charm units go to idle.

Add terraform-apply.yaml reusable workflow that applys the TF module and
using juju wait-for, waits for the application to go in active or `blocked.

@orfeas-k orfeas-k force-pushed the orfeas-k-add-terraform-reusable-workflow branch from 504ae0f to 1982e2b Compare September 9, 2024 14:33
Add terraform-deploy.yaml reusable workflow that deploys the charm using
the terraform module and waits for environment steady state. As per
juju-wait docs, the environment is considered in a steady state once
all hooks have completed running and there are no hooks queued to
run, on all units
@orfeas-k orfeas-k force-pushed the orfeas-k-add-terraform-reusable-workflow branch from 2529582 to ecc2675 Compare September 10, 2024 10:28
@orfeas-k orfeas-k marked this pull request as ready for review September 10, 2024 10:30
@orfeas-k orfeas-k requested a review from a team as a code owner September 10, 2024 10:30
@mvlassis
Copy link

mvlassis commented Sep 10, 2024

@orfeas-k It seems you are using the juju-wait executable to wait until the desired state has been achieved. On the plugin's main page it is stated as outdated, and instead it is suggested that we move to the juju wait-for subcommand. Perhaps that is something you can look into?

This way we can avoid having to install an additional snap package.

.github/workflows/terraform-deploy.yaml Outdated Show resolved Hide resolved
.github/workflows/terraform-deploy.yaml Outdated Show resolved Hide resolved
templates/terraform-deploy-usage-template.yaml Outdated Show resolved Hide resolved
@orfeas-k orfeas-k changed the base branch from main to orfeas-k-terraform-ci-dev-branch September 11, 2024 11:03
@orfeas-k orfeas-k changed the base branch from orfeas-k-terraform-ci-dev-branch to main September 11, 2024 11:08
@orfeas-k orfeas-k changed the title feat: Add reusable terraform-deploy workflow feat: Add terraform-deploy reusable workflow Sep 11, 2024
Copy link
Contributor

@DnPlas DnPlas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @orfeas-k , looking good already, just a comment on making sure this works in multi charm repos.

.github/workflows/terraform-apply.yaml Show resolved Hide resolved
@orfeas-k orfeas-k merged commit 935d299 into main Sep 12, 2024
@orfeas-k orfeas-k deleted the orfeas-k-add-terraform-reusable-workflow branch September 12, 2024 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants