-
Notifications
You must be signed in to change notification settings - Fork 8
/
.gitlab-ci.yml
1070 lines (977 loc) · 41 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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#########
## STAGES
#########
# Default Gitlab stages are : build, test, deploy
# The custom stage `check` is added for merge requests (see job merge-request:check)
stages:
- check
- build
- test
- deploy
- release
########################
##GLOBAL VARIABLES
########################
variables:
###### COMMON CONFIGS ######
# GIT CONFIG
GIT_DEPTH: 5
GIT_OPTIONS: "--allow-unrelated-histories"
## BUILD CONFIGS ##
# MAVEN CONFIG
# As of Maven 3.3.0 instead of this you may define these options in `.mvn/maven.config` so the same config is used
# when running from the command line.
# @see : https://books.sonatype.com/mvnref-book/reference/running-sect-options.html
# --batch-mode Run in non-interactive (batch) mode
# --show-version : Display version information WITHOUT stopping build
# -c : lax checksums
MAVEN_CLI_OPTS: "--batch-mode --show-version -c"
MAVEN_CACHE_FOLDER: "$CI_PROJECT_DIR/.m2/repository"
MAVEN_OPTS: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=WARN -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
MAVEN_OPTS_SCHUEDULES: "-Dhttps.protocols=TLSv1.2 -Dmaven.repo.local=$CI_PROJECT_DIR/.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=ERROR -Dorg.slf4j.simpleLogger.defaultLogLevel=error -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
MAVEN_SKIP_TESTS: "false"
# DEFAULT SERVER MAVEN VERSION
MVN_VERSION: 3.8.6
# DEFAULT SERVER JAVA VERSION
JAVA_VERSION: 11
## DEPLOY CONFIGS ##
# REMOTE SERVER CONFIG
RSYNC_INSTANCES_OPTIONS: "--progress --delete"
RSYNC_INSTANCES_BIN_PATH: "~/opensilex-instances/bin"
RSYNC_INSTANCES_DATA_PATH: "~/opensilex-instances/data"
RSYNC_INSTANCES_LOGS_PATH: "~/opensilex-instances/logs"
RSYNC_INSTANCES_LOGS_ARCHIVED: "~/opensilex-instances/logs/old"
###### OPENSILEX ######
#APP BUILD CONFIG
#OPENSILEX_APP_REVISION: "1.0.0.rc1-SNAPSHOT"
OPENSILEX_BUILD_PATH: "opensilex-release/target"
#APP DEPLOY CONFIG
DEV_TOOLS_REPO_CONF_FILES_PATH: "instances-configuration"
OPENSILEX_STOP_SERVER_OPTS: "server stop --CONFIG_FILE=$INSTANCE_CONFIGURATION_FILE_NAME"
OPENSILEX_START_SERVER_OPTS: "server start --CONFIG_FILE=$INSTANCE_CONFIGURATION_FILE_NAME --DEBUG -d"
OPENSILEX_RESET_ONTOLOGIES_OPTS: "sparql reset-ontologies --DEBUG"
OPENSILEX_CONFIG_SERVER_OPTS: "--CONFIG_FILE=$INSTANCE_CONFIGURATION_FILE_NAME"
OPENSILEX_JAVA_EXEC_OPTS: java -jar
# This will supress any download for dependencies and plugins or upload messages which would clutter the console log.
# `showDateTime` will show the passed time in milliseconds. You need to specify `--batch-mode` to make this work.
#CACHE
YARN_CACHE_FOLDER: "$CI_PROJECT_DIR/cache_yarn"
NODE_CACHE: "$CI_PROJECT_DIR/.node"
#EMBDED_MONGO_CACHE: "/root/.embedmongo/"
# Prevent gitlab clone issues
GITLAB_HTTPS: "false"
########################
## CACHE TEMPLATE
########################
# Cache downloaded dependencies and plugins between builds.
# To keep cache across branches add 'key: "$CI_BUILD_JOB_NAME"'
.cache_dependencies: &cache_dependencies
cache:
key: "${CI_JOB_NAME}-${CI_COMMIT_REF_SLUG}"
paths:
- $YARN_CACHE_FOLDER
- $MAVEN_CACHE_FOLDER
########################
## BUILD TEMPLATE
########################
.build:instance: &build_template_with_opensilex
<<: *cache_dependencies
before_script:
- if [ -z "$OPENSILEX_BUILD_PATH" ]; then echo "Missing OPENSILEX_BUILD_PATH variable"; exit 1; fi
- if [ -z "$OPENSILEX_APP_REVISION" ]; then echo "Missing OPENSILEX_APP_REVISION variable"; exit 1; fi
- |
if [ ! -z "$COMMIT_SHA_OPENSILEX_DEV" ]; then
git checkout $COMMIT_SHA_OPENSILEX_DEV
fi
stage: build
image: maven:$MVN_VERSION-jdk-$JAVA_VERSION
script:
- mvn clean install $MAVEN_CLI_OPTS -Drevision=$OPENSILEX_APP_REVISION -DskipTests=$MAVEN_SKIP_TESTS
- ls $OPENSILEX_BUILD_PATH/opensilex-release-$OPENSILEX_APP_REVISION
- if [ -d "artifacts" ]; then rm -r artifacts; fi
- mkdir artifacts
- mv $OPENSILEX_BUILD_PATH/opensilex-release-$OPENSILEX_APP_REVISION artifacts/$OPENSILEX_APP_REVISION
artifacts:
paths:
- artifacts
expire_in: "3 week"
########################
## DEPLOY SSH CONFIGURATION TEMPLATE
########################
.deploy_opensilex_before_script: &deploy_opensilex_before_script
before_script:
# test variables before deployement
- if [ -z "$REMOTE_SERVER_RSYNC_ACCOUNT" ]; then echo "Missing REMOTE_SERVER_RSYNC_ACCOUNT variable"; exit 1; fi
- if [ -z "$REMOTE_SERVER_RSYNC_DIR" ]; then echo "Missing REMOTE_SERVER_RSYNC_DIR variable"; exit 1; fi
- if [ -z "$REMOTE_SERVER_IP" ]; then echo "Missing REMOTE_SERVER_IP variable"; exit 1; fi
- if [ -z "$CONFIGS_FILES_DIR_PATH" ]; then echo "Missing CONFIGS_FILES_DIR_PATH variable"; exit 1; fi
- if [ -z "$INSTANCE_CONFIGURATION_FILE_NAME" ]; then echo "Missing INSTANCE_CONFIGURATION_FILE_NAME variable"; exit 1; fi
- if [ -z "$REMOTE_SERVER_SSH_KEY" ]; then echo "Missing REMOTE_SERVER_SSH_KEY variable"; exit 1; fi
- if [ -z "$OPENSILEX_JAR_ADMIN_PORT" ]; then echo "Missing OPENSILEX_JAR_ADMIN_PORT variable"; exit 1; fi
- if [ -z "$OPENSILEX_JAR_PORT" ]; then echo "Missing OPENSILEX_JAR_PORT variable"; exit 1; fi
##
## Create the SSH directory and give it the right permissions
##
- echo "$REMOTE_SERVER_IP"
- mkdir -p ${HOME}/.ssh
- chmod 700 ${HOME}/.ssh
##
## Install ssh-agent if not already installed, it is required by Docker.
## (change apt-get to yum if you use an RPM-based image)
##
- "which ssh-agent || ( apt-get update && apt-get install openssh-client -y )"
##
## Run ssh-agent (inside the build environment)
##
- eval $(ssh-agent -s)
##
## Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store
## We're using tr to fix line endings which makes ed25519 keys work
## without extra base64 encoding.
## https://gitlab.com/gitlab-examples/ssh-private-key/issues/1#note_48526556
##
- mkdir -p ${HOME}/.ssh && touch ${HOME}/.ssh/known_hosts
- ssh-keyscan -H "$REMOTE_SERVER_IP" >> ${HOME}/.ssh/known_hosts
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ${HOME}/.ssh/config
- echo "$REMOTE_SERVER_SSH_KEY" >> ${HOME}/.ssh/id_rsa
- chmod 600 ${HOME}/.ssh/id_rsa
##################################
## DEPLOY OPENSILEX TEST TEMPLATE
##################################
.deploy:opensilex:instance: &deploy_opensilex_template
stage: deploy
image: instrumentisto/rsync-ssh
script:
- apk add curl git
# - If there is no release branch, then develop is deployed
# - Otherwise, nothing is deployed
- |
if git ls-remote --exit-code --heads origin release && [[ "$CI_COMMIT_BRANCH" == "develop" ]]; then
echo 'Branch release exists, cannot deploy develop';
exit 0;
fi
- rm -R $CI_PROJECT_DIR/opensilex-dev-tools
- git clone https://gitlab-ci-token:${CI_JOB_TOKEN}@forgemia.inra.fr/OpenSILEX/opensilex-dev-tools.git --branch master $CI_PROJECT_DIR/opensilex-dev-tools
- ls $CI_PROJECT_DIR/opensilex-dev-tools
# Directory details
- ls $CI_PROJECT_DIR/artifacts/$OPENSILEX_APP_REVISION
- echo "Create directory ${RSYNC_INSTANCES_BIN_PATH}/${REMOTE_SERVER_RSYNC_DIR}"
- echo "Create directory ${RSYNC_INSTANCES_DATA_PATH}/${REMOTE_SERVER_RSYNC_DIR}"
- echo "Create directory ${RSYNC_INSTANCES_LOGS_PATH}"
- echo "Create directory ${RSYNC_INSTANCES_LOGS_ARCHIVED}"
- ssh -i ${HOME}/.ssh/id_rsa -p22 $REMOTE_SERVER_RSYNC_ACCOUNT@$REMOTE_SERVER_IP "mkdir -p $RSYNC_INSTANCES_BIN_PATH/$REMOTE_SERVER_RSYNC_DIR; mkdir -p $RSYNC_INSTANCES_LOGS_PATH; mkdir -p $RSYNC_INSTANCES_LOGS_ARCHIVED; mkdir -p $RSYNC_INSTANCES_DATA_PATH/$REMOTE_SERVER_RSYNC_DIR;"
- echo "Upload files"
- rsync -arzv -e "ssh -i ${HOME}/.ssh/id_rsa" $RSYNC_INSTANCES_OPTIONS $CI_PROJECT_DIR/artifacts/$OPENSILEX_APP_REVISION/* $REMOTE_SERVER_RSYNC_ACCOUNT@$REMOTE_SERVER_IP:$RSYNC_INSTANCES_BIN_PATH/$REMOTE_SERVER_RSYNC_DIR
- ls $CI_PROJECT_DIR/opensilex-dev-tools/$CONFIGS_FILES_DIR_PATH
- echo "scp -i ${HOME}/.ssh/id_rsa -o 'StrictHostKeyChecking no' $CI_PROJECT_DIR/opensilex-dev-tools/$CONFIGS_FILES_DIR_PATH/* ${REMOTE_SERVER_RSYNC_ACCOUNT}@${REMOTE_SERVER_IP}:${RSYNC_INSTANCES_BIN_PATH}/${REMOTE_SERVER_RSYNC_DIR}"
- scp -i ${HOME}/.ssh/id_rsa -o "StrictHostKeyChecking no" $CI_PROJECT_DIR/opensilex-dev-tools/$CONFIGS_FILES_DIR_PATH/* $REMOTE_SERVER_RSYNC_ACCOUNT@$REMOTE_SERVER_IP:$RSYNC_INSTANCES_BIN_PATH/$REMOTE_SERVER_RSYNC_DIR
- echo "Remove dependencies list cache"
- ssh -i ${HOME}/.ssh/id_rsa -p22 $REMOTE_SERVER_RSYNC_ACCOUNT@$REMOTE_SERVER_IP "rm -f ${RSYNC_INSTANCES_BIN_PATH}/${REMOTE_SERVER_RSYNC_DIR}/.opensilex.dependencies"
- echo "Check files"
- echo ssh -i ${HOME}/.ssh/id_rsa -p22 $REMOTE_SERVER_RSYNC_ACCOUNT@$REMOTE_SERVER_IP "ls ${RSYNC_INSTANCES_BIN_PATH}/${REMOTE_SERVER_RSYNC_DIR};"
- ssh -i ${HOME}/.ssh/id_rsa -p22 $REMOTE_SERVER_RSYNC_ACCOUNT@$REMOTE_SERVER_IP "ls ${RSYNC_INSTANCES_BIN_PATH}/${REMOTE_SERVER_RSYNC_DIR};"
- |
if [[ "$RESET_ONTOLOGIES" == "true" ]]; then
echo "Reset ontologies ${OPENSILEX_JAVA_EXEC_OPTS} ${RSYNC_INSTANCES_BIN_PATH}/${REMOTE_SERVER_RSYNC_DIR}/opensilex.jar ${OPENSILEX_CONFIG_SERVER_OPTS} ${OPENSILEX_RESET_ONTOLOGIES_OPTS}";
ssh -i ${HOME}/.ssh/id_rsa -p22 $REMOTE_SERVER_RSYNC_ACCOUNT@$REMOTE_SERVER_IP "cd ${RSYNC_INSTANCES_BIN_PATH}/${REMOTE_SERVER_RSYNC_DIR}; ${OPENSILEX_JAVA_EXEC_OPTS} opensilex.jar ${OPENSILEX_CONFIG_SERVER_OPTS} ${OPENSILEX_RESET_ONTOLOGIES_OPTS}";
fi
- echo "Restart server ${OPENSILEX_JAVA_EXEC_OPTS} ${RSYNC_INSTANCES_BIN_PATH}/$REMOTE_SERVER_RSYNC_DIR/opensilex.jar"
- echo "Stop with options --adminPort=$OPENSILEX_JAR_ADMIN_PORT --host=$REMOTE_SERVER_IP ${OPENSILEX_STOP_SERVER_OPTS}"
- ssh -i ${HOME}/.ssh/id_rsa -p22 $REMOTE_SERVER_RSYNC_ACCOUNT@$REMOTE_SERVER_IP "cd ${RSYNC_INSTANCES_BIN_PATH}/${REMOTE_SERVER_RSYNC_DIR}; ${OPENSILEX_JAVA_EXEC_OPTS} opensilex.jar ${OPENSILEX_STOP_SERVER_OPTS} --adminPort=$OPENSILEX_JAR_ADMIN_PORT --host=$REMOTE_SERVER_IP"
- echo "Start with options --adminPort=$OPENSILEX_JAR_ADMIN_PORT --port=$OPENSILEX_JAR_PORT --host=$REMOTE_SERVER_IP ${OPENSILEX_START_SERVER_OPTS}"
- ssh -i ${HOME}/.ssh/id_rsa -p22 $REMOTE_SERVER_RSYNC_ACCOUNT@$REMOTE_SERVER_IP "cd ${RSYNC_INSTANCES_BIN_PATH}/${REMOTE_SERVER_RSYNC_DIR}; ${OPENSILEX_JAVA_EXEC_OPTS} opensilex.jar ${OPENSILEX_START_SERVER_OPTS} --adminPort=$OPENSILEX_JAR_ADMIN_PORT --port=$OPENSILEX_JAR_PORT --host=$REMOTE_SERVER_IP"
- AUTOGENERATE_ENVIRONMENT_URL="$REMOTE_SERVER_IP:$OPENSILEX_JAR_PORT"
- echo "Deploy To $AUTOGENERATE_ENVIRONMENT_URL" # In script, get the environment URL.
- echo "AUTOGENERATE_ENVIRONMENT_URL=$AUTOGENERATE_ENVIRONMENT_URL" >> deploy.env
environment:
name: "$CI_COMMIT_REF_NAME-test"
url: http://$AUTOGENERATE_ENVIRONMENT_URL
artifacts:
reports:
dotenv: deploy.env
##################
### DEFAULT BUILDS
##################
opensilex-master:build:
<<: *build_template_with_opensilex
rules:
- if: $CI_COMMIT_BRANCH == "master"
opensilex-develop:build:
<<: *build_template_with_opensilex
rules:
- if: $CI_COMMIT_BRANCH == "develop"
opensilex-release:build:
<<: *build_template_with_opensilex
rules:
- if: $CI_COMMIT_BRANCH == "release"
##################################
### MERGE REQUESTS CHECK AND BUILD
##################################
# Checks that the merge request is valid. This job fails if one of these conditions is not met :
# - The MR attempts to merge a non-hotfix branch to master
# - The MR attempts to merge a non-feature branch to develop
# - The MR attempts to merge a non-feature branch to release
# - The MR title does not respect the Conventional Commit naming convention
# - The MR has no changelog entry and does not explicitly declare to ignore it
# - The MR has a changelog entry, but at the same time declares to ignore it
# Merge requests marked with the Draft: keyword are checked but subsequent jobs (like merge-request:build) will not
# be triggered.
# No pipeline is triggered for MR from the release branch, because the last release pipeline can be used instead.
#
# The base regex used for checking the Conventional Commit convention was published by @marcojahn on Github :
# https://gist.github.com/marcojahn/482410b728c31b221b70ea6d2c433f0c
# The (Draft: )? part was added at the beginning to allow draft MR to be checked.
#
# The job makes use of curl and yq (https://github.com/mikefarah/yq) to read the YAML changelog entry.
merge-request:check:
stage: check
image: alpine
script:
# yq and curl are needed for changelog retrieval
- apk update
- apk add yq curl
# check that only "hotfix/*" branches can be merged to master
- if [[ $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" &&
! $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ ^hotfix\/.* ]]; then
- echo "Merging from $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME to master is forbidden"
- echo "Only a hotfix branch can be merged into master"
- echo "To mark this merge request as a hotfix, please make the branch name begin with 'hotfix/'."
- exit 1
- fi
# check that only "feature/*" or the release branches can be merged to develop
- if [[ $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "develop" &&
! $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ ^feature\/.* ]]; then
- echo "Merging from $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME to develop is forbidden"
- echo "Only a feature branch can be merged into develop"
- echo "To mark this merge request as a feature, please make the branch name start with 'feature/'."
- exit 1
- fi
# check that only "feature/*" branches can be merged to release
- if [[ $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "release" &&
! $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME =~ ^feature\/.* ]]; then
- echo "Merging from $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME to release is forbidden"
- echo "Only a feature branch can be merged into release"
- echo "To mark this merge request as a feature, please make the branch name start with 'feature/'."
- exit 1
- fi
# check the MR title. Base regex by @marcojahn : https://gist.github.com/marcojahn/482410b728c31b221b70ea6d2c433f0c
- >-
CC_REGEX="^(Draft: )?(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([[:alnum:]._-]+\))?(!)?: ([[:alnum:]])+([[:space:][:print:]]*)"
- if [[ ! "$CI_MERGE_REQUEST_TITLE" =~ "$CC_REGEX" ]]; then
- echo 'The merge request title must respect the Conventional Commit naming convention. Please see
https://www.conventionalcommits.org/en/v1.0.0/ for more information.'
- exit 1
- fi
# query the merge request description to extract changelog and ignore-changelog fields
- export API_MR_URL="$CI_API_V4_URL/projects/$CI_MERGE_REQUEST_PROJECT_ID/merge_requests/$CI_MERGE_REQUEST_IID"
- FRONT_MATTER=$(curl -s -X GET -F "private_token=$JOB_API_TOKEN" $API_MR_URL
| yq '.description'
| yq -f extract -o json '.')
- CHANGELOG=$(echo $FRONT_MATTER | yq '.changelog // ""')
- IGNORE_CHANGELOG=$(echo $FRONT_MATTER | yq '.ignore-changelog // ""')
- echo $CHANGELOG
- echo $IGNORE_CHANGELOG
# check that the changelog entry is empty when ignore-changelog is set to true
- if [[ ${#CHANGELOG} -gt 0 && "$IGNORE_CHANGELOG" == "true" ]]; then
- echo 'Changelog description is not empty while "ignore-changelog" is set to "true". This is an
undefined behaviour ; either remove the changelog description or set "ignore-changelog" to "false" to resolve
it, then retry this job.'
- exit 1
# check that the changelog entry is not empty when ignore-changelog is not set to true
- elif [[ ${#CHANGELOG} -eq 0 && "$IGNORE_CHANGELOG" != "true" ]]; then
- echo 'Changelog description is empty while "ignore-changelog" is set to "false". Please fill the
changelog description or set "ignore-changelog" to "true", then retry this job.'
- exit 1
- fi
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME != "release"
# Builds the merge request
merge-request:build:
<<: *build_template_with_opensilex
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event' && $CI_MERGE_REQUEST_TITLE !~ /^(Draft:|\[Draft\]|\(Draft\)).*/i && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME != "release"
needs:
- job: "merge-request:check"
tags:
- stable
####################
### TEST DEPLOYMENTS
####################
# Deployment of the master branch
test:opensilex-master:deploy:
<<: *deploy_opensilex_before_script
<<: *deploy_opensilex_template
variables:
CONFIGS_FILES_DIR_PATH: "$DEV_TOOLS_REPO_CONF_FILES_PATH/mistea/master"
INSTANCE_CONFIGURATION_FILE_NAME: "phis.test.yml"
OPENSILEX_JAR_ADMIN_PORT: 4085
OPENSILEX_JAR_PORT: 8085
REMOTE_SERVER_RSYNC_ACCOUNT: "$REMOTE_PHIS_RSYNC_ACCOUNT"
REMOTE_SERVER_IP: "$REMOTE_TEST_SERVER_IP"
REMOTE_SERVER_RSYNC_DIR: "mistea/master"
REMOTE_SERVER_SSH_KEY: "$TEST_SSH_PRIVATE_KEY"
rules:
- if: $CI_COMMIT_BRANCH == "master"
when: on_success
needs:
- opensilex-master:build
# Trigger pipeline for the deployment of the develop branch
# - If there is no release branch, then develop is deployed
# - Otherwise, nothing is deployed
# see deploy_opensilex_template script
test:opensilex-develop:deploy:
<<: *deploy_opensilex_before_script
<<: *deploy_opensilex_template
variables:
CONFIGS_FILES_DIR_PATH: "$DEV_TOOLS_REPO_CONF_FILES_PATH/mistea/develop"
INSTANCE_CONFIGURATION_FILE_NAME: "phis.test.yml"
OPENSILEX_JAR_ADMIN_PORT: 4081
OPENSILEX_JAR_PORT: 8081
REMOTE_SERVER_RSYNC_ACCOUNT: "$REMOTE_PHIS_RSYNC_ACCOUNT"
REMOTE_SERVER_IP: "$REMOTE_TEST_SERVER_IP"
REMOTE_SERVER_RSYNC_DIR: "mistea/develop"
REMOTE_SERVER_SSH_KEY: "$TEST_SSH_PRIVATE_KEY"
rules:
- if: $CI_COMMIT_BRANCH == "develop"
when: on_success
needs:
- opensilex-develop:build
# Deployment of the release branch
test:opensilex-release:deploy:
<<: *deploy_opensilex_before_script
<<: *deploy_opensilex_template
variables:
CONFIGS_FILES_DIR_PATH: "$DEV_TOOLS_REPO_CONF_FILES_PATH/mistea/release"
INSTANCE_CONFIGURATION_FILE_NAME: "phis.test.yml"
OPENSILEX_JAR_ADMIN_PORT: 4081
OPENSILEX_JAR_PORT: 8081
REMOTE_SERVER_RSYNC_ACCOUNT: "$REMOTE_PHIS_RSYNC_ACCOUNT"
REMOTE_SERVER_IP: "$REMOTE_TEST_SERVER_IP"
REMOTE_SERVER_RSYNC_DIR: "mistea/release"
REMOTE_SERVER_SSH_KEY: "$TEST_SSH_PRIVATE_KEY"
rules:
- if: $CI_COMMIT_BRANCH == "release"
when: on_success
needs:
- opensilex-release:build
#################
### CLOSE RELEASE
#################
opensilex-release:close:
stage: release
image: alpine
script:
- if [[ -z $RELEASE_TAG ]]; then
- echo 'RELEASE_TAG must be set'
- exit 1
- else
- echo "Closing release $RELEASE_TAG"
- fi
# Install packages git & curl
- apk update
- apk add git
- apk add curl
# Config & variables
- RELEASE_COMMIT_MESSAGE="Release $RELEASE_TAG"
- RELEASE_INTERMEDIATE_BRANCH="release-$RELEASE_TAG"
- git config user.name "OpenSILEX Team"
- git config user.email opensilex@gmail.com
- git remote set-url origin "https://oauth2:$GITLAB_USER_CI_PAT@forgemia.inra.fr/OpenSILEX/opensilex-dev.git"
# Fetch and unshallows the project
- git fetch origin --unshallow
# Remove local tags
- git tag -l | xargs git tag -d
- git fetch origin --tags
# Remove the local branches if necessary
- if git show-ref --quiet refs/heads/release; then
- git branch -D release
- fi
- if git show-ref --quiet refs/heads/master; then
- git branch -D master
- fi
- if git show-ref --quiet refs/heads/$RELEASE_INTERMEDIATE_BRANCH; then
- git branch -D $RELEASE_INTERMEDIATE_BRANCH
- fi
# Create intermediate branch to avoir conflicts
- git checkout release
- git checkout -b $RELEASE_INTERMEDIATE_BRANCH
- git merge origin/master -s ours --no-edit
# Merge into master
- git checkout master
- git merge $RELEASE_INTERMEDIATE_BRANCH --squash
- git commit -m "$RELEASE_COMMIT_MESSAGE"
- git tag -a -m "$RELEASE_COMMIT_MESSAGE" "$RELEASE_TAG"
# Check that there is no diff between master and release now
- if ! git diff master release --exit-code; then
- echo "Something went wrong with the merge; master and release should be the same but have differences"
- exit 1
- fi
# Push master and the release tag
- git push -f origin master
- git push origin $RELEASE_TAG
# Trigger the merge request to develop
- >
curl -X POST -F "private_token=$JOB_API_TOKEN" -F "source_branch=release"
-F "target_branch=develop" -F "title=[Release] Merge $RELEASE_TAG into develop"
-F "remove_source_branch=true" -F "labels[]=finishing release"
https://forgemia.inra.fr/api/v4/projects/1675/merge_requests
# Transmit release tag variable to next job (name must be different)
- echo "PUBLISH_RELEASE_TAG=$RELEASE_TAG" >> opensilex-release:close.env
rules:
- if: $CI_COMMIT_BRANCH == "release"
artifacts:
reports:
dotenv:
- "opensilex-release:close.env"
needs:
- job: "opensilex-release:build"
when: manual
############################
## PUBLISH RELEASE TO GITHUB
############################
opensilex-release:publish:
stage: release
image: maven:$MVN_VERSION-jdk-$JAVA_VERSION
script:
- if [[ -z $PUBLISH_RELEASE_TAG ]]; then
- echo 'PUBLISH_RELEASE_TAG must be set'
- exit 1
- else
- echo "Publishing release $PUBLISH_RELEASE_TAG"
- fi
# Install packages curl & jq
- apt-get update
- apt-get install -y curl
- apt-get install -y jq
# Remove local tags & fetch them again
- git tag -l | xargs git tag -d
- git fetch origin --tags
# Checkout the release tag & build with the correct revision
- git checkout $PUBLISH_RELEASE_TAG
- mvn clean install $MAVEN_CLI_OPTS -Drevision=$PUBLISH_RELEASE_TAG -DskipTests=true
# Extract release description from changelog
# The CHANGELOG.md file should have a section starting with "## [$PUBLISH_RELEASE_TAG]", for example "## [1.0.0-rc+4]"
# Otherwise, "Missing release notes" will be set as the release description
- echo "Try to extract the release description from changelog..."
- RELEASE_DESCRIPTION=$(sed -n "/^## \[${PUBLISH_RELEASE_TAG}\]/,/^## /p" CHANGELOG.md | head -n -1 | jq -Rsa .)
- if [[ "$RELEASE_DESCRIPTION" == '""' ]]; then
- echo "Missing release description for tag $PUBLISH_RELEASE_TAG in the changelog. Please change it later in the Github repository."
- RELEASE_DESCRIPTION="\"# [$PUBLISH_RELEASE_TAG] - $(date --iso-8601)\n\nMissing release notes\n\""
- fi
# Headers for the queries
- AUTHORIZATION="$GITHUB_API_ACCOUNT:$GITHUB_API_TOKEN"
- 'ACCEPTS_HEADER="Accept: application/vnd.github+json"'
# JSON payload for the creation query
# NB : the 'RELEASE_DESCRIPTION' variable already contains the quotes (thanks to jq), that's why they're omitted here
- 'CREATE_QUERY_PAYLOAD="{\"tag_name\":\"$PUBLISH_RELEASE_TAG\",\"name\":\"$PUBLISH_RELEASE_TAG\",\"body\":$RELEASE_DESCRIPTION}"'
# Create the release
- 'echo "\"curl -u \"$AUTHORIZATION\" -X POST -H \"$ACCEPTS_HEADER\" -d \"$CREATE_QUERY_PAYLOAD\" https://api.github.com/repos/OpenSILEX/opensilex/releases"'
- CREATE_RESPONSE=$(curl -u "$AUTHORIZATION" -X POST -H "$ACCEPTS_HEADER" -d "$CREATE_QUERY_PAYLOAD" https://api.github.com/repos/OpenSILEX/opensilex/releases)
- echo $CREATE_RESPONSE
# Asset file
- FILENAME=opensilex-release-$PUBLISH_RELEASE_TAG.zip
- FILEPATH=opensilex-release/target/$FILENAME
# Extract the asset upload URL from the response
# The URL is formatted like this : https://uploads.github.com/repos/OpenSILEX/opensilex/releases/73752399/assets{?name,label}
# So the last part must be replaced with a valid query parameter (only ?name is required)
- UPLOAD_URL=$(echo $CREATE_RESPONSE | jq -r .upload_url | sed -e "s/{.*}/\?name=${FILENAME}/g")
# Upload the asset file
- 'echo "curl -u \"$AUTHORIZATION\" -X POST -H \"$ACCEPTS_HEADER\" -H "Content-Type: application/zip" -T \"$FILEPATH\" \"$UPLOAD_URL\""'
- 'curl -u "$AUTHORIZATION" -X POST -H "$ACCEPTS_HEADER" -H "Content-Type: application/zip" -T "$FILEPATH" "$UPLOAD_URL"'
rules:
- if: $CI_COMMIT_BRANCH == "release"
needs:
- job: "opensilex-release:close"
artifacts: true
# Update nightly builds branch
update:nightly:builds:branch:
stage: build
script:
- apt update && apt install -y git
- git config --global user.name "anonymous"
- git config --global user.email "anonymous@opensilex.org"
- git remote set-url origin "https://oauth2:$GITLAB_USER_CI_PAT@forgemia.inra.fr/OpenSILEX/opensilex-dev.git"
- if [ -z "`git show-ref refs/heads/nightly-builds`" ]; then echo 'branch nightly-builds will be created!' && git checkout -b nightly-builds; else git checkout nightly-builds ;fi
- git fetch origin
- git reset --hard origin/develop
- git push -f origin nightly-builds
rules:
- if: $CI_COMMIT_BRANCH == "develop"
###############################################
## BUILD - TESTS WITH DIFFERENT MAVEN VERSIONS
###############################################
## BUILD TEMPLATE
.test:build: &test_build_on_schedules
<<: *cache_dependencies
before_script:
- if [ -z "$JAVA_VERSION" ]; then echo "Missing JAVA_VERSION variable"; exit 1; fi
- if [ -z "$MVN_VERSION" ]; then echo "Missing MVN_VERSION variable"; exit 1; fi
- echo "with_java $JAVA_VERSION and maven $MVN_VERSION with latest version of OpenSILEX/opensilex-dev"
- apt-get update && apt-get install -y git
stage: build
image: maven:$MVN_VERSION-openjdk-$JAVA_VERSION-slim
script:
- mvn clean install $MAVEN_OPTS -Drevision=$OPENSILEX_APP_REVISION
- ls $OPENSILEX_BUILD_PATH/opensilex-release-$OPENSILEX_APP_REVISION
- mv $OPENSILEX_BUILD_PATH/opensilex-release-$OPENSILEX_APP_REVISION $OPENSILEX_APP_REVISION
rules:
- if: $NIGHTLY_BUILD == "true"
## BUILD VERSIONS # example https://gitlab.com/gitlab-org/gitlab-foss/issues/13755
.with_java11: &java11
variables:
JAVA_VERSION: 11
.with_java14: &java14
variables:
JAVA_VERSION: 14
#.with_java17: &java17
# variables:
# JAVA_VERSION: 17
test:build:java11:
<<: *java11
<<: *test_build_on_schedules
test:build:java14:
<<: *java14
<<: *test_build_on_schedules
#test:build:java17:
# <<: *java17
# <<: *test_build_on_schedules
########################
## BUILD - GITLAB PAGES DOCS
########################
pages:
<<: *test_build_on_schedules
script:
- ln -s $JAVA_HOME java.home
- mkdir logs
- cd $CI_PROJECT_DIR/opensilex-swagger-codegen-maven-plugin
- mvn install $MAVEN_OPTS_SCHUEDULES 1> $CI_PROJECT_DIR/logs/mvn-install-swagger.log
- cd $CI_PROJECT_DIR
- mvn install site $MAVEN_OPTS_SCHUEDULES -Pwith-test-report -Pwith-security-check -DskipFrontBuild -pl '!opensilex-dev-tools' > $CI_PROJECT_DIR/logs/mvn-install-site.log
- mkdir public
- mv $CI_PROJECT_DIR/opensilex-doc/src/main/resources/generated/* public
artifacts:
paths:
- public
- logs
when: always
rules:
- if: $NIGHTLY_BUILD == "true"
allow_failure: true
# ##########################################
# ## BUILD & DEPLOY FOR MISTEA TEAM
# ##########################################
###################################
## DEMO-BUILD-DEPLOYMENT
###################################
demo:build:
<<: *build_template_with_opensilex
rules:
- if: $CI_COMMIT_BRANCH == "demo"
###################################
## MAX-TEST-SNAPSHOT-DEPLOYMENT
###################################
test:maximilian:build:
<<: *build_template_with_opensilex
variables:
MAVEN_SKIP_TESTS: "true"
rules:
- if: $CI_COMMIT_BRANCH == "test/maximilian2"
test:maximilian:deploy:
<<: *deploy_opensilex_before_script
<<: *deploy_opensilex_template
variables:
CONFIGS_FILES_DIR_PATH: "${DEV_TOOLS_REPO_CONF_FILES_PATH}/mistea/maximilian"
INSTANCE_CONFIGURATION_FILE_NAME: "phis.test.yml"
OPENSILEX_JAR_ADMIN_PORT: 4084
OPENSILEX_JAR_PORT: 8084
REMOTE_SERVER_RSYNC_ACCOUNT: "$REMOTE_PHIS_RSYNC_ACCOUNT"
REMOTE_SERVER_IP: $REMOTE_TEST_SERVER_IP
REMOTE_SERVER_RSYNC_DIR: "mistea/maximilian"
REMOTE_SERVER_SSH_KEY: "$TEST_SSH_PRIVATE_KEY"
rules:
- if: $CI_COMMIT_BRANCH == "test/maximilian2"
when: on_success
needs:
- test:maximilian:build
###################################
## ARNAUD-TEST-BUILD-DEPLOYMENT
###################################
test:arnaud:build:
<<: *build_template_with_opensilex
variables:
MAVEN_SKIP_TESTS: "true"
rules:
- if: $CI_COMMIT_BRANCH == "test/arnaud"
test:arnaud:deploy:
<<: *deploy_opensilex_before_script
<<: *deploy_opensilex_template
variables:
CONFIGS_FILES_DIR_PATH: "${DEV_TOOLS_REPO_CONF_FILES_PATH}/mistea/arnaud"
INSTANCE_CONFIGURATION_FILE_NAME: "phis.test.yml"
OPENSILEX_JAR_ADMIN_PORT: 4086
OPENSILEX_JAR_PORT: 8086
REMOTE_SERVER_RSYNC_ACCOUNT: "$REMOTE_PHIS_RSYNC_ACCOUNT"
REMOTE_SERVER_IP: "$REMOTE_TEST_SERVER_IP"
REMOTE_SERVER_RSYNC_DIR: "mistea/arnaud"
REMOTE_SERVER_SSH_KEY: "$TEST_SSH_PRIVATE_KEY"
rules:
- if: $CI_COMMIT_BRANCH == "test/arnaud"
when: on_success
needs:
- test:arnaud:build
###################################
## YVAN-TEST-BUILD-DEPLOYMENT
###################################
test:yvan:build:
<<: *build_template_with_opensilex
variables:
MAVEN_SKIP_TESTS: "true"
rules:
- if: $CI_COMMIT_BRANCH == "test/yvan"
tags:
- stable
test:yvan:deploy:
<<: *deploy_opensilex_before_script
<<: *deploy_opensilex_template
variables:
CONFIGS_FILES_DIR_PATH: "${DEV_TOOLS_REPO_CONF_FILES_PATH}/mistea/yvan"
INSTANCE_CONFIGURATION_FILE_NAME: "opensilex.yml"
OPENSILEX_JAR_ADMIN_PORT: 4083
OPENSILEX_JAR_PORT: 8083
REMOTE_SERVER_RSYNC_ACCOUNT: "$REMOTE_PHIS_RSYNC_ACCOUNT"
REMOTE_SERVER_IP: "$REMOTE_TEST_SERVER_IP"
REMOTE_SERVER_RSYNC_DIR: "mistea/yvan"
REMOTE_SERVER_SSH_KEY: "$TEST_SSH_PRIVATE_KEY"
rules:
- if: $CI_COMMIT_BRANCH == "test/yvan"
when: on_success
tags:
- stable
needs:
- test:yvan:build
###################################
## VALENTIN-TEST-BUILD-DEPLOYMENT
###################################
test:valentin:build:
<<: *build_template_with_opensilex
variables:
MAVEN_SKIP_TESTS: "true"
rules:
- if: $CI_COMMIT_BRANCH == "test/valentin"
test:valentin:deploy:
<<: *deploy_opensilex_before_script
<<: *deploy_opensilex_template
variables:
CONFIGS_FILES_DIR_PATH: "${DEV_TOOLS_REPO_CONF_FILES_PATH}/mistea/valentin"
INSTANCE_CONFIGURATION_FILE_NAME: "valentin.opensilex.yml"
OPENSILEX_JAR_ADMIN_PORT: 4096
OPENSILEX_JAR_PORT: 8096
REMOTE_SERVER_RSYNC_ACCOUNT: "$REMOTE_PHIS_RSYNC_ACCOUNT"
REMOTE_SERVER_IP: "$REMOTE_TEST_SERVER_IP"
REMOTE_SERVER_RSYNC_DIR: "mistea/valentin"
REMOTE_SERVER_SSH_KEY: "$TEST_SSH_PRIVATE_KEY"
rules:
- if: $CI_COMMIT_BRANCH == "test/valentin"
when: on_success
needs:
- test:valentin:build
###################################
## BERNHARD-TEST-BUILD-DEPLOYMENT
###################################
test:bernhard:build:
<<: *build_template_with_opensilex
variables:
MAVEN_SKIP_TESTS: "true"
rules:
- if: $CI_COMMIT_BRANCH == "test/bernhard"
test:bernhard:deploy:
<<: *deploy_opensilex_before_script
<<: *deploy_opensilex_template
variables:
CONFIGS_FILES_DIR_PATH: "${DEV_TOOLS_REPO_CONF_FILES_PATH}/mistea/bernhard"
INSTANCE_CONFIGURATION_FILE_NAME: "phis.test.yml"
OPENSILEX_JAR_ADMIN_PORT: 4091
OPENSILEX_JAR_PORT: 8091
REMOTE_SERVER_RSYNC_ACCOUNT: "$REMOTE_PHIS_RSYNC_ACCOUNT"
REMOTE_SERVER_IP: "$REMOTE_TEST_SERVER_IP"
REMOTE_SERVER_RSYNC_DIR: "mistea/bernhard"
REMOTE_SERVER_SSH_KEY: "$TEST_SSH_PRIVATE_KEY"
rules:
- if: $CI_COMMIT_BRANCH == "test/bernhard"
when: on_success
needs:
- test:bernhard:build
###################################
## GABRIEL-TEST-BUILD-DEPLOYMENT
###################################
test:gabriel:build:
<<: *build_template_with_opensilex
variables:
MAVEN_SKIP_TESTS: "true"
rules:
- if: $CI_COMMIT_BRANCH == "test/gabriel"
test:gabriel:deploy:
<<: *deploy_opensilex_before_script
<<: *deploy_opensilex_template
variables:
CONFIGS_FILES_DIR_PATH: "${DEV_TOOLS_REPO_CONF_FILES_PATH}/mistea/gabriel"
INSTANCE_CONFIGURATION_FILE_NAME: "phis.test.yml"
OPENSILEX_JAR_ADMIN_PORT: 4091
OPENSILEX_JAR_PORT: 8091
REMOTE_SERVER_RSYNC_ACCOUNT: "$REMOTE_PHIS_RSYNC_ACCOUNT"
REMOTE_SERVER_IP: "$REMOTE_TEST_SERVER_IP"
REMOTE_SERVER_RSYNC_DIR: "mistea/gabriel"
REMOTE_SERVER_SSH_KEY: "$TEST_SSH_PRIVATE_KEY"
rules:
- if: $CI_COMMIT_BRANCH == "test/gabriel"
when: on_success
needs:
- test:gabriel:build
######################################
## OPTIMIZATION-TEST-BUILD-DEPLOYMENT
######################################
test:optimization:build:
<<: *build_template_with_opensilex
variables:
MAVEN_SKIP_TESTS: "true"
rules:
- if: $CI_COMMIT_BRANCH == "test/optimization"
test:optimization:deploy:
<<: *deploy_opensilex_before_script
<<: *deploy_opensilex_template
variables:
CONFIGS_FILES_DIR_PATH: "${DEV_TOOLS_REPO_CONF_FILES_PATH}/mistea/optimization"
INSTANCE_CONFIGURATION_FILE_NAME: "phis.test.yml"
OPENSILEX_JAR_ADMIN_PORT: 4081
OPENSILEX_JAR_PORT: 8081
REMOTE_SERVER_RSYNC_ACCOUNT: "$REMOTE_PHIS_RSYNC_ACCOUNT"
REMOTE_SERVER_IP: "$REMOTE_TEST_SERVER_BENCHMARK_IP"
REMOTE_SERVER_RSYNC_DIR: "mistea/optimization"
REMOTE_SERVER_SSH_KEY: "$TEST_SSH_PRIVATE_KEY"
rules:
- if: $CI_COMMIT_BRANCH == "test/optimization"
when: on_success
needs:
- test:optimization:build
###################################
## SEBASTIEN-TEST-BUILD-DEPLOYMENT
###################################
test:sebastien:build:
<<: *build_template_with_opensilex
variables:
MAVEN_SKIP_TESTS: "true"
rules:
- if: $CI_COMMIT_BRANCH == "test/sebastien"
test:sebastien:deploy:
<<: *deploy_opensilex_before_script
<<: *deploy_opensilex_template
variables:
CONFIGS_FILES_DIR_PATH: "${DEV_TOOLS_REPO_CONF_FILES_PATH}/mistea/sebastien"
INSTANCE_CONFIGURATION_FILE_NAME: "phis.test.yml"
OPENSILEX_JAR_ADMIN_PORT: 4089
OPENSILEX_JAR_PORT: 8089
REMOTE_SERVER_RSYNC_ACCOUNT: "$REMOTE_PHIS_RSYNC_ACCOUNT"
REMOTE_SERVER_IP: "$REMOTE_TEST_SERVER_IP"
REMOTE_SERVER_RSYNC_DIR: "mistea/sebastien"
REMOTE_SERVER_SSH_KEY: "$TEST_SSH_PRIVATE_KEY"
rules:
- if: $CI_COMMIT_BRANCH == "test/sebastien"
when: on_success
needs:
- test:sebastien:build
###################################
## TEMP2-TEST-BUILD-DEPLOYMENT
###################################
test:temporary2:build:
<<: *build_template_with_opensilex
variables:
MAVEN_SKIP_TESTS: "true"
rules:
- if: $CI_COMMIT_BRANCH == "test/temporary2"
test:temporary2:deploy:
<<: *deploy_opensilex_before_script
<<: *deploy_opensilex_template
variables:
CONFIGS_FILES_DIR_PATH: "${DEV_TOOLS_REPO_CONF_FILES_PATH}/mistea/temporary2"
INSTANCE_CONFIGURATION_FILE_NAME: "phis.test.yml"
OPENSILEX_JAR_ADMIN_PORT: 4100
OPENSILEX_JAR_PORT: 8100
REMOTE_SERVER_RSYNC_ACCOUNT: "$REMOTE_PHIS_RSYNC_ACCOUNT"
REMOTE_SERVER_IP: "$REMOTE_TEST_SERVER_IP"
REMOTE_SERVER_RSYNC_DIR: "mistea/temporary2"
REMOTE_SERVER_SSH_KEY: "$TEST_SSH_PRIVATE_KEY"
rules:
- if: $CI_COMMIT_BRANCH == "test/temporary2"
when: on_success
needs:
- test:temporary2:build
###################################
## alexiaChiavarino-TEST-BUILD-DEPLOYMENT
###################################
test:alexiaChiavarino:build:
<<: *build_template_with_opensilex
variables:
MAVEN_SKIP_TESTS: "true"
rules:
- if: $CI_COMMIT_BRANCH == "test/alexia"
tags:
- stable
test:alexiaChiavarino:deploy:
<<: *deploy_opensilex_before_script
<<: *deploy_opensilex_template
variables:
CONFIGS_FILES_DIR_PATH: "${DEV_TOOLS_REPO_CONF_FILES_PATH}/mistea/alexia"
INSTANCE_CONFIGURATION_FILE_NAME: "phis.test.yml"
OPENSILEX_JAR_ADMIN_PORT: 4087
OPENSILEX_JAR_PORT: 8087
REMOTE_SERVER_RSYNC_ACCOUNT: "$REMOTE_PHIS_RSYNC_ACCOUNT"
REMOTE_SERVER_IP: "$REMOTE_TEST_SERVER_IP"
REMOTE_SERVER_RSYNC_DIR: "mistea/alexia"
REMOTE_SERVER_SSH_KEY: "$TEST_SSH_PRIVATE_KEY"
rules:
- if: $CI_COMMIT_BRANCH == "test/alexia"
when: on_success
tags:
- stable
needs:
- test:alexiaChiavarino:build
###################################
## RENAUD-TEST-BUILD-DEPLOYMENT
###################################
test:renaud:build:
<<: *build_template_with_opensilex
variables:
MAVEN_SKIP_TESTS: "true"
rules:
- if: $CI_COMMIT_BRANCH == "test/renaud"
test:renaud:deploy:
<<: *deploy_opensilex_before_script
<<: *deploy_opensilex_template
variables:
CONFIGS_FILES_DIR_PATH: "${DEV_TOOLS_REPO_CONF_FILES_PATH}/mistea/renaud"
INSTANCE_CONFIGURATION_FILE_NAME: "phis.test.yml"
OPENSILEX_JAR_ADMIN_PORT: 4088
OPENSILEX_JAR_PORT: 8088
REMOTE_SERVER_RSYNC_ACCOUNT: "$REMOTE_PHIS_RSYNC_ACCOUNT"
REMOTE_SERVER_IP: "$REMOTE_TEST_SERVER_IP"
REMOTE_SERVER_RSYNC_DIR: "mistea/renaud"
REMOTE_SERVER_SSH_KEY: "$TEST_SSH_PRIVATE_KEY"
rules:
- if: $CI_COMMIT_BRANCH == "test/renaud"
when: on_success
needs:
- test:renaud:build
###################################
## TEMPORARY-TEST-BUILD-DEPLOYMENT
###################################
test:temporary1:build:
<<: *build_template_with_opensilex
variables:
MAVEN_SKIP_TESTS: "true"
rules:
- if: $CI_COMMIT_BRANCH == "test/temporary1"
test:temporary1:deploy:
<<: *deploy_opensilex_before_script
<<: *deploy_opensilex_template
variables:
CONFIGS_FILES_DIR_PATH: "${DEV_TOOLS_REPO_CONF_FILES_PATH}/mistea/temporary1"
INSTANCE_CONFIGURATION_FILE_NAME: "phis.test.yml"
OPENSILEX_JAR_ADMIN_PORT: 4092
OPENSILEX_JAR_PORT: 8092
REMOTE_SERVER_RSYNC_ACCOUNT: "$REMOTE_PHIS_RSYNC_ACCOUNT"
REMOTE_SERVER_IP: "$REMOTE_TEST_SERVER_IP"
REMOTE_SERVER_RSYNC_DIR: "mistea/temporary1"
REMOTE_SERVER_SSH_KEY: "$TEST_SSH_PRIVATE_KEY"
rules:
- if: $CI_COMMIT_BRANCH == "test/temporary1"
when: on_success
needs:
- test:temporary1:build
###################################
## EMILIE-TEST-SNAPSHOT-DEPLOYMENT
###################################
test:emilie:build:
<<: *build_template_with_opensilex
variables:
MAVEN_SKIP_TESTS: "true"
rules:
- if: $CI_COMMIT_BRANCH == "test/emilie"
test:emilie:deploy:
<<: *deploy_opensilex_before_script
<<: *deploy_opensilex_template
variables:
CONFIGS_FILES_DIR_PATH: "${DEV_TOOLS_REPO_CONF_FILES_PATH}/mistea/emilie"
INSTANCE_CONFIGURATION_FILE_NAME: "phis.test.yml"
OPENSILEX_JAR_ADMIN_PORT: 4094
OPENSILEX_JAR_PORT: 8094
REMOTE_SERVER_RSYNC_ACCOUNT: "$REMOTE_PHIS_RSYNC_ACCOUNT"
REMOTE_SERVER_IP: $REMOTE_TEST_SERVER_IP
REMOTE_SERVER_RSYNC_DIR: "mistea/emilie"
REMOTE_SERVER_SSH_KEY: "$TEST_SSH_PRIVATE_KEY"
rules:
- if: $CI_COMMIT_BRANCH == "test/emilie"
when: on_success
needs:
- test:emilie:build