Ank*_*mar 8 gitlab gitlab-ci-runner fastlane
我目前正在使用.env文件来获取 FASTFILE 中的环境变量,但现在我正在尝试使用 GitLab CI/CD 自动化 fastlane。
由于.env包含所有键的文件无法推送到分支,因此我必须.env在 GitLab 运行程序的环境变量中声明所有或环境变量。
我想知道如何在我的 fastfile 中使用 GitLab 运行程序的环境变量。
lane :build_staging do |options|
environment_variable(set: { 'ENVFILE' => '.env.staging' }) // I want to use the GitLab environment variable
clean
gradle(task: options[:task], build_type: 'Staging', project_dir: 'android/')
end
Run Code Online (Sandbox Code Playgroud)
Nic*_*ter -2
在Settings>中Variables,您可以将整个文件定义为具有指定范围的变量:
在您的 gitlab-ci 中,您可以通过指定变量名称(在我的示例中)和工作中$ENV_FILE使用关键字的范围来使用它:stage
build:
stage: staging
script:
# do your work here
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3052 次 |
| 最近记录: |