我有一个包含加密文件的存储库,使用 git-crypt。我已将密钥导出到文件中。现在我使用 gitlab 上的默认 docker 镜像构建模板来构建我的镜像。管道工作得很好。我只是不知道如何在构建过程中“解锁”文件,以便图像具有可供使用的明文文件。管道构建如下所示:
docker-build:
# Use the official docker image.
image: docker:latest
stage: build
services:
- docker:dind
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
# Default branch leaves tag empty (= latest tag)
# All other branches are tagged with the escaped branch name (commit ref slug)
script:
- |
if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then
tag=""
echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'"
else
tag=":$CI_COMMIT_REF_SLUG"
echo "Running on branch '$CI_COMMIT_BRANCH': tag …Run Code Online (Sandbox Code Playgroud)