Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
hsbxl-website
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
6
Snippets
Groups
Projects
Show more breadcrumbs
hsbxl
hsbxl-website
Commits
1ef52e34
There was an error fetching the commit references. Please try again later.
Commit
1ef52e34
authored
6 years ago
by
betz
Browse files
Options
Downloads
Patches
Plain Diff
website project
parent
c03f4fc9
No related branches found
No related tags found
No related merge requests found
Pipeline
#36794284
passed
6 years ago
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
content/projects/website/index.md
+43
-2
43 additions, 2 deletions
content/projects/website/index.md
static/images/website.png
+0
-0
0 additions, 0 deletions
static/images/website.png
with
43 additions
and
2 deletions
content/projects/website/index.md
+
43
−
2
View file @
1ef52e34
...
...
@@ -3,8 +3,49 @@ title: "This website"
linktitle
:
"
This
website"
state
:
running
maintainer
:
"
betz"
image
:
"
website.png"
---
The website you're currently browsing is build with static site generator 'Hugo'.
You find the public repo on https://gitlab.com/hsbxl/site
The website you're currently browsing is build with static site generator '
[
Hugo
](
https://gohugo.io/
)
'.
The Hugo generator is written in Go and uses the Markdown format for content.
You find the public repo of this wite on https://gitlab.com/hsbxl/site
We are using Gitlab-CI to rebuild this complete website with every git push.
See https://gitlab.com/hsbxl/site/blob/master/.gitlab-ci.yml for the gitlab-ci conf.
Gitlab-CI fires a container, installs requirements,
and runs the hugo command to build the static files in a '/public' folder.
Once the '/public' folder is generated, containing all html, css and js files,
it copies this folder over to our target server, the server running hsbxl.be.
The Gitlab-CI config:
~~~~
image: monachus/hugo
before_script:
- apt-get update
- apt-get install openssh-client -y
- eval $(ssh-agent -s)
- echo "$PRIVKEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$KNOWN_HOSTS" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
pages:
script:
- hugo version
- hugo
- echo $(date +%Y.%m.%d)
- tar cz public | ssh gitlab@hsbxl.be "mkdir -p /www/versions/$(date +%Y.%m.%d); cd /www/versions/$(date +%Y.%m.%d); tar xz; rm /www/live; ln -sf versions/$(date +%Y.%m.%d)/public /www/live"
artifacts:
paths:
- public
only:
- master
~~~~
Placing this file named .gitlab-ci.yml in the root of a git repo on Gitlab is enough to define the setup.
Just add some variables, like the ssh pubkey of your target server and you're done.
For the SSH user to push the build website from the Gitlab container over to our server,
we created a '
[
jailed CI user
](
../jailed_ci_user
)
'. Read the project page on how we set this up.
\ No newline at end of file
This diff is collapsed.
Click to expand it.
static/images/website.png
0 → 100644
+
0
−
0
View file @
1ef52e34
56.3 KiB
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