Skip to content
GitLab
About GitLab
GitLab: the DevOps platform
Explore GitLab
Install GitLab
How GitLab compares
Get started
GitLab docs
GitLab Learn
Pricing
Talk to an expert
Help
What's new
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Menu
Projects
Groups
Snippets
Sign up now
Login
Sign in / Register
Toggle navigation
Menu
Open sidebar
hsbxl
site
Commits
1ef52e34
Commit
1ef52e34
authored
Nov 16, 2018
by
betz
Browse files
website project
parent
c03f4fc9
Pipeline
#36794284
passed with stages
in 1 minute and 1 second
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
content/projects/website/index.md
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
static/images/website.png
0 → 100644
View file @
1ef52e34
56.3 KB
Write
Preview
Supports
Markdown
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