我目前正在使用.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)