jenkins
iOSビルドの自動化のためのJenkinsの設定。
サーチ…
前書き
これで、iOS 10のプロジェクトでJenkins 2.0のコードとしてContinuous IntegrationとContinuous Delivery( CI / CD )プロセスを定義することができます。ビルド、テスト、コードカバレッジ、チェックスタイル、レポート、通知などのアクティビティは、ファイル。
記事全体を読むには、iOS 10とXCode 8用のコードとしてJenkins 2.0のPipelineを参照してください
パラメーター
パラメータ | 詳細 |
---|---|
ノード( 'iOSノード') | Mac OS搭載のJenkinsノードJenkinsがMac OSで使用されている場合、 node {....} |
備考
この記事は、英語とスペイン語の両方の言語で書かれています。
タイムテーブルの例
ソースコードはGitHubからクローン化またはダウンロードしてテストすることができます。
node('iOS Node') {
stage('Checkout/Build/Test') {
// Checkout files.
checkout([
$class: 'GitSCM',
branches: [[name: 'master']],
doGenerateSubmoduleConfigurations: false,
extensions: [], submoduleCfg: [],
userRemoteConfigs: [[
name: 'github',
url: 'https://github.com/mmorejon/time-table.git'
]]
])
// Build and Test
sh 'xcodebuild -scheme "TimeTable" -configuration "Debug" build test -destination "platform=iOS Simulator,name=iPhone 6,OS=10.1" -enableCodeCoverage YES | /usr/local/bin/xcpretty -r junit'
// Publish test restults.
step([$class: 'JUnitResultArchiver', allowEmptyResults: true, testResults: 'build/reports/junit.xml'])
}
stage('Analytics') {
parallel Coverage: {
// Generate Code Coverage report
sh '/usr/local/bin/slather coverage --jenkins --html --scheme TimeTable TimeTable.xcodeproj/'
// Publish coverage results
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: 'html', reportFiles: 'index.html', reportName: 'Coverage Report'])
}, Checkstyle: {
// Generate Checkstyle report
sh '/usr/local/bin/swiftlint lint --reporter checkstyle > checkstyle.xml || true'
// Publish checkstyle result
step([$class: 'CheckStylePublisher', canComputeNew: false, defaultEncoding: '', healthy: '', pattern: 'checkstyle.xml', unHealthy: ''])
}, failFast: true|false
}
stage ('Notify') {
// Send slack notification
slackSend channel: '#my-team', message: 'Time Table - Successfully', teamDomain: 'my-team', token: 'my-token'
}
}
Modified text is an extract of the original Stack Overflow Documentation
ライセンスを受けた CC BY-SA 3.0
所属していない Stack Overflow