小编Dax*_*cor的帖子

如何在 gitlab ci/cd 管道上进行 docker 构建期间解锁 git-crypt 文件

我有一个包含加密文件的存储库,使用 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)

git gitlab docker git-crypt

3
推荐指数
1
解决办法
2910
查看次数

标签 统计

docker ×1

git ×1

git-crypt ×1

gitlab ×1