Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
concrexit
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
70
Issues
70
List
Boards
Labels
Service Desk
Milestones
Merge Requests
10
Merge Requests
10
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
thalia
concrexit
Commits
f6836ea4
Verified
Commit
f6836ea4
authored
Mar 18, 2019
by
Jelle Besseling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add docs static html pushing in gitlab ci
parent
1f6da51f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
20 deletions
+61
-20
.gitlab-ci.yml
.gitlab-ci.yml
+58
-4
Dockerfile
Dockerfile
+3
-15
resources/entrypoint_production.sh
resources/entrypoint_production.sh
+0
-1
No files found.
.gitlab-ci.yml
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
...
...
Dockerfile
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!"
resources/entrypoint_production.sh
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
...
...
Write
Preview
Markdown
is supported
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