Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MKDocs Template
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EDP
MKDocs Template
Commits
f000e3fd
Verified
Commit
f000e3fd
authored
4 years ago
by
Romain Deville
Browse files
Options
Downloads
Patches
Plain Diff
Fix typos in gitlab CI
Replace `only` by `rules` in CI. Update some typos and command order.
parent
5bd1176b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+24
-52
24 additions, 52 deletions
.gitlab-ci.yml
docs/.gitlab-ci.yml
+11
-10
11 additions, 10 deletions
docs/.gitlab-ci.yml
with
35 additions
and
62 deletions
.gitlab-ci.yml
+
24
−
52
View file @
f000e3fd
...
...
@@ -74,59 +74,31 @@ variables:
# Activate virtual environment
-
source .venv/bin/activate
#
Only
anchors
#
Rules
anchors
# -----------------------------------------------------------------------------
# https://docs.gitlab.com/ee/ci/yaml/README.html#only
# List all names of refs that can be used with key (only|except):refs using
# anchors to avoid having to modify multiple times. Refs are:
# - Branches names based on git flow: https://danielkummer.github.io/git-flow-cheatsheet/
# - merge_requests (https://docs.gitlab.com/ee/ci/yaml/README.html#onlyexcept-basic)
# - tags (https://docs.gitlab.com/ee/ci/yaml/README.html#onlyexcept-basic)
.refs_names
:
-
&ref_release
/release-*/
-
&ref_feature
/feature-*/
-
&ref_hotfix
/hotfix-*/
-
&ref_bugfix
/bugfix-*/
-
&ref_develop
develop
-
&ref_master
master
-
&ref_merge_requests
merge_requests
-
&ref_tags
tags
# Specify on which branch, tags or on merge_requests CI should be done.
# Jobs under only_dev anchor will be run if branch name are compliant with git
# flow branch which are not `develop` neither `master` and will be run on
# merge_request
.only_dev
:
&only_dev
only
:
refs
:
-
*ref_release
-
*ref_feature
-
*ref_hotfix
-
*ref_bugfix
-
*ref_merge_requests
# Jobs under only_pre_prod anchor will be run on `develop` (i.e. pre-release)
# and `master` (release) branch.
.only_pre_prod
:
&only_pre_prod
only
:
refs
:
-
*ref_develop
-
*ref_master
# Jobs under only_prod anchor will be run on tagged commit.
.only_prod
:
&only_prod
only
:
refs
:
-
*ref_tags
# Jobs under only_trigger anchor will be run on `develop` (i.e. pre-release)
# `master` (release) branch and tagged commit.
.only_trigger
:
&only_trigger
only
:
refs
:
-
*ref_develop
-
*ref_master
-
*ref_tags
# https://docs.gitlab.com/ee/ci/yaml/README.html#rules
# Defining bash regexp test
.rules_regexp
:
-
&rules_regexp_dev
$CI_COMMIT_BRANCH =~ /^((release|feature|hotfix|bugfix)-|merge_request_)*/
-
&rules_regexp_pre_prod
$CI_COMMIT_BRANCH =~ /(develop|master)/
-
&rules_regexp_prod
$CI_COMMIT_TAG
# Defining rules that now replace only to run jobs under specific condition
# and define variables
.rules_dev
:
&rules_dev
if
:
*rules_regexp_dev
variables
:
CI_DEPLOY_TYPE
:
"
dev"
.rules_pre_prod
:
&rules_pre_prod
if
:
*rules_regexp_pre_prod
variables
:
CI_DEPLOY_TYPE
:
"
pre_prod"
.rules_prod
:
&rules_prod
if
:
*rules_regexp_prod
variables
:
CI_DEPLOY_TYPE
:
"
prod"
# Tag anchors
# -----------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
docs/.gitlab-ci.yml
+
11
−
10
View file @
f000e3fd
### BEGIN MKDOCS TEMPLATE ###
### WARNING, DO NOT UPDATE CONTENT BETWEEN MKDOCS TEMPLATE TAG !###
### Modified content will be overwritten when updating.###
...
...
@@ -98,7 +99,7 @@ variables:
export RSYNC_DEST="${RSYNC_DEST}/pre_prod/"
export ONLINE_DEST="${ONLINE_DEST}/pre_prod/"
;;
"
pre_
prod")
"prod")
export RSYNC_DEST="${RSYNC_DEST}/"
export ONLINE_DEST="${ONLINE_DEST}/"
;;
...
...
@@ -116,8 +117,8 @@ variables:
-
&rules_regexp_dev
$CI_COMMIT_BRANCH =~ /^((release|feature|hotfix|bugfix)-|merge_request_)*/
-
&rules_regexp_pre_prod
$CI_COMMIT_BRANCH =~ /(develop|master)/
-
&rules_regexp_prod
$CI_COMMIT_TAG
-
&rules_regexp_trigger_main
(($CI_COMMIT_BRANCH =~ /(develop|master)/) || $CI_COMMIT_TAG) && ($MAIN_PROJECT && $MAIN_PROJECT != $CI_PROJECT_PATH)
-
&rules_regexp_trigger_info
(($CI_COMMIT_BRANCH =~ /(develop|master)/) || $CI_COMMIT_TAG) &&
(
$MAIN_PROJECT ==
"")
-
&rules_regexp_trigger_main
(($CI_COMMIT_BRANCH =~ /(develop|master)/) || $CI_COMMIT_TAG) && ($MAIN_PROJECT
!=
null
&& $MAIN_PROJECT != $CI_PROJECT_PATH)
-
&rules_regexp_trigger_info
(($CI_COMMIT_BRANCH =~ /(develop|master)/) || $CI_COMMIT_TAG) && $MAIN_PROJECT ==
null
# Defining rules that now replace only to run jobs under specific condition
# and define variables
...
...
@@ -252,9 +253,9 @@ script_pre_test_ensure_variable: &script_pre_test_ensure_variable
return 1
fi
rules
:
-
*rules_dev
-
*rules_pre_prod
-
*rules_prod
-
*rules_pre_prod
-
*rules_dev
# Jobs in test stage
# -----------------------------------------------------------------------------
...
...
@@ -360,7 +361,6 @@ script_deploy_html: &script_deploy_html
fi
-
ln -s "${LAST_TAG}" "latest"
-
mv "latest" "tmp/${PROJECT_PATH}"
-
rsync -avz "tmp/" "${RSYNC_DEST}"
-
echo -e "
<!DOCTYPE html>\n
<html>\n
...
...
@@ -377,12 +377,12 @@ script_deploy_html: &script_deploy_html
<body>\n
Redirecting to <a href='${ONLINE_PATH}'>${ONLINE_PATH}</a>...\n
</body>\n
</html>" > index.html
-
rsync -avz
index.html
"${RSYNC_DEST}
${PROJECT_PATH}/
"
</html>" >
tmp/${PROJECT_PATH}/../
index.html
-
rsync -avz
"tmp/"
"${RSYNC_DEST}"
rules
:
-
*rules_dev
-
*rules_pre_prod
-
*rules_prod
-
*rules_pre_prod
-
*rules_dev
# Jobs in post_deploy stage
# -----------------------------------------------------------------------------
...
...
@@ -424,3 +424,4 @@ inform_triggers_variables:
# vim: fdm=indent
# *****************************************************************************
### END MKDOCS TEMPLATE ###
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment