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

Commit 8aad45b

Browse files
author
Sean Sundberg
committed
Initial commit
0 parents  commit 8aad45b

17 files changed

+382
-0
lines changed

.github/release-drafter.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name-template: 'v$RESOLVED_VERSION'
2+
tag-template: 'v$RESOLVED_VERSION'
3+
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
4+
categories:
5+
- title: 'Features'
6+
labels:
7+
- 'feature'
8+
- 'enhancement'
9+
- title: 'Bug Fixes'
10+
labels:
11+
- 'fix'
12+
- 'bugfix'
13+
- 'bug'
14+
- title: 'Maintenance'
15+
label: 'chore'
16+
version-resolver:
17+
major:
18+
labels:
19+
- 'major'
20+
minor:
21+
labels:
22+
- 'minor'
23+
patch:
24+
labels:
25+
- 'patch'
26+
default: patch
27+
template: |
28+
$CHANGES

.github/workflows/notify.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
on:
2+
release:
3+
types: [published]
4+
5+
jobs:
6+
notify:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Publish repository dispatch
11+
uses: ibm-garage-cloud/action-repository-dispatch@main
12+
with:
13+
notifyRepo: ibm-garage-cloud/ibm-garage-iteration-zero
14+
eventType: released
15+
env:
16+
GITHUB_TOKEN: ${{ secrets.TOKEN }}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Publish assets
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
jobs:
9+
publish-assets:
10+
runs-on: ubuntu-latest
11+
12+
env:
13+
DIST_DIR: ./dist
14+
PUBLISH_BRANCH: gh-pages
15+
16+
steps:
17+
- name: Checkout
18+
uses: actions/checkout@v2
19+
with:
20+
ref: ${{ github.event.release.tag_name }}
21+
22+
- name: Build catalog
23+
uses: ibm-garage-cloud/action-module-catalog@main
24+
with:
25+
tagName: ${{ github.event.release.tag_name }}
26+
distDir: ${{ env.DIST_DIR }}
27+
publishBranch: ${{ env.PUBLISH_BRANCH }}
28+
29+
- name: Deploy
30+
uses: peaceiris/actions-gh-pages@v3
31+
with:
32+
github_token: ${{ secrets.GITHUB_TOKEN }}
33+
publish_dir: ${{ env.DIST_DIR }}
34+
publish_branch: ${{ env.PUBLISH_BRANCH }}

