Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
concrexit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
thalia
concrexit
Commits
f6836ea4
Verified
Commit
f6836ea4
authored
5 years ago
by
Jelle Besseling
Browse files
Options
Downloads
Patches
Plain Diff
Add docs static html pushing in gitlab ci
parent
1f6da51f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1195
Add docs static html pushing in gitlab ci to docs.technicie.nl
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+58
-4
58 additions, 4 deletions
.gitlab-ci.yml
Dockerfile
+3
-15
3 additions, 15 deletions
Dockerfile
resources/entrypoint_production.sh
+0
-1
0 additions, 1 deletion
resources/entrypoint_production.sh
with
61 additions
and
20 deletions
.gitlab-ci.yml
+
58
−
4
View file @
f6836ea4
...
...
@@ -67,7 +67,8 @@ python37-django21:
-
mkdir -p ~/.ssh
-
echo "$IVO_KNOWN_HOST" > ~/.ssh/known_hosts
-
echo "$COVERAGE_DEPLOY_SSH_KEY" > ~/.ssh/id_coverage
-
chmod 0600 ~/.ssh/id_coverage
-
echo "$DOCS_DEPLOY_SSH_KEY" > ~/.ssh/id_docs
-
chmod 0600 ~/.ssh/id_*
-
apt-get update
-
apt-get install -y openssh-client
...
...
@@ -77,7 +78,7 @@ coverage deploy:
dependencies
:
-
python37-django21
environment
:
name
:
review
/${CI_COMMIT_REF_NAME}
name
:
coverage
/${CI_COMMIT_REF_NAME}
url
:
https://coverage.technicie.nl/${CI_COMMIT_REF_SLUG}/
on_stop
:
coverage remove
<<
:
*sshsetup
...
...
@@ -94,7 +95,7 @@ coverage remove:
when
:
manual
image
:
debian:stretch
environment
:
name
:
review
/${CI_COMMIT_REF_NAME}
name
:
coverage
/${CI_COMMIT_REF_NAME}
action
:
stop
variables
:
GIT_STRATEGY
:
none
...
...
@@ -106,7 +107,7 @@ coverage remove:
rmdir ${CI_COMMIT_REF_SLUG}
EOF
docs
:
docs
tests
:
stage
:
test
image
:
$PY36_IMAGE
before_script
:
...
...
@@ -120,6 +121,59 @@ docs:
-
echo "Checking if there are changes"
-
poetry run ./generate-apidocs.sh
-
git diff --exit-code
artifacts
:
paths
:
-
docs/_build
docs deploy
:
stage
:
deploy
image
:
debian:stretch
dependencies
:
-
docs tests
environment
:
name
:
docs/${CI_COMMIT_REF_NAME}
url
:
https://docs.technicie.nl/${CI_COMMIT_REF_SLUG}/
on_stop
:
docs remove
<<
:
*sshsetup
script
:
-
|
sftp -i ~/.ssh/id_docs docswww@ivo.thalia.nu -b <<EOF
-rm ${CI_COMMIT_REF_SLUG}/*/*
-rm ${CI_COMMIT_REF_SLUG}/*
-rmdir ${CI_COMMIT_REF_SLUG}/_images
-rmdir ${CI_COMMIT_REF_SLUG}/_modules
-rmdir ${CI_COMMIT_REF_SLUG}/_sources
-rmdir ${CI_COMMIT_REF_SLUG}/_static
-rmdir ${CI_COMMIT_REF_SLUG}/doctest
-rmdir ${CI_COMMIT_REF_SLUG}/doctrees
-rmdir ${CI_COMMIT_REF_SLUG}
-mkdir ${CI_COMMIT_REF_SLUG}
put -r docs/_build/* ${CI_COMMIT_REF_SLUG}
EOF
docs remove
:
stage
:
deploy
when
:
manual
image
:
debian:stretch
environment
:
name
:
docs/${CI_COMMIT_REF_NAME}
action
:
stop
variables
:
GIT_STRATEGY
:
none
<<
:
*sshsetup
script
:
-
|
sftp -i ~/.ssh/id_docs docswww@ivo.thalia.nu -b <<EOF
rm ${CI_COMMIT_REF_SLUG}/*/*
rm ${CI_COMMIT_REF_SLUG}/*
rmdir ${CI_COMMIT_REF_SLUG}/_images
rmdir ${CI_COMMIT_REF_SLUG}/_modules
rmdir ${CI_COMMIT_REF_SLUG}/_sources
rmdir ${CI_COMMIT_REF_SLUG}/_static
rmdir ${CI_COMMIT_REF_SLUG}/doctest
rmdir ${CI_COMMIT_REF_SLUG}/doctrees
rmdir ${CI_COMMIT_REF_SLUG}
EOF
build docker image
:
stage
:
test
...
...
This diff is collapsed.
Click to expand it.
Dockerfile
+
3
−
15
View file @
f6836ea4
...
...
@@ -23,11 +23,9 @@ ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
RUN
mkdir
/concrexit
&&
\
mkdir
-p
/concrexit/log/
&&
\
touch
/concrexit/log/uwsgi.log
&&
\
mkdir
-p
/concrexit/docs/
&&
\
chown
-R
www-data:www-data /concrexit
&&
\
mkdir
-p
/usr/src/app
&&
\
mkdir
-p
/usr/src/app/website
&&
\
mkdir
-p
/usr/src/app/docs
mkdir
-p
/usr/src/app/website
# Install dependencies
RUN
apt-get update
&&
apt-get
install
-y
--no-install-recommends
\
...
...
@@ -44,10 +42,10 @@ WORKDIR /usr/src/app/website/
COPY
pyproject.toml /usr/src/app/website/
COPY
poetry.lock /usr/src/app/website/
RUN if
[
"
$install_dev_requirements
"
-eq
1
]
;
then
\
poetry
install
--no-interaction
--extras
"docs"
;
\
poetry
install
--no-interaction
;
\
else
\
echo
"This will fail if the dependencies are out of date"
;
\
poetry
install
--no-interaction
--extras
"docs"
--no-dev
;
\
poetry
install
--no-interaction
--no-dev
;
\
fi
;
\
poetry cache:clear
--all
--no-interaction
pypi
...
...
@@ -60,14 +58,4 @@ RUN chmod +x /usr/local/bin/entrypoint.sh && \
# copy app source
COPY
website /usr/src/app/website/
# Copy files for Sphinx documentation
COPY
README.md /usr/src/app/
COPY
docs /usr/src/app/docs
RUN
sphinx-build
-c
/usr/src/app/docs/ /usr/src/app/docs/ /usr/src/app/docs/_build
&&
\
tar
--create
--xz
--file
=
/usr/src/app/docs.tar.xz
--directory
=
/usr/src/app/docs/_build/
.
&&
\
rm
--recursive
/usr/src/app/docs/
# Cache docs between builds if not mounting to FS
VOLUME
/concrexit/docs
RUN
echo
"Don't build releases yourself, let CI do it!"
This diff is collapsed.
Click to expand it.
resources/entrypoint_production.sh
+
0
−
1
View file @
f6836ea4
...
...
@@ -2,7 +2,6 @@
set
-e
tar
--extract
--xz
--file
=
/usr/src/app/docs.tar.xz
--directory
=
/concrexit/docs/
chown
-R
www-data:www-data /concrexit/
until
psql
-h
"
$DJANGO_POSTGRES_HOST
"
-U
"postgres"
-c
'\l'
"
$POSTGRES_DB
"
;
do
...
...
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