pipelineはmasterで起動し、コマンド結果から動的に環境変数を設定したうえで、stageにworkerを指定すればよい。
```jenkins
pipeline {
agent master
environment {
CC = """${sh(
returnStdout: true,
script: 'cat ${your_file}'
)}"""
}
stages {
stage('Example') {
agent worker
//...
}
}
```
## 参考
- [Using a Jenkinsfile](https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#using-environment-variables)