Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OpenTofu
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
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
components
OpenTofu
Commits
dab36747
Unverified
Commit
dab36747
authored
5 months ago
by
Enno Gotthold
Browse files
Options
Downloads
Patches
Plain Diff
Add the option to use a custom CA certificate
parent
839a6cf8
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+12
-0
12 additions, 0 deletions
.gitlab-ci.yml
.gitlab/README.md.template
+7
-0
7 additions, 0 deletions
.gitlab/README.md.template
README.md
+7
-0
7 additions, 0 deletions
README.md
with
26 additions
and
0 deletions
.gitlab-ci.yml
+
12
−
0
View file @
dab36747
...
@@ -98,6 +98,15 @@ stages:
...
@@ -98,6 +98,15 @@ stages:
-
export RELEASE_IMAGE_TAG="${RELEASE_VERSION}${RELEASE_OPENTOFU_VERSION:+-opentofu$RELEASE_OPENTOFU_VERSION}${RELEASE_BASE_IMAGE_OS:+-$RELEASE_BASE_IMAGE_OS}"
-
export RELEASE_IMAGE_TAG="${RELEASE_VERSION}${RELEASE_OPENTOFU_VERSION:+-opentofu$RELEASE_OPENTOFU_VERSION}${RELEASE_BASE_IMAGE_OS:+-$RELEASE_BASE_IMAGE_OS}"
-
export RELEASE_IMAGE="${RELEASE_IMAGE_NAME}:${RELEASE_IMAGE_TAG}"
-
export RELEASE_IMAGE="${RELEASE_IMAGE_NAME}:${RELEASE_IMAGE_TAG}"
.install-custom-ca
:
&install-custom-ca
-
|
if [ -f "${CUSTOM_CA}" ]; then
cp "$CUSTOM_CA" /usr/share/pki/ca-trust-source/anchors/custom-ca.pem
update-ca-trust
else
echo 'Skipping to install custom CA because $CUSTOM_CA environment variable is not set'
fi
variables
:
variables
:
# OpenTofu variables
# OpenTofu variables
LATEST_OPENTOFU_VERSION
:
!reference
[
.data
,
latest_version
]
LATEST_OPENTOFU_VERSION
:
!reference
[
.data
,
latest_version
]
...
@@ -133,6 +142,7 @@ check-semantic-version:
...
@@ -133,6 +142,7 @@ check-semantic-version:
stage
:
build
stage
:
build
image
:
quay.io/containers/buildah:v1.38.1
image
:
quay.io/containers/buildah:v1.38.1
before_script
:
before_script
:
-
*install-custom-ca
# Supporting GitLab dependency proxies:
# Supporting GitLab dependency proxies:
# see https://docs.gitlab.com/ee/user/packages/dependency_proxy/
# see https://docs.gitlab.com/ee/user/packages/dependency_proxy/
-
|
-
|
...
@@ -241,6 +251,7 @@ shellcheck:
...
@@ -241,6 +251,7 @@ shellcheck:
variables
:
variables
:
GITLAB_OPENTOFU_BASE_IMAGE_OS
:
$RELEASE_BASE_IMAGE_OS
GITLAB_OPENTOFU_BASE_IMAGE_OS
:
$RELEASE_BASE_IMAGE_OS
before_script
:
before_script
:
-
*install-custom-ca
-
*image-matrix-deploy-release-name-script
-
*image-matrix-deploy-release-name-script
-
crane auth login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
-
crane auth login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
-
'
echo
"base
image
OS:
$GITLAB_OPENTOFU_BASE_IMAGE_OS"'
-
'
echo
"base
image
OS:
$GITLAB_OPENTOFU_BASE_IMAGE_OS"'
...
@@ -327,6 +338,7 @@ gitlab-opentofu-image:verify-signature:
...
@@ -327,6 +338,7 @@ gitlab-opentofu-image:verify-signature:
name
:
alpine/crane:0.20.3
name
:
alpine/crane:0.20.3
entrypoint
:
[
"
"
]
entrypoint
:
[
"
"
]
before_script
:
before_script
:
-
*install-custom-ca
-
*image-matrix-deploy-release-name-script
-
*image-matrix-deploy-release-name-script
-
apk add --update cosign
-
apk add --update cosign
script
:
script
:
...
...
This diff is collapsed.
Click to expand it.
.gitlab/README.md.template
+
7
−
0
View file @
dab36747
...
@@ -548,6 +548,13 @@ The pipeline of this component respects the
...
@@ -548,6 +548,13 @@ The pipeline of this component respects the
by detecting the `CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX` environment variable
by detecting the `CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX` environment variable
and configuring `buildah` to use it when building the container images.
and configuring `buildah` to use it when building the container images.
If you need to use this CI/CD component with a custom root CA, please set a CI/CD file variable called `CUSTOM_CA`. The
certificate needs to be in the PEM format. Currently the certificate is applied to the following jobs:
- `gitlab-opentofu-image:build`
- `gitlab-opentofu-image:deploy`
- `gitlab-opentofu-image:verify-signature`
## Migrating from the Terraform CI/CD templates
## Migrating from the Terraform CI/CD templates
When migrating from the GitLab Terraform CI/CD templates you can use the following migration rules:
When migrating from the GitLab Terraform CI/CD templates you can use the following migration rules:
...
...
This diff is collapsed.
Click to expand it.
README.md
+
7
−
0
View file @
dab36747
...
@@ -622,6 +622,13 @@ The pipeline of this component respects the
...
@@ -622,6 +622,13 @@ The pipeline of this component respects the
by detecting the `CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX` environment variable
by detecting the `CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX` environment variable
and configuring `buildah` to use it when building the container images.
and configuring `buildah` to use it when building the container images.
If you need to use this CI/CD component with a custom root CA, please set a CI/CD file variable called `CUSTOM_CA`. The
certificate needs to be in the PEM format. Currently the certificate is applied to the following jobs:
- `gitlab-opentofu-image:build`
- `gitlab-opentofu-image:deploy`
- `gitlab-opentofu-image:verify-signature`
## Migrating from the Terraform CI/CD templates
## Migrating from the Terraform CI/CD templates
When migrating from the GitLab Terraform CI/CD templates you can use the following migration rules:
When migrating from the GitLab Terraform CI/CD templates you can use the following migration rules:
...
...
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