수색…


소개

이제 iOS 10에서 프로젝트에 대한 Jenkins 2.0 코드로 Continuous Integration 및 Continuous Delivery ( CI / CD ) 프로세스를 정의 할 수 있습니다. 빌드, 테스트, 코드 적용 범위, 스타일 확인, 보고서 및 알림 같은 활동은 하나만 파일.

기사 전체를 읽으려면 Jenkins 2.0의 Pipeline으로 iOS 10 및 XCode 8 용 코드로 이동하십시오.

매개 변수

매개 변수 세부
노드 ( 'iOS 노드') Mac OS 젠킨스 노드. 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