Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Sito
poul.org
Commits
200af6fd
Verified
Commit
200af6fd
authored
Sep 22, 2019
by
Davide Depau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Automatically fix url and baseurl in GitLab CI
parent
b2024ed9
Pipeline
#17
passed with stage
in 1 minute and 13 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
.ci_fix_baseurl.sh
.ci_fix_baseurl.sh
+20
-0
.gitlab-ci.yml
.gitlab-ci.yml
+1
-0
No files found.
.ci_fix_baseurl.sh
0 → 100755
View file @
200af6fd
#!/bin/bash
if
[[
"
$CI_JOB_ID
"
==
""
]]
;
then
echo
"Not running in GitLab CI"
1>&2
exit
fi
# Remove everything before the domain from CI_PAGES_URL
ci_baseurl
=
"
${
CI_PAGES_URL
##*
$CI_PAGES_DOMAIN
}
"
# Opposite of above
ci_url
=
"
${
CI_PAGES_URL
%
$ci_baseurl
*
}
"
# Remove trailing / from baseurl
if
[[
"
$ci_baseurl
"
==
*
/
]]
;
then
ci_baseurl
=
"
${
ci_baseurl
%/*
}
"
fi
sed
-i
's|^baseurl:.*$|baseurl: "'
"
$ci_baseurl
"
'"|'
_config.yml
sed
-i
's|^url:.*$|url: "'
"
$ci_url
"
'"|'
_config.yml
.gitlab-ci.yml
View file @
200af6fd
...
...
@@ -11,6 +11,7 @@ before_script:
pages
:
stage
:
deploy
script
:
-
./.ci_fix_baseurl.sh
-
jekyll build -d public
artifacts
:
paths
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment