1

GitLab offers a Project-level Secure Files, the API has you add this to your .gitlab-ci.yml,

test:
  variables:
    SECURE_FILES_DOWNLOAD_PATH: './where/files/should/go/'
  script:
    - curl --silent "https://gitlab.com/gitlab-org/incubation-engineering/mobile-devops/download-secure-files/-/raw/main/installer" | bash

However, I'm using the Terraform image which is Alpine without bash which the installer script requires.

How can you use Secure File API if your container doesn't have bash?

Evan Carroll
  • 2,921
  • 6
  • 37
  • 85

1 Answers1

0

Currently, the only option when your container doesn't have bash is to add it. With Alpine you can do that with apk add bash. You can do that with before_script like this,

test:
  variables:
    SECURE_FILES_DOWNLOAD_PATH: './where/files/should/go/'
  before_script:
    - apk add bash
  script:
    - curl --silent "https://gitlab.com/gitlab-org/incubation-engineering/mobile-devops/download-secure-files/-/raw/main/installer" | bash
Evan Carroll
  • 2,921
  • 6
  • 37
  • 85