I have some trouble with Fastlane execution on Jenkins. Locally it works, build succeed and tests run. But from Jenkins and github, the build don't succeed. I think it's because of this line :
PhaseScriptExecution Run\ Script /Users/Shared/Jenkins/Library/Developer/Xcode/DerivedData/MyProject-bljizzbrhfznjpgjucmtarcsjmyw/Build/Intermediates.noindex/MyProject.build/Debug-iphonesimulator/Core.build/Script-FC957A9020120D68000F4790.sh
But not focus on that, I'm not sure that's it.
Here the Fastfile :
default_platform(:ios)
platform :ios do
desc "Launch Middleware tests"
lane :tests do
run_tests(workspace: "MyProject.xcworkspace",
clean: true,
devices: ["iPhone 8"],
scheme: "Middleware",
slack_url: "https://hooks.slack.com/services/...",
slack_channel: "#myChannel")
end
end
Some environment variables set
The command created by fastfile and executed by Jenkins
I found the answer, it appears that is that script : Script-FC957A9020120D68000F4790.sh, I was using sourcery before Swift 4.
${PODS_ROOT}/Sourcery/bin/sourcery --sources ${PROJECT_DIR}/Core --templates ${PROJECT_DIR}/Sourcery/Core/Templates --output ${PROJECT_DIR}/Core/Sourcery/
Jenkins was not able to find PODS_ROOT and PROJECT_DIR environment variables. I don't use sourcery anymore so, I commented that script but if you still use it, I think you can add environment variables to jenkins configuration
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.