Newer
Older
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
# A pipeline is composed of independent jobs that run scripts, grouped into stages.
# Stages run in sequential order, but jobs within stages run in parallel.
#
# For more information, see: https://docs.gitlab.com/ee/ci/yaml/index.html#stages
#
# To contribute improvements to CI/CD templates, please follow the Development guide at:
# https://docs.gitlab.com/ee/development/cicd/templates.html
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Getting-Started.gitlab-ci.yml
before_script:
#git checkout "$CI_COMMIT_REF_NAME"
- git status
variables:
TARBALL: /home/gitlab-runner/${CI_PROJECT_NAME}-${CI_COMMIT_BRANCH}.pax
TARBALL_EXTRA: /home/gitlab-runner/${CI_PROJECT_NAME}-${CI_COMMIT_BRANCH}.ST11xM.pax
stages: # List of stages for jobs, and their order of execution
- build
- test
- deploy
- release
build-job: # This job runs in the build stage, which runs first.
stage: build
tags:
- build
script:
- echo "Build gcobol in focal-amd64 chroot..."
- touch $TARBALL
- rm -v $TARBALL
- printf "Compiling the code \nfrom\t%s \nto\t%s\n" $PWD $PWD/build
- schroot -c focal-amd64 --
gcc/cobol/scripts/release-configure-build 'commit-release' -s -j12
- find build -name gcobol -or -name cobol1 -or -name libgcobol.so
- pax -x cpio -wf $TARBALL build
- ls -i $TARBALL
- ls -l $TARBALL
- md5sum $TARBALL
- echo "Compile complete."
build-arm: # This job runs in the build stage, which runs first.
stage: build
tags:
- arm
script:
- printf "NOT Compiling the code \nfrom\t%s \nto\t%s\n" $PWD $PWD/build
- echo gcc/cobol/scripts/release-configure-build -s -j12
- echo find build -name gcobol -or -name cobol1 -or -name libgcobol.so
- echo pax -x cpio -wf $TARBALL build
- echo "Compile complete."
local-test-job: # This job runs in the test stage.
stage: test # It only starts when the job in the build stage completes successfully.
tags:
- test
script:
- md5sum $TARBALL
- test -r build || pax -rf $TARBALL
- echo "Local tests in focal-amd64 chroot..."
- schroot -c focal-amd64 --
local-test-arm:
stage: test
tags:
- arm
script:
- echo test -r build || pax -rf $TARBALL
- echo make -s -j4 -C gcc/cobol/tests test
nist-test-job: # This job runs in the test stage.
stage: test # It only starts when the job in the build stage completes successfully.
tags:
- test
script:
- md5sum $TARBALL
- test -r build || pax -rf $TARBALL
- echo "NIST test in focal-amd64 chroot..."
- schroot -c focal-amd64 --
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
artifacts:
paths:
- gcc/cobol/nist/ST/ST112M
- gcc/cobol/nist/ST/ST112M-reel-1
- gcc/cobol/nist/ST/ST112M.cbl
- gcc/cobol/nist/ST/ST112M.conf
- gcc/cobol/nist/ST/ST112M.out
- gcc/cobol/nist/ST/ST112M.rpt
- gcc/cobol/nist/ST/ST113M
- gcc/cobol/nist/ST/ST113M-file-srt-1
- gcc/cobol/nist/ST/ST113M-tape-1
- gcc/cobol/nist/ST/ST113M.cbl
- gcc/cobol/nist/ST/ST113M.conf
- gcc/cobol/nist/ST/ST113M.out
- gcc/cobol/nist/ST/ST114M
- gcc/cobol/nist/ST/ST114M.cbl
- gcc/cobol/nist/ST/ST114M.conf
- gcc/cobol/nist/ST/ST114M.out
- gcc/cobol/nist/ST/ST114M.rpt
nist-test-arm: # This job runs in the test stage.
stage: test # It only starts when the job in the build stage completes successfully.
tags:
- arm
script:
- echo test -r build || pax -rf $TARBALL
- echo make -s -C gcc/cobol/nist report
uat-test-job:
stage: test
tags:
- test
script:
- md5sum $TARBALL
- test -r build/gcc/gcobol || pax -rf $TARBALL
- echo "User Acceptance Tests in focal-amd64 chroot..."
- export GCOBOL_BUILD_DIR=$PWD/build
- status=0
- schroot -p -c focal-amd64 --
/usr/bin/make -j12 -C gcc/cobol/UAT test || status=$?
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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
- |
if [ $status -ne 0 ]
then
echo 'Filtered Log:'
log=gcobol-tests/testsuite.log
awk 'NR==1,/Running/ { if (/Running/) {print}; next } / ok / {next} 1' $log
echo 'Failed'
exit $status
fi
- echo "Done."
#
# Deploy packages to gitlab "releases" page
#
deploy-job: # This job runs in the deploy stage.
stage: deploy # It only runs when *both* jobs in the test stage complete successfully.
environment: production
tags:
- general
script:
- echo "Packaging in focal-amd64 chroot..."
- test -r build || pax -rf $TARBALL
- find build -name gcobol -or -name cobol1 -or -name libgcobol.so
- schroot -c focal-amd64 --
/usr/bin/make -f $HOME/Makefile.pkg packages publish
CI_JOB_TOKEN=$CI_JOB_TOKEN
CI_API_V4_URL=${CI_API_V4_URL}
BRANCH=$CI_COMMIT_BRANCH
ID=${CI_PROJECT_ID}
REPOSITORY=$PWD
BUILDDIR=$PWD/build
PREFIX=$HOME/stage
PACKAGE_NAME=gcobol PACKAGE_VERSION=dev
- echo "Done."
deploy-arm: # This job runs in the deploy stage.
stage: deploy # It only runs when *both* jobs in the test stage complete successfully.
environment: qa
tags:
- arm
script:
- echo "Deploying application..."
- echo "Application successfully deployed."
release_commit_x86:
stage: release
tags:
- general
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG
when: never # Do not run this job when a tag is created manually
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH # Job runs when commits are pushed or merged to the default branch
script:
- echo "running release_job for $TAG" in $PWD
- echo "tag_name= 'v0.$CI_PIPELINE_IID'"
- echo "description= 'v0.$CI_PIPELINE_IID'"
- echo "ref= '$CI_COMMIT_SHA'" # The tag is created from the pipeline SHA.
release: # See https://docs.gitlab.com/ee/ci/yaml/#release for available properies
tag_name: 'v0.$CI_PIPELINE_IID' # The version is incremented per pipeline.
description: 'v0.$CI_PIPELINE_IID'
ref: '$CI_COMMIT_SHA' # The tag is created from the pipeline SHA.
#
# Tagged releases
#
tag_release_x86:
stage: release
tags:
- general
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG # Run this job when a tag is created
script:
- echo "running release_job"
release: # See https://docs.gitlab.com/ee/ci/yaml/#release for available properties
tag_name: '$CI_COMMIT_TAG'
description: '$CI_COMMIT_TAG'
tag_release_arm:
stage: release
tags:
- arm
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG # Run this job when a tag is created
script:
- echo "running release_job"
release:
tag_name: '$CI_COMMIT_TAG'
description: '$CI_COMMIT_TAG'