Skip to content

Commit afae366

Browse files
committed
🎉 initial commit
0 parents  commit afae366

19 files changed

+1978
-0
lines changed

.gitignore

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# macOS
2+
.DS_Store
3+
.Thumbs.db
4+
5+
# virtualenv
6+
venv
7+
8+
# Installer logs
9+
pip-log.txt
10+
pip-delete-this-directory.txt
11+
12+
13+
# ansible
14+
*.retry
15+
16+
# Sphinx
17+
build
18+
19+
# CI
20+
.sshkey

.gitlab-ci.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
---
2+
image: uberspace/ansible:2.4
3+
4+
5+
variables:
6+
DEPLOYMENT_SSH_KEY_PATH: /tmp/.deployment-ssh-key
7+
8+
9+
stages:
10+
- build
11+
- deploy
12+
13+
14+
before_script:
15+
# GitLab inserts a \r for each newline into our private key. This confuses the ssh client.
16+
- umask 077; echo "$SSH_KEY" | tr -d '\r' > $DEPLOYMENT_SSH_KEY_PATH
17+
# Dependencies
18+
- pip install --quiet -r requirements.txt
19+
20+
21+
Build HTML:
22+
stage: build
23+
script:
24+
- make html
25+
artifacts:
26+
paths:
27+
- build
28+
29+
30+
Deploy to staging:
31+
stage: deploy
32+
except:
33+
- stable
34+
script:
35+
- ansible-playbook deploy.yml --private-key=$DEPLOYMENT_SSH_KEY_PATH
36+
variables:
37+
DOMAIN: $CI_BUILD_REF_SLUG.lab.corona.uberspace.de
38+
environment:
39+
name: staging/$CI_BUILD_REF_SLUG
40+
url: http://$CI_BUILD_REF_SLUG.lab.corona.uberspace.de
41+
42+
43+
Deploy to production:
44+
stage: deploy
45+
only:
46+
- stable
47+
script:
48+
- ansible-playbook deploy.yml --private-key=$DEPLOYMENT_SSH_KEY_PATH
49+
variables:
50+
DOMAIN: lab.uberspace.de
51+
environment:
52+
name: production
53+
url: https://lab.uberspace.de

Makefile

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line.
5+
SPHINXOPTS =
6+
SPHINXBUILD = sphinx-build
7+
SPHINXPROJ = Uberspace7lab
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

ansible.cfg

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[defaults]
2+
host_key_checking = False
3+
inventory=inventory-prod
4+
5+
[ssh_connection]
6+
pipelining = True
7+
control_path=/tmp/ansible-ssh-%%h-%%p-%%r

deploy.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
3+
- name: deploy
4+
hosts: all
5+
vars:
6+
docroot: /var/www/virtual/{{ ansible_user }}/{{ lookup('env', 'DOMAIN') }}
7+
tasks:
8+
- name: create document root
9+
file:
10+
path: "{{ docroot }}"
11+
state: directory
12+
13+
- name: copy HTML
14+
synchronize:
15+
src: "build/html/"
16+
dest: "{{ docroot }}/en"
17+
recursive: yes
18+
delete: yes
19+
20+
- name: create .htaccess
21+
copy:
22+
content: |
23+
RewriteEngine On
24+
RewriteCond %{HTTPS} !=on
25+
RewriteCond %{ENV:HTTPS} !=on
26+
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
27+
RewriteRule ^$ /en/ [R]
28+
dest: "{{ docroot }}/.htaccess"
29+
30+
- name: Correct Ownership of DocumentRoot
31+
file:
32+
path: "{{ docroot }}"
33+
state: directory
34+
recurse: yes
35+
mode: 0755

inventory-prod

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
corona.uberspace.de ansible_user=lab

requirements.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Sphinx==1.7.*
2+
sphinx-rtd-theme==0.2.*
3+
feedgen==0.6.1

source/_static/css/custom.css

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/* footer */
2+
.wy-nav-content {
3+
position: relative;
4+
background-image: url("../images/footer.svg");
5+
background-position: bottom;
6+
background-repeat: no-repeat;
7+
background-size: 75%;
8+
min-height: 100vh;
9+
}
10+
11+
.document {
12+
min-height: 500px;
13+
margin-bottom: 8rem;
14+
}
15+
16+
footer {
17+
position: absolute;
18+
bottom:0;
19+
left: 0;
20+
right: 0;
21+
padding-bottom: 1rem;
22+
text-align: center;
23+
font-size: 80%;
24+
color: #222222;
25+
}
26+
27+
/* navigation */
28+
.wy-side-nav-search {
29+
padding-top: 170px;
30+
background-image: url("../images/rocket.svg");
31+
background-position: top;
32+
background-repeat: no-repeat;
33+
background-color: #222222;
34+
}
35+
36+
.wy-menu-vertical a:active {
37+
background-color: #e2001a;
38+
cursor: pointer;
39+
color: #fff;
40+
}
41+
42+
.wy-menu-vertical header, .wy-menu-vertical p.caption :first-child::before {
43+
content: url("../images/icn-rocket.svg");
44+
margin-left: -.1618em;
45+
width: 30px;
46+
float: left;
47+
padding: .1618em;
48+
}
49+
50+
.wy-menu-vertical header, .wy-menu-vertical p.caption {
51+
margin-top: .809em;
52+
color: #999999;
53+
}
54+
55+
.wy-menu-vertical header, .wy-menu-vertical ul.toctree-l1 {
56+
margin-top: .809em;
57+
color: #999999;
58+
}
59+
60+
nav li {
61+
padding-left: 10px;
62+
}
63+
64+
/* search box */
65+
.wy-side-nav-search input[type=text] {
66+
border-color: #84000f;
67+
}

source/_static/favicon.ico

2.81 KB
Binary file not shown.

0 commit comments

Comments
 (0)