Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MKDocs Template
Manage
Activity
Members
Labels
Plan
Issues
3
Issue boards
Milestones
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Harbor Registry
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
PAGoDA
Tools
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:
...
@@ -74,59 +74,31 @@ variables:
# Activate virtual environment
# Activate virtual environment
-
source .venv/bin/activate
-
source .venv/bin/activate
#
Only
anchors
#
Rules
anchors
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
# https://docs.gitlab.com/ee/ci/yaml/README.html#only
# https://docs.gitlab.com/ee/ci/yaml/README.html#rules
# List all names of refs that can be used with key (only|except):refs using
# Defining bash regexp test
# anchors to avoid having to modify multiple times. Refs are:
.rules_regexp
:
# - Branches names based on git flow: https://danielkummer.github.io/git-flow-cheatsheet/
-
&rules_regexp_dev
$CI_COMMIT_BRANCH =~ /^((release|feature|hotfix|bugfix)-|merge_request_)*/
# - merge_requests (https://docs.gitlab.com/ee/ci/yaml/README.html#onlyexcept-basic)
-
&rules_regexp_pre_prod
$CI_COMMIT_BRANCH =~ /(develop|master)/
# - tags (https://docs.gitlab.com/ee/ci/yaml/README.html#onlyexcept-basic)
-
&rules_regexp_prod
$CI_COMMIT_TAG
.refs_names
:
-
&ref_release
/release-*/
# Defining rules that now replace only to run jobs under specific condition
-
&ref_feature
/feature-*/
# and define variables
-
&ref_hotfix
/hotfix-*/
.rules_dev
:
&rules_dev
-
&ref_bugfix
/bugfix-*/
if
:
*rules_regexp_dev
-
&ref_develop
develop
variables
:
-
&ref_master
master
CI_DEPLOY_TYPE
:
"
dev"
-
&ref_merge_requests
merge_requests
-
&ref_tags
tags
.rules_pre_prod
:
&rules_pre_prod
if
:
*rules_regexp_pre_prod
# Specify on which branch, tags or on merge_requests CI should be done.
variables
:
# Jobs under only_dev anchor will be run if branch name are compliant with git
CI_DEPLOY_TYPE
:
"
pre_prod"
# flow branch which are not `develop` neither `master` and will be run on
# merge_request
.rules_prod
:
&rules_prod
.only_dev
:
&only_dev
if
:
*rules_regexp_prod
only
:
variables
:
refs
:
CI_DEPLOY_TYPE
:
"
prod"
-
*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
# Tag anchors
# Tag anchors
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
docs/.gitlab-ci.yml
+
11
−
10
View file @
f000e3fd
### BEGIN MKDOCS TEMPLATE ###
### BEGIN MKDOCS TEMPLATE ###
### WARNING, DO NOT UPDATE CONTENT BETWEEN MKDOCS TEMPLATE TAG !###
### WARNING, DO NOT UPDATE CONTENT BETWEEN MKDOCS TEMPLATE TAG !###
### Modified content will be overwritten when updating.###
### Modified content will be overwritten when updating.###
...
@@ -98,7 +99,7 @@ variables:
...
@@ -98,7 +99,7 @@ variables:
export RSYNC_DEST="${RSYNC_DEST}/pre_prod/"
export RSYNC_DEST="${RSYNC_DEST}/pre_prod/"
export ONLINE_DEST="${ONLINE_DEST}/pre_prod/"
export ONLINE_DEST="${ONLINE_DEST}/pre_prod/"
;;
;;
"
pre_
prod")
"prod")
export RSYNC_DEST="${RSYNC_DEST}/"
export RSYNC_DEST="${RSYNC_DEST}/"
export ONLINE_DEST="${ONLINE_DEST}/"
export ONLINE_DEST="${ONLINE_DEST}/"
;;
;;
...
@@ -116,8 +117,8 @@ variables:
...
@@ -116,8 +117,8 @@ variables:
-
&rules_regexp_dev
$CI_COMMIT_BRANCH =~ /^((release|feature|hotfix|bugfix)-|merge_request_)*/
-
&rules_regexp_dev
$CI_COMMIT_BRANCH =~ /^((release|feature|hotfix|bugfix)-|merge_request_)*/
-
&rules_regexp_pre_prod
$CI_COMMIT_BRANCH =~ /(develop|master)/
-
&rules_regexp_pre_prod
$CI_COMMIT_BRANCH =~ /(develop|master)/
-
&rules_regexp_prod
$CI_COMMIT_TAG
-
&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_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 ==
"")
-
&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
# Defining rules that now replace only to run jobs under specific condition
# and define variables
# and define variables
...
@@ -252,9 +253,9 @@ script_pre_test_ensure_variable: &script_pre_test_ensure_variable
...
@@ -252,9 +253,9 @@ script_pre_test_ensure_variable: &script_pre_test_ensure_variable
return 1
return 1
fi
fi
rules
:
rules
:
-
*rules_dev
-
*rules_pre_prod
-
*rules_prod
-
*rules_prod
-
*rules_pre_prod
-
*rules_dev
# Jobs in test stage
# Jobs in test stage
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
...
@@ -360,7 +361,6 @@ script_deploy_html: &script_deploy_html
...
@@ -360,7 +361,6 @@ script_deploy_html: &script_deploy_html
fi
fi
-
ln -s "${LAST_TAG}" "latest"
-
ln -s "${LAST_TAG}" "latest"
-
mv "latest" "tmp/${PROJECT_PATH}"
-
mv "latest" "tmp/${PROJECT_PATH}"
-
rsync -avz "tmp/" "${RSYNC_DEST}"
-
echo -e "
-
echo -e "
<!DOCTYPE html>\n
<!DOCTYPE html>\n
<html>\n
<html>\n
...
@@ -377,12 +377,12 @@ script_deploy_html: &script_deploy_html
...
@@ -377,12 +377,12 @@ script_deploy_html: &script_deploy_html
<body>\n
<body>\n
Redirecting to <a href='${ONLINE_PATH}'>${ONLINE_PATH}</a>...\n
Redirecting to <a href='${ONLINE_PATH}'>${ONLINE_PATH}</a>...\n
</body>\n
</body>\n
</html>" > index.html
</html>" >
tmp/${PROJECT_PATH}/../
index.html
-
rsync -avz
index.html
"${RSYNC_DEST}
${PROJECT_PATH}/
"
-
rsync -avz
"tmp/"
"${RSYNC_DEST}"
rules
:
rules
:
-
*rules_dev
-
*rules_pre_prod
-
*rules_prod
-
*rules_prod
-
*rules_pre_prod
-
*rules_dev
# Jobs in post_deploy stage
# Jobs in post_deploy stage
# -----------------------------------------------------------------------------
# -----------------------------------------------------------------------------
...
@@ -424,3 +424,4 @@ inform_triggers_variables:
...
@@ -424,3 +424,4 @@ inform_triggers_variables:
# vim: fdm=indent
# vim: fdm=indent
# *****************************************************************************
# *****************************************************************************
### END MKDOCS TEMPLATE ###
### 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