forked from LAB-MI/candilibV2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
92 lines (82 loc) · 2.49 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
image: debian:stretch
variables:
## Enable under shared runner
## In gitlab/variables : declare Variable File Variable named http_proxy_shared, and no_proxy_shared
http_proxy: $http_proxy_shared
https_proxy: $http_proxy_shared
no_proxy: $no_proxy_shared
HTTP_PROXY: $http_proxy_shared
HTTPS_PROXY: $http_proxy_shared
NO_PROXY: $no_proxy_shared
## In gitlab/variables : declare Variable File Type named BUILD_CONFIG
## containing internal NPM_REGISTRY, SASS_REGISTRY, PYPI_URL, PYPI_HOST, RUBY_URL,, CYPRESS_DOWNLOAD_MIRROR, MIRROR_DEBIAN
## MIRROR_DOCKER, MIRROR_DOCKER_KEY
BUILD_CONFIG_FILE: $BUILD_CONFIG
# GIT_CURL_VERBOSE: "1"
# GIT_DEBUG_LOOKUP: "1"
# GIT_TRANSLOOP_DEBUG: "1"
# GIT_TRANSPORT_HELPER_DEBUG: "1"
stages:
- build
- staging
default:
tags:
- shared
- region1
# - docker
# - openstack
before_script:
- echo "# Before script"
- echo "$BUILD_CONFIG_FILE" > .build_config
- source .build_config
- time ci/before_scripts.sh
# build template
.build_template:
stage: build
# build template script
.build_template_script: &build_template_script
- echo "# Build"
- echo "$BUILD_CONFIG_FILE" > .build_config
- source .build_config
- echo "# Build"
- if [ -z "$CI_DRY_RUN"] ; then time ci/build.sh ; fi
# publish template script
.publish_template_script: &publish_template_script
- echo "# Publish"
- eval "$OS_CONFIG"
- openstack --insecure container list
- if [ -z "$CI_DRY_RUN"] ; then time 'ci/run_publish.sh'; fi
## staging
.staging_template_script: &staging_template_script
- time 'ci/deploy_staging.sh'
# build only on qualif/*
build_and_publish_qualif_app:
extends: .build_template
variables:
LATEST_VERSION: qualif
PLATEFORME: qualif
PLATEFORME_BRANCH: $PLATEFORME_BRANCH
OS_CONFIG: $OS_CONFIG_QUALIF
OS_STORAGE_URL: $OS_STORAGE_URL
rules:
- if: ( $CI_COMMIT_BRANCH =~ /^qualif\/*/ || $CI_COMMIT_BRANCH =~ /^devops\/*/ )
script:
- *build_template_script
- *publish_template_script
- *staging_template_script
# build only on develop
build_and_publish_latest_app:
extends: .build_template
variables:
LATEST_VERSION: latest
PLATEFORME: dev
PLATEFORME_BRANCH: $PLATEFORME_BRANCH
OS_CONFIG: $OS_CONFIG_DEV
OS_STORAGE_URL: $OS_STORAGE_URL
rules:
- if: $CI_COMMIT_REF_NAME =~ /^v*/ && $CI_COMMIT_BRANCH == null
- if: $CI_COMMIT_BRANCH =~ /^develop/
script:
- *build_template_script
- *publish_template_script
- *staging_template_script