File: Jenkinsfile

package info (click to toggle)
colobot 0.2.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 415,532 kB
  • sloc: cpp: 129,246; ansic: 8,872; python: 2,158; sh: 672; awk: 91; xml: 35; makefile: 31
file content (40 lines) | stat: -rw-r--r-- 1,205 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env groovy

pipeline {
    agent { label 'colobot-build' }
    options {
        buildDiscarder(logRotator(artifactDaysToKeepStr: '30', artifactNumToKeepStr: '5'))
    }
    stages {
        stage('Check pull request target') {
            when { changeRequest() }
            steps {
                script {
                    if (env.CHANGE_TARGET == 'master') {
                        throw "This pull request targets the wrong branch. Please reopen the pull request targetting the dev branch."
                    }
                }
            }
        }
        stage('Build data') {
            steps {
                sh 'mkdir -p build'
                dir('build') {
                    sh '''
                        cmake -DCMAKE_INSTALL_PREFIX=/install -DCOLOBOT_INSTALL_DATA_DIR=/install/data ..
                        make
                        rm -rf install
                        DESTDIR=. make install
                    '''
                }
            }
        }

        stage('Archive data') {
            steps {
                sh 'rm -f data.zip'
                zip zipFile: 'data.zip', archive: true, dir: 'build/install'
            }
        }
    }
}