Skip to content
This repository has been archived by the owner on Aug 12, 2024. It is now read-only.

Commit

Permalink
Renames module to ibm-cloud-monitoring and maintenance (#30)
Browse files Browse the repository at this point in the history
- Renames module in module.yaml to ibm-cloud-monitoring - closes #27
- Adds Apache 2.0 license to repo - closes #28
- Updates workflows to use shared definitions in action-workflows repo - closes #29

Signed-off-by: Sean Sundberg <seansund@us.ibm.com>
  • Loading branch information
seansund committed Mar 28, 2022
1 parent 22c83a0 commit f9628a0
Show file tree
Hide file tree
Showing 8 changed files with 309 additions and 104 deletions.
21 changes: 5 additions & 16 deletions .github/workflows/notify.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
name: Notify

on:
release:
types: [published]

jobs:
notify:
runs-on: ubuntu-latest

strategy:
matrix:
repo:
- cloud-native-toolkit/ibm-garage-iteration-zero
- cloud-native-toolkit/garage-terraform-modules

steps:
- name: Repository dispatch ${{ matrix.repo }}
uses: cloud-native-toolkit/action-repository-dispatch@main
with:
notifyRepo: ${{ matrix.repo }}
eventType: released
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
uses: cloud-native-toolkit/action-workflows/.github/workflows/notify.yaml@v1
secrets:
TOKEN: ${{ secrets.TOKEN }}
34 changes: 0 additions & 34 deletions .github/workflows/publish-assets.yaml

This file was deleted.

12 changes: 12 additions & 0 deletions .github/workflows/publish-metadata.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Publish metadata

on:
release:
types:
- published

jobs:
publish-assets:
uses: cloud-native-toolkit/action-workflows/.github/workflows/publish-metadata.yaml@v1
secrets:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
21 changes: 21 additions & 0 deletions .github/workflows/verify-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Verify PR

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
pull_request:
branches: [ main ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
verify:
if: ${{ !contains( github.event.pull_request.labels.*.name, 'skip ci' ) }}
uses: ./.github/workflows/verify-workflow.yaml
secrets:
IBMCLOUD_API_KEY: ${{ secrets.IBMCLOUD_API_KEY }}
GIT_ORG: ${{ secrets.GIT_ORG }}
GIT_ADMIN_USERNAME: ${{ secrets.GIT_ADMIN_USERNAME }}
GIT_ADMIN_TOKEN: ${{ secrets.GIT_ADMIN_TOKEN }}

verifyMetadata:
uses: cloud-native-toolkit/action-workflows/.github/workflows/verify-module-metadata.yaml@v1
53 changes: 53 additions & 0 deletions .github/workflows/verify-workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Verify

# Controls when the action will run.
on:
workflow_call:
secrets:
GIT_ORG:
required: false
IBMCLOUD_API_KEY:
required: true
GIT_ADMIN_USERNAME:
required: true
GIT_ADMIN_TOKEN:
required: true

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
verify:
runs-on: ubuntu-latest
container: quay.io/cloudnativetoolkit/terraform:v1.1

strategy:
matrix:
testcase:
- ocp4_latest
fail-fast: false
max-parallel: 1

env:
HOME: /home/devops

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout
uses: actions/checkout@v1

- name: Verify deploy on ${{ matrix.testcase }}
uses: cloud-native-toolkit/action-module-verify-deploy@main
with:
clusterId: ${{ matrix.testcase }}
validateDeployScript: .github/scripts/validate-deploy.sh
env:
TF_VAR_ibmcloud_api_key: ${{ secrets.IBMCLOUD_API_KEY }}
IBMCLOUD_API_KEY: ${{ secrets.IBMCLOUD_API_KEY }}

- name: Verify destroy on ${{ matrix.testcase }}
uses: cloud-native-toolkit/action-module-verify-destroy@main
if: ${{ always() }}
with:
clusterId: ${{ matrix.testcase }}
env:
TF_VAR_ibmcloud_api_key: ${{ secrets.IBMCLOUD_API_KEY }}
IBMCLOUD_API_KEY: ${{ secrets.IBMCLOUD_API_KEY }}
64 changes: 13 additions & 51 deletions .github/workflows/verify.yaml
Original file line number Diff line number Diff line change
@@ -1,65 +1,27 @@
name: Verify and release module
name: Verify

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
verify:
if: ${{ !contains( github.event.pull_request.labels.*.name, 'skip ci' ) }}
runs-on: ubuntu-latest
container: quay.io/ibmgaragecloud/cli-tools:v0.15

strategy:
matrix:
platform: [ocp4_latest]
# max-parallel: 1
fail-fast: false

env:
HOME: /home/devops
uses: ./.github/workflows/verify-workflow.yaml
secrets:
IBMCLOUD_API_KEY: ${{ secrets.IBMCLOUD_API_KEY }}
GIT_ORG: ${{ secrets.GIT_ORG }}
GIT_ADMIN_USERNAME: ${{ secrets.GIT_ADMIN_USERNAME }}
GIT_ADMIN_TOKEN: ${{ secrets.GIT_ADMIN_TOKEN }}

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- name: Checkout
uses: actions/checkout@v1

- name: Verify deploy on ${{ matrix.platform }}
uses: ibm-garage-cloud/action-module-verify-deploy@main
with:
clusterId: ${{ matrix.platform }}
validateDeployScript: .github/scripts/validate-deploy.sh
env:
TF_VAR_ibmcloud_api_key: ${{ secrets.IBMCLOUD_API_KEY }}
IBMCLOUD_API_KEY: ${{ secrets.IBMCLOUD_API_KEY }}

- name: Verify destroy on ${{ matrix.platform }}
uses: ibm-garage-cloud/action-module-verify-destroy@main
if: ${{ always() }}
with:
clusterId: ${{ matrix.platform }}
env:
TF_VAR_ibmcloud_api_key: ${{ secrets.IBMCLOUD_API_KEY }}
IBMCLOUD_API_KEY: ${{ secrets.IBMCLOUD_API_KEY }}
verifyMetadata:
uses: cloud-native-toolkit/action-workflows/.github/workflows/verify-module-metadata.yaml@v1

release:
# if: ${{ github.event_name == 'push' }}
needs: verify
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' }}

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Drafts your next Release notes as Pull Requests are merged into "main"
- uses: release-drafter/release-drafter@v5
with:
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
config-name: release-drafter.yaml
publish: true
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
needs: [verify, verifyMetadata]
uses: cloud-native-toolkit/action-workflows/.github/workflows/release-module.yaml@v1
secrets:
TOKEN: ${{ secrets.TOKEN }}
Loading

0 comments on commit f9628a0

Please sign in to comment.