.github/workflows/verify.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Verify and release module
2+
3+
# Controls when the action will run. Triggers the workflow on push or pull request
4+
# events but only for the main branch
5+
on:
6+
push:
7+
branches: [ main ]
8+
pull_request:
9+
branches: [ main ]
10+
11+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
12+
jobs:
13+
verify:
14+
if: ${{ !contains( github.event.pull_request.labels.*.name, 'skip ci' ) }}
15+
runs-on: ubuntu-latest
16+
container: quay.io/ibmgaragecloud/cli-tools:v0.10.0-lite
17+
18+
strategy:
19+
matrix:
20+
platform: [ocp4_latest]
21+
# max-parallel: 1
22+
fail-fast: false
23+
24+
env:
25+
HOME: /home/devops
26+
27+
# Steps represent a sequence of tasks that will be executed as part of the job
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v1
31+
32+
- name: Verify deploy on ${{ matrix.platform }}
33+
uses: ibm-garage-cloud/action-module-verify-deploy@main
34+
with:
35+
clusterId: ${{ matrix.platform }}
36+
validateDeployScript: .github/scripts/validate-deploy.sh
37+
env:
38+
TF_VAR_ibmcloud_api_key: ${{ secrets.IBMCLOUD_API_KEY }}
39+
IBMCLOUD_API_KEY: ${{ secrets.IBMCLOUD_API_KEY }}
40+
41+
- name: Verify destroy on ${{ matrix.platform }}
42+
uses: ibm-garage-cloud/action-module-verify-destroy@main
43+
if: ${{ always() }}
44+
with:
45+
clusterId: ${{ matrix.platform }}
46+
env:
47+
TF_VAR_ibmcloud_api_key: ${{ secrets.IBMCLOUD_API_KEY }}
48+
IBMCLOUD_API_KEY: ${{ secrets.IBMCLOUD_API_KEY }}
49+
50+
51+
release:
52+
# if: ${{ github.event_name == 'push' }}
53+
needs: verify
54+
runs-on: ubuntu-latest
55+
if: ${{ github.event_name == 'push' }}
56+
57+
# Steps represent a sequence of tasks that will be executed as part of the job
58+
steps:
59+
# Drafts your next Release notes as Pull Requests are merged into "main"
60+
- uses: release-drafter/release-drafter@v5
61+
with:
62+
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
63+
config-name: release-drafter.yaml
64+
publish: true
65+
env:
66+
GITHUB_TOKEN: ${{ secrets.TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea/

README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# Starter kit for a Terraform module
2+
3+
This is a Starter kit to help with the creation of Terraform modules. The basic structure of a Terraform module is fairly
4+
simple and consists of the following basic values:
5+
6+
- README.md - provides a description of the module
7+
- main.tf - defiens the logic for the module
8+
- variables.tf (optional) - defines the input variables for the module
9+
- outputs.tf (optional) - defines the values that are output from the module
10+
11+
Beyond those files, any other content can be added and organized however you see fit. For example, you can add a `scripts/` directory
12+
that contains shell scripts executed by a `local-exec` `null_resource` in the terraform module. The contents will depend on what your
13+
module does and how it does it.
14+
15+
## Instructions for creating a new module
16+
17+
1. Update the title and description in the README to match the module you are creating
18+
2. Fill out the remaining sections in the README template as appropriate
19+
3. Implement your logic in the in the main.tf, variables.tf, and outputs.tf
20+
4. Use releases/tags to manage release versions of your module
21+
22+
## Software dependencies
23+
24+
The module depends on the following software components:
25+
26+
### Command-line tools
27+
28+
- terraform - v12
29+
- kubectl
30+
31+
### Terraform providers
32+
33+
- IBM Cloud provider >= 1.5.3
34+
- Helm provider >= 1.1.1 (provided by Terraform)
35+
36+
## Module dependencies
37+
38+
This module makes use of the output from other modules:
39+
40+
- Cluster - github.com/ibm-garage-cloud/terraform-ibm-container-platform.git
41+
- Namespace - github.com/ibm-garage-clout/terraform-cluster-namespace.git
42+
- etc
43+
44+
## Example usage
45+
46+
```hcl-terraform
47+
module "dev_tools_argocd" {
48+
source = "github.com/ibm-garage-cloud/terraform-tools-argocd.git?ref=v1.0.0"
49+
50+
cluster_config_file = module.dev_cluster.config_file_path
51+
cluster_type = module.dev_cluster.type
52+
app_namespace = module.dev_cluster_namespaces.tools_namespace_name
53+
ingress_subdomain = module.dev_cluster.ingress_hostname
54+
olm_namespace = module.dev_software_olm.olm_namespace
55+
operator_namespace = module.dev_software_olm.target_namespace
56+
name = "argocd"
57+
}
58+
```
59+

main.tf

Whitespace-only changes.

module.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: ""
2+
type: terraform
3+
description: ""
4+
tags:
5+
- tools
6+
- devops
7+
versions:
8+
- platforms:
9+
- kubernetes
10+
- ocp3
11+
- ocp4
12+
dependencies: []
13+
# - id: cluster
14+
# refs:
15+
# - source: github.com/ibm-garage-cloud/terraform-ibm-container-platform
16+
# version: ">= 1.7.0"
17+
# - source: github.com/ibm-garage-cloud/terraform-k8s-ocp-cluster
18+
# version: ">= 2.0.0"
19+
# - id: namespace
20+
# refs:
21+
# - source: github.com/ibm-garage-cloud/terraform-k8s-namespace
22+
# version: ">= 2.1.0"
23+
# - id: dashboard
24+
# refs:
25+
# - source: github.com/ibm-garage-cloud/terraform-k8s-dashboard
26+
# version: ">= 1.6.0"
27+
variables: []
28+
# - name: cluster_type
29+
# moduleRef:
30+
# id: cluster
31+
# output: type_code
32+
# - name: cluster_ingress_hostname
33+
# moduleRef:
34+
# id: cluster
35+
# output: ingress_hostname
36+
# - name: cluster_config_file
37+
# moduleRef:
38+
# id: cluster
39+
# output: config_file_path
40+
# - name: tls_secret_name
41+
# moduleRef:
42+
# id: cluster
43+
# output: tls_secret_name
44+
# - name: releases_namespace
45+
# moduleRef:
46+
# id: namespace
47+
# output: name
48+
# discriminator: tools
49+
# - name: icon_url
50+
# moduleRef:
51+
# id: dashboard
52+
# output: base_icon_url

outputs.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#output "myoutput" {
2+
# description = "Description of my output"
3+
# value = "value"
4+
# depends_on = [<some resource>]
5+
#}

test/stages/stage0.tf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
terraform {
2+
}

0 commit comments

Comments
 (0)