FAQ
| This is a
LIVE
service |
Changelog
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DevOps Division Guidebook
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Information Services
DevOps
General Documentation
DevOps Division Guidebook
Commits
c9251b1a
Commit
c9251b1a
authored
3 years ago
by
Dr Rich Wareham
Browse files
Options
Downloads
Patches
Plain Diff
add docs on publishing terraform modules
parent
a8f2a5e7
No related branches found
No related tags found
1 merge request
!90
add docs on publishing terraform modules
Pipeline
#106042
passed
3 years ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
docs/deployment/k8s-clusters.md
+5
-0
5 additions, 0 deletions
docs/deployment/k8s-clusters.md
docs/workflow/terraform-modules.md
+56
-0
56 additions, 0 deletions
docs/workflow/terraform-modules.md
mkdocs.yml
+1
-0
1 addition, 0 deletions
mkdocs.yml
with
62 additions
and
0 deletions
docs/deployment/k8s-clusters.md
+
5
−
0
View file @
c9251b1a
...
...
@@ -2,3 +2,8 @@
This page documents how we provision and manage Kubernetes clusters via the
Google Kubernetes Engine service.
!!! warning
We have relatively few services hosted via Kubernetes and as such we are
still fine-tuning our procedures, processes and policies surrounding it.
This diff is collapsed.
Click to expand it.
docs/workflow/terraform-modules.md
0 → 100644
+
56
−
0
View file @
c9251b1a
# Publishing terraform modules
We publish terraform modules using the built-in terraform registry. See the
[
gcp-function
registry
](
https://gitlab.developers.cam.ac.uk/uis/devops/infra/terraform/gcp-function/-/infrastructure_registry
)
for an example.
A
[
dedicated
template
](
https://gitlab.developers.cam.ac.uk/uis/devops/continuous-delivery/ci-templates/-/blob/master/terraform-module-publish.yml
)
is available in our CI templates project which can be used to automate
publication of modules to the terraform registry.
The default template's behaviour is to publish a module when a commit is
`git
tag`
-ed with a name which corresponds to a
[
semver
version
](
https://semver.org/
)
.
## Using the CI template
A minimal example of making use of the template is as follows. It should be
added to the
`.gitlab-ci.yml`
file in the terraform module project.
```
yaml
include
:
-
project
:
'
uis/devops/continuous-delivery/ci-templates'
file
:
'
/terraform-module-publish.yml'
stages
:
-
publish
publish
:
extends
:
.terraform_module_publish
stage
:
publish
variables
:
TERRAFORM_MODULE_SYSTEM
:
google
# or local, aws, etc...
```
The
`TERRAFORM_MODULE_SYSTEM`
variable should be set in a manner which reflects
the main system or provider used by the module. For most of our Google Cloud
Platform modules this should be "google".
## Releasing a new module version
To release a new module version, tag the latest release with a bare version
number. E.g. to tag current master/main:
```
console
$
git checkout main
# or 'master' for older projects
$
git pull
# ensure we're up to date
$
git tag 2.0.1
# tag release
$
git push origin
--tags
# push tags to GitLab
```
## Changelogs
You should maintain a
`CHANGELOG`
file in the project root which records what
changed in each release. See the existing terraform modules for examples.
This diff is collapsed.
Click to expand it.
mkdocs.yml
+
1
−
0
View file @
c9251b1a
...
...
@@ -27,6 +27,7 @@ nav:
-
workflow/pipelines.md
-
workflow/onboarding.md
-
workflow/pypi.md
-
workflow/terraform-modules.md
-
workflow/credentials-and-secrets.md
-
'
Best
Practice'
:
-
best-practice/index.md
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment