我使用mac。我在react-native上有ios和android项目,并为每个项目创建了fastlane脚本。现在,我想在管道中自动使用Jenkins进行构建,因此我有Jenkins文件。在Jenkins的工作空间中,我必须转到ios
文件夹并执行fastlane脚本。
但问题在于Jenkins不会使用command更改目录sh 'cd ios'
。我可以看到它,因为我pwd
在更改目录命令之前和之后执行命令。
我尝试使用符号链接,在当前进程中使用“点”命令(例如sh '. cd ios'
)运行命令,并尝试使用ios文件夹的完整路径。但这一切并没有带来成功:(
那么,为什么詹金斯不使用sh 'cd ios'
命令更改目录?我该如何应对?先感谢您。
这是我的剧本
pipeline {
代理任何
工具{nodejs“ Jenkins_NodeJS”}
阶段{
stage('Pulling git repo'){
steps{
git(
url: 'url_to_git_repo',
credentialsId: 'jenkins_private_key2',
branch: 'new_code'
)
}
}
stage('Prepare') {
steps{
sh 'npm install -g yarn'
sh 'yarn install'
}
}
stage('Building') {
steps{
sh 'cd /Users/igor/.jenkins/workspace/MobileAppsPipeline/ios'
sh 'ls -l'
sh '/usr/local/bin/fastlane build_and_push'
}
}
}}
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句