summaryrefslogtreecommitdiffstats
path: root/Jenkinsfile
blob: b31e9ea858b03085c2994e4bead1549af6267d84 (plain)
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
import jenkins.model.*
import hudson.model.Result

def REPO = 'ssh://gerrit1.techsat.local:29418/external/Qt'

properties([
    parameters([
        gitParameter(branch: '',
                     branchFilter: 'origin/(.*)',
                     defaultValue: 'master',
                     description: '',
                     name: 'BRANCH',
                     quickFilterEnabled: false,
                     selectedValue: 'NONE',
                     sortMode: 'NONE',
                     tagFilter: '*',
                     type: 'PT_BRANCH_TAG')
    ])
])

stage('Build') {
    parallel linux: {
        node('bslp02-centos6-64') {
	    deleteDir()
	    checkout([$class: 'GitSCM', 
		    branches: [[name: BRANCH]], 
		    doGenerateSubmoduleConfigurations: false, 
		    extensions: [], 
		    submoduleCfg: [], 
		    userRemoteConfigs: [[url: REPO]]])

	    stage("Linux 32 Bit Build") {
		sh '''#!/bin/bash
		GCC_PATH=/master/DEV-Tools/gcc-suite/1.2.0-125/x86-linux/gcc-8.2.0 make -f Makefile.x86-linux
		'''
	    }
	    stage("Linux 64 Bit Build") {
		sh '''#!/bin/bash
		GCC_PATH=/master/DEV-Tools/gcc-suite/1.2.0-125/x86-linux64/gcc-8.2.0 make
		'''
	    }


        }
    },
    windows: {
        node('bslp05-win10-64') {
            try {
        	    deleteDir()
        	    checkout([$class: 'GitSCM', 
        		    branches: [[name: BRANCH]], 
        		    doGenerateSubmoduleConfigurations: false, 
        		    extensions: [], 
        		    submoduleCfg: [], 
        		    userRemoteConfigs: [[url: REPO]]])

		    stage ("Windows 32 Bit Build") {
			bat '''@echo off
			    set SDKDIR=C:\\dev-tools\\WinSDK\\VS2019BT\\
			    set NASMDIR=C:\\dev-tools\\nasm\\2.12.01_32\\
			    set MSYSDIR=C:\\dev-tools\\msys\\x86\\
			    set PERLDIR=C:\\dev-tools\\perl\\x86_64-msvc\\
			    set PATH=%PATH%;C:\\dev-tools\\Python\\2.7\\x86-windows\\
			    buildqt32.bat
			'''
		    }
        	    
        	    bat '''
            		set MSYSDIR=C:\\dev-tools\\msys\\x86
			set PATH=%MSYSDIR%\\usr\\bin;%PATH%
			sh.exe -c "rm -f openssl-1.0.2r/NUL"
			sh.exe -c "rm -Rf openssl-1.0.2r*"
        	    '''
		    stage ("Windows 64 Bit Build") {
			bat '''@echo off
			    set SDKDIR=C:\\dev-tools\\WinSDK\\VS2019BT\\
			    set NASMDIR=C:\\dev-tools\\nasm\\2.12.01_64
			    set MSYSDIR=C:\\dev-tools\\msys\\x86\\
			    set PERLDIR=C:\\dev-tools\\perl\\x86_64-msvc\\
			    set PATH=%PATH%;C:\\dev-tools\\Python\\2.7\\x86-windows\\
			    buildqt64.bat
			'''
		    }
		    stash name: "qtwin", includes: "*-msvc.zip"
            } catch (e) {
                echo 'Windows build failed'
		setBuildResult('FAILURE')
            } finally {
        	    bat '''
            		set PATH=C:\\dev-tools\\msys\\x86\\usr\\bin;%PATH%
            		cd %WORKSPACE%\\openssl-1.0.2r
            		sh.exe -c "rm -f NUL"
            		cd %WORKSPACE%
        	    '''
        	    deleteDir()
            }
        }
    }
}
stage ("Post processing") {
    node('bslp02-centos6-64') {
	unstash name: 'qtwin'
	sh '''
	    QT_VER=5.12.3
	    #
	    # remove temporary folder ...
	    rm -Rf $WORKSPACE/tmp
	    BASE_PATH=$WORKSPACE/tmp/$QT_VER/x86-msvc
	    mkdir -p $BASE_PATH
	    unzip -o $WORKSPACE/qt-$QT_VER-x86-msvc.zip -d $BASE_PATH
	    rm -f $WORKSPACE/qt-$QT_VER-x86-msvc.zip
	    make GCC_PATH=/master/DEV-Tools/gcc-suite/1.2.0-125/x86-linux/xgcc-8.2.0-mingw DLL_DIR=$BASE_PATH/bin XPREFIX=i686-w64-mingw32- LIBDIR=$BASE_PATH/lib dll2a
	    BASE_PATH=$WORKSPACE/tmp/$QT_VER/x86_64-msvc
	    mkdir -p $BASE_PATH
	    unzip -o $WORKSPACE/qt-$QT_VER-x86_64-msvc.zip -d $BASE_PATH
	    rm -f $WORKSPACE/qt-$QT_VER-x86_64-msvc.zip 
	    make GCC_PATH=/master/DEV-Tools/gcc-suite/1.2.0-125/x86-linux64/xgcc-8.2.0-mingw DLL_DIR=$BASE_PATH/bin XPREFIX=x86_64-w64-mingw32- LIBDIR=$BASE_PATH/lib dll2a
	    # 
	    # cleanup temporary destination folder for final distribution ...
	    rm -Rf $WORKSPACE/INST
	    # 
	    # unpack Linux archives ...
	    mkdir -p $WORKSPACE/INST/$QT_VER/x86-linux
	    tar -xzf $WORKSPACE/qt-$QT_VER-x86-linux.tgz -C $WORKSPACE/INST/$QT_VER/x86-linux
	    rm -f $WORKSPACE/qt-$QT_VER-x86-linux.tgz 
	    mkdir -p $WORKSPACE/INST/$QT_VER/x86-linux64
	    tar -xzf $WORKSPACE/qt-$QT_VER-x86-linux64.tgz -C $WORKSPACE/INST/$QT_VER/x86-linux64
	    rm -f $WORKSPACE/qt-$QT_VER-x86-linux64.tgz
	    mv $WORKSPACE/tmp/$QT_VER/* $WORKSPACE/INST/$QT_VER/
	    cd $WORKSPACE/INST && ln -s x86_64-msvc x86-mingw64
	    cd $WORKSPACE/INST && ln -s x86-msvc x86-mingw32
	    # 
	    # remove temporary folder ...
	    rm -Rf $WORKSPACE/tmp
	    # 
	    # finally create the whole archive ...
	    cd $WORKSPACE/INST && tar -zcf $WORKSPACE/qt-$QT_VER-bin.tgz ./
	    rm -Rf $WORKSPACE/INST
	'''
	archiveArtifacts artifacts: 'qt-5.12.3-bin.tgz'
    }
}