Skip to content

Commit

Permalink
Support charmcraft 3 in openstack-exporter-operator (#109)
Browse files Browse the repository at this point in the history
Co-authored-by: Robert Gildein <[email protected]>
  • Loading branch information
samuelallan72 and rgildein authored Nov 1, 2024
1 parent ae46d05 commit 0d340e2
Show file tree
Hide file tree
Showing 17 changed files with 74 additions and 30 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/terraform-apply.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
- name: Install Terraform
run: sudo snap install terraform --classic

# To format the repository to pass this lint:
# $ cd terraform-plans && terraform fmt -recursive
- name: Terraform format lint
working-directory: ./terraform-plans
run: terraform fmt -check -recursive -diff
Expand Down
7 changes: 5 additions & 2 deletions terraform-plans/configs/charm-advanced-routing_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@ templates = {
promote = {
source = "./templates/github/charm_promote.yaml.tftpl"
destination = ".github/workflows/promote.yaml"
vars = {}
vars = {
charmcraft_channel = "2.x/stable",
}
}
release = {
source = "./templates/github/charm_release.yaml.tftpl"
destination = ".github/workflows/release.yaml"
vars = {
runs_on = "[[ubuntu-22.04]]",
runs_on = "[[ubuntu-22.04]]",
charmcraft_channel = "2.x/stable",
}
}
jira_sync_config = {
Expand Down
7 changes: 5 additions & 2 deletions terraform-plans/configs/charm-apt-mirror_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@ templates = {
promote = {
source = "./templates/github/charm_promote.yaml.tftpl"
destination = ".github/workflows/promote.yaml"
vars = {}
vars = {
charmcraft_channel = "2.x/stable",
}
}
release = {
source = "./templates/github/charm_release.yaml.tftpl"
destination = ".github/workflows/release.yaml"
vars = {
runs_on = "[[ubuntu-22.04]]",
runs_on = "[[ubuntu-22.04]]",
charmcraft_channel = "2.x/stable",
}
}
jira_sync_config = {
Expand Down
7 changes: 5 additions & 2 deletions terraform-plans/configs/charm-juju-backup-all_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@ templates = {
promote = {
source = "./templates/github/charm_promote.yaml.tftpl"
destination = ".github/workflows/promote.yaml"
vars = {}
vars = {
charmcraft_channel = "2.x/stable",
}
}
release = {
source = "./templates/github/charm_release.yaml.tftpl"
destination = ".github/workflows/release.yaml"
vars = {
runs_on = "[[ubuntu-22.04]]",
runs_on = "[[ubuntu-22.04]]",
charmcraft_channel = "2.x/stable",
}
}
jira_sync_config = {
Expand Down
7 changes: 5 additions & 2 deletions terraform-plans/configs/charm-juju-local_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@ templates = {
promote = {
source = "./templates/github/charm_promote.yaml.tftpl"
destination = ".github/workflows/promote.yaml"
vars = {}
vars = {
charmcraft_channel = "2.x/stable",
}
}
release = {
source = "./templates/github/charm_release.yaml.tftpl"
destination = ".github/workflows/release.yaml"
vars = {
runs_on = "[[ubuntu-22.04]]",
runs_on = "[[ubuntu-22.04]]",
charmcraft_channel = "2.x/stable",
}
}
jira_sync_config = {
Expand Down
7 changes: 5 additions & 2 deletions terraform-plans/configs/charm-local-users_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ templates = {
promote = {
source = "./templates/github/charm_promote.yaml.tftpl"
destination = ".github/workflows/promote.yaml"
vars = {}
vars = {
charmcraft_channel = "2.x/stable",
}
}
release = {
source = "./templates/github/charm_release.yaml.tftpl"
Expand All @@ -37,7 +39,8 @@ templates = {
# github hosted runners are amd64
# Ubuntu_ARM64_4C_16G_01 is the github-hosted arm64 runner we have access to.
# We prefer the github runners because they are smaller machines and save resources.
runs_on = "[[ubuntu-22.04], [Ubuntu_ARM64_4C_16G_01]]",
runs_on = "[[ubuntu-22.04], [Ubuntu_ARM64_4C_16G_01]]",
charmcraft_channel = "2.x/stable",
}
}
jira_sync_config = {
Expand Down
7 changes: 5 additions & 2 deletions terraform-plans/configs/charm-logrotated_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@ templates = {
promote = {
source = "./templates/github/charm_promote.yaml.tftpl"
destination = ".github/workflows/promote.yaml"
vars = {}
vars = {
charmcraft_channel = "2.x/stable",
}
}
release = {
source = "./templates/github/charm_release.yaml.tftpl"
destination = ".github/workflows/release.yaml"
vars = {
runs_on = "[[ubuntu-22.04]]",
runs_on = "[[ubuntu-22.04]]",
charmcraft_channel = "2.x/stable",
}
}
jira_sync_config = {
Expand Down
7 changes: 5 additions & 2 deletions terraform-plans/configs/charm-nginx_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@ templates = {
promote = {
source = "./templates/github/charm_promote.yaml.tftpl"
destination = ".github/workflows/promote.yaml"
vars = {}
vars = {
charmcraft_channel = "2.x/stable",
}
}
release = {
source = "./templates/github/charm_release.yaml.tftpl"
destination = ".github/workflows/release.yaml"
vars = {
runs_on = "[[ubuntu-22.04]]",
runs_on = "[[ubuntu-22.04]]",
charmcraft_channel = "2.x/stable",
}
}
jira_sync_config = {
Expand Down
7 changes: 5 additions & 2 deletions terraform-plans/configs/charm-nrpe_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,16 @@ templates = {
promote = {
source = "./templates/github/charm_promote.yaml.tftpl"
destination = ".github/workflows/promote.yaml"
vars = {}
vars = {
charmcraft_channel = "2.x/stable",
}
}
release = {
source = "./templates/github/charm_release.yaml.tftpl"
destination = ".github/workflows/release.yaml"
vars = {
runs_on = "[[ubuntu-22.04]]",
runs_on = "[[ubuntu-22.04]]",
charmcraft_channel = "2.x/stable",
}
}
jira_sync_config = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,16 @@ templates = {
promote = {
source = "./templates/github/charm_promote.yaml.tftpl"
destination = ".github/workflows/promote.yaml"
vars = {}
vars = {
charmcraft_channel = "2.x/stable",
}
}
release = {
source = "./templates/github/charm_release.yaml.tftpl"
destination = ".github/workflows/release.yaml"
vars = {
runs_on = "[[ubuntu-22.04]]",
runs_on = "[[ubuntu-22.04]]",
charmcraft_channel = "2.x/stable",
}
}
jira_sync_config = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ templates = {
promote = {
source = "./templates/github/charm_promote.yaml.tftpl"
destination = ".github/workflows/promote.yaml"
vars = {}
vars = {
charmcraft_channel = "2.x/stable",
}
}
release = {
source = "./templates/github/charm_release.yaml.tftpl"
Expand All @@ -37,7 +39,8 @@ templates = {
# github hosted runners are amd64
# Ubuntu_ARM64_4C_16G_01 is the github-hosted arm64 runner we have access to.
# We prefer the github runners because they are smaller machines and save resources.
runs_on = "[[ubuntu-22.04], [Ubuntu_ARM64_4C_16G_01]]",
runs_on = "[[ubuntu-22.04], [Ubuntu_ARM64_4C_16G_01]]",
charmcraft_channel = "2.x/stable",
}
jira_sync_config = {
source = "./templates/github/jira_sync_config.yaml.tftpl"
Expand Down
7 changes: 5 additions & 2 deletions terraform-plans/configs/charm-sysconfig_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,16 @@ templates = {
promote = {
source = "./templates/github/charm_promote.yaml.tftpl"
destination = ".github/workflows/promote.yaml"
vars = {}
vars = {
charmcraft_channel = "2.x/stable",
}
}
release = {
source = "./templates/github/charm_release.yaml.tftpl"
destination = ".github/workflows/release.yaml"
vars = {
runs_on = "[[ubuntu-22.04], [Ubuntu_ARM64_4C_16G_01]]",
runs_on = "[[ubuntu-22.04], [Ubuntu_ARM64_4C_16G_01]]",
charmcraft_channel = "2.x/stable",
}
}
jira_sync_config = {
Expand Down
7 changes: 5 additions & 2 deletions terraform-plans/configs/charm-userdir-ldap_main.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,16 @@ templates = {
promote = {
source = "./templates/github/charm_promote.yaml.tftpl"
destination = ".github/workflows/promote.yaml"
vars = {}
vars = {
charmcraft_channel = "2.x/stable",
}
}
release = {
source = "./templates/github/charm_release.yaml.tftpl"
destination = ".github/workflows/release.yaml"
vars = {
runs_on = "[[ubuntu-22.04]]",
runs_on = "[[ubuntu-22.04]]",
charmcraft_channel = "2.x/stable",
}
}
jira_sync_config = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@ templates = {
promote = {
source = "./templates/github/charm_promote.yaml.tftpl"
destination = ".github/workflows/promote.yaml"
vars = {}
vars = {
charmcraft_channel = "2.x/stable",
}
}
release = {
source = "./templates/github/charm_release.yaml.tftpl"
destination = ".github/workflows/release.yaml"
vars = {
runs_on = "[[ubuntu-22.04], [Ubuntu_ARM64_4C_16G_01]]",
runs_on = "[[ubuntu-22.04], [Ubuntu_ARM64_4C_16G_01]]",
charmcraft_channel = "2.x/stable",
}
}
jira_sync_config = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,16 @@ templates = {
promote = {
source = "./templates/github/charm_promote.yaml.tftpl"
destination = ".github/workflows/promote.yaml"
vars = {}
vars = {
charmcraft_channel = "3.x/stable",
}
}
release = {
source = "./templates/github/charm_release.yaml.tftpl"
destination = ".github/workflows/release.yaml"
vars = {
runs_on = "[[ubuntu-22.04]]",
runs_on = "[[ubuntu-22.04]]",
charmcraft_channel = "3.x/stable",
}
}
jira_sync_config = {
Expand Down
2 changes: 1 addition & 1 deletion terraform-plans/templates/github/charm_promote.yaml.tftpl
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ jobs:
github-token: $${{ secrets.GITHUB_TOKEN }}
destination-channel: $${{ steps.set-channels.outputs.destination-channel }}
origin-channel: $${{ steps.set-channels.outputs.origin-channel }}
charmcraft-channel: "2.x/stable"
charmcraft-channel: "${charmcraft_channel}"
2 changes: 1 addition & 1 deletion terraform-plans/templates/github/charm_release.yaml.tftpl
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Pack and upload to charmhub
uses: canonical/charming-actions/upload-charm@2.6.2
with:
charmcraft-channel: "2.x/stable"
charmcraft-channel: "${charmcraft_channel}"
credentials: "$${{ secrets.CHARMHUB_TOKEN }}"
github-token: "$${{ secrets.GITHUB_TOKEN }}"
# Ensure the charm is built in an isolated environment and on the correct base in an lxd container.
Expand Down

0 comments on commit 0d340e2

Please sign in to comment.