-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
192 lines (184 loc) · 5.97 KB
/
.gitlab-ci.yml
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
stages:
- test
- test-downstream
- deploy
variables:
IMPACT_PROJECT_ID: 89
ubuntu18-test:
stage: test
rules:
- if: '$CI_PIPELINE_SOURCE == "push"'
image: ilrocstar/calculix-test-ubuntu18:v1
script:
- mkdir build
- cd build
- >
cmake ..
-DCMAKE_INSTALL_PREFIX=../install
-DCMAKE_BUILD_TYPE=Release
-DBUILD_SHARED_LIBS=ON
-DENABLE_TESTING=ON
-DENABLE_PAR=ON
-DENABLE_CSC=ON
-DENABLE_CFD_SUPPORT=ON
-DMPI_CXX_COMPILER=/usr/bin/mpicxx.openmpi
-DMPIEXEC_EXECUTABLE=/usr/bin/mpiexec.openmpi
- make -j$(nproc)
- make install
- ctest --output-on-failure
- cpack -G DEB
artifacts:
paths:
- "build/*.deb"
centos7-test:
stage: test
rules:
- if: '$CI_PIPELINE_SOURCE == "push"'
image: ilrocstar/calculix-test-centos7:v1
script:
- mkdir build
- cd build
- >
cmake3 ..
-DCMAKE_INSTALL_PREFIX=../install
-DCMAKE_BUILD_TYPE=Release
-DBUILD_SHARED_LIBS=ON
-DENABLE_TESTING=ON
-DENABLE_PAR=ON
-DENABLE_CSC=ON
-DENABLE_CFD_SUPPORT=ON
-DMPI_CXX_COMPILER=/usr/lib64/openmpi/bin/mpicxx
-DMPIEXEC_EXECUTABLE=/usr/lib64/openmpi/bin/mpiexec
-DBOOST_INCLUDEDIR=/usr/include/boost169
-DBOOST_LIBRARYDIR=/usr/lib64/boost169
- make -j$(nproc)
- make install
- ctest3 --output-on-failure
- cpack3 -G RPM
artifacts:
paths:
- "build/*.rpm"
build-latest-centos7:
stage: test
rules:
- if: '$CI_COMMIT_REF_NAME == "ALF_test_mpp"'
image: ilrocstar/rocstar-fsi-test-centos7:v1
script:
- >
curl --insecure --header "PRIVATE-TOKEN: $IMPACT_TOKEN"
$CI_API_V4_URL/projects/$IMPACT_PROJECT_ID/pipelines?order_by=updated_at
> impact_pipelines.json
- >
if [[ -z $IMPACT_PIPELINE_ID ]]; then
export IMPACT_PIPELINE_ID=$(cat impact_pipelines.json | python3 -c "import json, sys;print(json.load(sys.stdin)[0]['id'])")
fi
- echo $IMPACT_PIPELINE_ID
- >
curl --insecure --header "PRIVATE-TOKEN: $IMPACT_TOKEN"
$CI_API_V4_URL/projects/$IMPACT_PROJECT_ID/pipelines/$IMPACT_PIPELINE_ID/jobs
> impact_jobs.json
- export IMPACT_centos7_JOB_ID=$(cat impact_jobs.json | python3 -c "import json, sys; print([entry for entry in json.load(sys.stdin) if entry['name'] == 'test:centos7'][0]['id'])")
- echo $IMPACT_centos7_JOB_ID
- mkdir upstream_rpms
- >
curl --output upstream_rpms/artifacts.zip --insecure --header "PRIVATE-TOKEN: $IMPACT_TOKEN"
$CI_API_V4_URL/projects/$IMPACT_PROJECT_ID/jobs/$IMPACT_centos7_JOB_ID/artifacts
- unzip upstream_rpms/artifacts.zip -d upstream_rpms
- sudo yum -y install ./upstream_rpms/build/*.rpm
- mkdir build
- cd build
- >
cmake3 ..
-DCMAKE_BUILD_TYPE=Release
-DBUILD_SHARED_LIBS=ON
-DENABLE_TESTING=OFF
-DENABLE_PAR=ON
-DENABLE_CSC=ON
-DENABLE_CFD_SUPPORT=ON
-DMPI_CXX_COMPILER=/usr/lib64/openmpi/bin/mpicxx
-DMPIEXEC_EXECUTABLE=/usr/lib64/openmpi/bin/mpiexec
-DBOOST_INCLUDEDIR=/usr/include/boost169
-DBOOST_LIBRARYDIR=/usr/lib64/boost169
- make -j$(nproc)
- cpack3 -G RPM
artifacts:
paths:
- "build/*.rpm"
build-latest-ubuntu18:
stage: test
rules:
- if: '$CI_COMMIT_REF_NAME == "ALF_test_mpp"'
image: ilrocstar/rocstar-fsi-test-ubuntu18:v1
script:
- >
curl --insecure --header "PRIVATE-TOKEN: $IMPACT_TOKEN"
$CI_API_V4_URL/projects/$IMPACT_PROJECT_ID/pipelines?order_by=updated_at
> impact_pipelines.json
- >
if [[ -z $IMPACT_PIPELINE_ID ]]; then
export IMPACT_PIPELINE_ID=$(cat impact_pipelines.json | python3 -c "import json, sys;print(json.load(sys.stdin)[0]['id'])")
fi
- echo $IMPACT_PIPELINE_ID
- >
curl --insecure --header "PRIVATE-TOKEN: $IMPACT_TOKEN"
$CI_API_V4_URL/projects/$IMPACT_PROJECT_ID/pipelines/$IMPACT_PIPELINE_ID/jobs
> impact_jobs.json
- export IMPACT_ubuntu18_JOB_ID=$(cat impact_jobs.json | python3 -c "import json, sys; print([entry for entry in json.load(sys.stdin) if entry['name'] == 'test:ubuntu18'][0]['id'])")
- echo $IMPACT_ubuntu18_JOB_ID
- mkdir upstream_debs
- >
curl --output upstream_debs/artifacts.zip --insecure --header "PRIVATE-TOKEN: $IMPACT_TOKEN"
$CI_API_V4_URL/projects/$IMPACT_PROJECT_ID/jobs/$IMPACT_ubuntu18_JOB_ID/artifacts
- unzip upstream_debs/artifacts.zip -d upstream_debs
- sudo apt -y install ./upstream_debs/build/*.deb
- mkdir build
- cd build
- >
cmake ..
-DCMAKE_BUILD_TYPE=Release
-DBUILD_SHARED_LIBS=ON
-DENABLE_TESTING=OFF
-DENABLE_PAR=ON
-DENABLE_CSC=ON
-DENABLE_CFD_SUPPORT=ON
-DMPI_CXX_COMPILER=/usr/bin/mpicxx.openmpi
-DMPIEXEC_EXECUTABLE=/usr/bin/mpiexec.openmpi
- make -j$(nproc)
- cpack -G DEB
artifacts:
paths:
- "build/*.deb"
trigger-rocstar-fsi:
stage: test-downstream
rules:
- if: '$CI_PIPELINE_SOURCE == "pipeline" || $CI_PIPELINE_SOURCE == "triggered"' # redundant, but left for clarity
when: never
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == "ALF_test_mpp"'
variables:
CALCULIX_CSC_PIPELINE_ID: $CI_PIPELINE_ID
needs:
- build-latest-centos7
- build-latest-ubuntu18
trigger:
project: rocstar_modern/rocstar-fsi-test
branch: ALF_test_mpp
strategy: depend
deploy-all:
stage: deploy
rules:
- if: '$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_REF_NAME == "master"'
script:
- apt-get install -y openssh-client
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
##
## Create the SSH directory and give it the right permissions
##
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- scp -r build/*.deb [email protected]:/home/nemosys/repo
- scp -r build/*.rpm [email protected]:/home/nemosys/rpmrepo
dependencies:
- ubuntu18-test
- centos7-test