Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
howto-cards
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Marie Fossepre
howto-cards
Commits
ae8358b5
Verified
Commit
ae8358b5
authored
3 years ago
by
Laurent Heirendt
Browse files
Options
Downloads
Patches
Plain Diff
change configuration for bulding pages/MR
parent
8c8eb9ae
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+13
-9
13 additions, 9 deletions
.gitlab-ci.yml
with
13 additions
and
9 deletions
.gitlab-ci.yml
+
13
−
9
View file @
ae8358b5
...
@@ -84,22 +84,26 @@ build:pages:
...
@@ -84,22 +84,26 @@ build:pages:
-
.tmp
-
.tmp
rules
:
rules
:
-
if
:
$CI_COMMIT_REF_NAME
-
if
:
$CI_COMMIT_REF_NAME
-
if
:
$CI_MERGE_REQUEST_ID
before_script
:
before_script
:
-
apt-get -qq update
-
apt-get -qq update
-
apt-get install -y -qq git-lfs
-
apt-get install -y -qq git-lfs
-
gem install bundler:$BUNDLER_VERSION && bundle install
-
gem install bundler:$BUNDLER_VERSION && bundle install
script
:
script
:
# Generate the configuration for forks (will use Gitlab Pages on personal namespaces)
# Generate the configuration for forks (will use Gitlab Pages on personal namespaces)
-
'
echo
"url:
https://$CI_PROJECT_NAMESPACE.$CI_PAGES_DOMAIN"
>>
.ci/_config_gitlab_pages.yml'
-
|
-
'
echo
"baseurl:
/$CI_PROJECT_NAME"
>>
.ci/_config_gitlab_pages.yml'
if [ $CI_MERGE_REQUEST_ID ]; then
export CI_COMMIT_REF_NAME="develop";
# If there is no config for the current branch, use the one for Gitlab Pages
else
-
'
if
[
!
-f
".ci/_config_$CI_COMMIT_REF_NAME.yml"
];
then
mv
.ci/_config_gitlab_pages.yml
.ci/_config_$CI_COMMIT_REF_NAME.yml;
fi'
echo "url: https://$CI_PROJECT_NAMESPACE.$CI_PAGES_DOMAIN" >> .ci/_config_gitlab_pages.yml;
echo "baseurl: /$CI_PROJECT_NAME" >> .ci/_config_gitlab_pages.yml;
# If there is no config for the current branch, use the one for Gitlab Pages
if [ ! -f ".ci/_config_$CI_COMMIT_REF_NAME.yml" ]; then
mv .ci/_config_gitlab_pages.yml .ci/_config_$CI_COMMIT_REF_NAME.yml;
fi
fi
# Display, which configuration is used
# Display, which configuration is used
-
'
echo
"Configuration:
"
&&
cat
".ci/_config_$CI_COMMIT_REF_NAME.yml"'
-
|
echo "Configuration: " && cat ".ci/_config_$CI_COMMIT_REF_NAME.yml"
# Run Jekyll with custom configuration
# Run Jekyll with custom configuration
-
bundle exec jekyll build -d build --config "_config.yml,.ci/_config_$CI_COMMIT_REF_NAME.yml"
-
bundle exec jekyll build -d build --config "_config.yml,.ci/_config_$CI_COMMIT_REF_NAME.yml"
...
...
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