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
9dc38546
Unverified
Commit
9dc38546
authored
3 months ago
by
Enno Gotthold
Browse files
Options
Downloads
Patches
Plain Diff
Deploy custom CAs correctly on alpine base images
parent
a5ca1009
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+16
-4
16 additions, 4 deletions
.gitlab-ci.yml
with
16 additions
and
4 deletions
.gitlab-ci.yml
+
16
−
4
View file @
9dc38546
...
...
@@ -104,7 +104,19 @@ 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="${RELEASE_IMAGE_NAME}:${RELEASE_IMAGE_TAG}"
.install-custom-ca
:
&install-custom-ca
.install-custom-ca-alpine
:
&install-custom-ca-alpine
-
|
if [ -f "${CUSTOM_CA}" ]; then
apk add --no-cache update-ca-certificates
mkdir -p /usr/local/share/ca-certificates/
cp "$CUSTOM_CA" /usr/local/share/ca-certificates/custom-ca.pem
update-ca-certificates
else
echo 'Skipping to install custom CA because $CUSTOM_CA environment variable is not set'
fi
.install-custom-ca-fedora
:
&install-custom-ca-fedora
-
|
if [ -f "${CUSTOM_CA}" ]; then
cp "$CUSTOM_CA" /usr/share/pki/ca-trust-source/anchors/custom-ca.pem
...
...
@@ -150,7 +162,7 @@ check-semantic-version:
stage
:
build
image
:
quay.io/containers/buildah:v1.38.1
before_script
:
-
*install-custom-ca
-
*install-custom-ca
-fedora
# Supporting GitLab dependency proxies:
# see https://docs.gitlab.com/ee/user/packages/dependency_proxy/
-
|
...
...
@@ -264,7 +276,7 @@ shellcheck:
variables
:
GITLAB_OPENTOFU_BASE_IMAGE_OS
:
$RELEASE_BASE_IMAGE_OS
before_script
:
-
*install-custom-ca
-
*install-custom-ca
-alpine
-
*image-matrix-deploy-release-name-script
-
crane auth login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" "$CI_REGISTRY"
-
'
echo
"base
image
OS:
$GITLAB_OPENTOFU_BASE_IMAGE_OS"'
...
...
@@ -354,7 +366,7 @@ gitlab-opentofu-image:verify-signature:
name
:
alpine/crane:0.20.3
entrypoint
:
[
"
"
]
before_script
:
-
*install-custom-ca
-
*install-custom-ca
-alpine
-
*image-matrix-deploy-release-name-script
-
apk add --update cosign
script
:
...
...
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