-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'wjs-develop' into feature/issue-785-special-issue
- Loading branch information
Showing
33 changed files
with
8,477 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,5 @@ src/files/press | |
src/files/temp | ||
src/files/xsl | ||
src/plugins/* | ||
src/media/* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
default: | ||
cache: | ||
key: cache-default | ||
paths: | ||
- .cache | ||
- /var/cache | ||
|
||
stages: | ||
- build | ||
- deploy | ||
|
||
include: | ||
- project: 'wjs/wjs-profile-project' | ||
ref: master | ||
file: '.gitlab-ci-pkg-deploy.yml' | ||
|
||
|
||
deploy_to_test: | ||
extends: | ||
- .deploy | ||
tags: | ||
- inasset | ||
variables: | ||
SERVER_IP: "$TEST_SERVER_IP" | ||
SERVER_USER: "$TEST_SERVER_USER" | ||
DEPLOY_CMD: "deploy-test-janeway" | ||
environment: | ||
name: development | ||
url: https://wjs-test-test-journals.wjapp.it/ | ||
rules: | ||
- if: $CI_COMMIT_BRANCH == "wjs-develop" | ||
|
||
|
||
deploy_to_dev: | ||
extends: | ||
- .deploy | ||
tags: | ||
- inasset | ||
variables: | ||
SERVER_IP: "$TEST_SERVER_IP" | ||
SERVER_USER: "$TEST_SERVER_USER" | ||
DEPLOY_CMD: "deploy-dev-janeway" | ||
environment: | ||
name: development | ||
url: https://wjs-test-dev-journals.wjapp.it/ | ||
rules: | ||
- if: $CI_COMMIT_BRANCH == "wjs-develop" | ||
when: manual | ||
|
||
deploy_to_pp: | ||
extends: | ||
- .deploy | ||
tags: | ||
- inasset | ||
variables: | ||
SERVER_IP: "$TEST_SERVER_IP" | ||
SERVER_USER: "$TEST_SERVER_USER" | ||
DEPLOY_CMD: "deploy-pp-janeway" | ||
environment: | ||
name: pre-production | ||
url: https://wjs-test-pp-journals.wjapp.it/ | ||
when: manual | ||
|
||
|
||
deploy_to_production: | ||
extends: | ||
- .deploy | ||
tags: | ||
- inasset | ||
variables: | ||
SERVER_IP: "$PROD_SERVER_IP" | ||
SERVER_USER: "$PROD_SERVER_USER" | ||
DEPLOY_CMD: "deploy-prod-janeway" | ||
environment: | ||
name: production | ||
url: https://journals.sissamedialab.it/ | ||
when: manual | ||
|
||
|
||
.build_janeway_image: | ||
stage: build | ||
|
||
# Important: runners that should support dind must have | ||
# volumes = ["/certs/client",... | ||
# privileged = true | ||
tags: | ||
- dind | ||
- inasset | ||
|
||
# We get | ||
# *** WARNING: Service ... probably didn't start properly. | ||
# Ignore for now; see: | ||
# https://gitlab.com/gitlab-org/gitlab-runner/-/issues/4550 | ||
services: | ||
- docker:dind | ||
|
||
# I wasn't able to find a way to use the group-level container registry from CI/CD | ||
# See https://gitlab.com/gitlab-org/gitlab/-/issues/218285 | ||
# So here I just use the project's registry. | ||
variables: | ||
TAG: "$CI_REGISTRY_IMAGE/debian-python-git-janeway" | ||
|
||
# To cache from the previous image (--cache-from), see | ||
# https://docs.docker.com/engine/reference/commandline/build/#cache-from | ||
# | ||
# To authenticate with the Container Registry, see | ||
# https://docs.gitlab.com/ee/user/packages/container_registry/authenticate_with_container_registry.html | ||
script: | ||
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY | ||
- docker pull $TAG || true | ||
- docker build --tag $TAG --cache-from $TAG --build-arg BUILDKIT_INLINE_CACHE=1 --build-arg CI_JOB_TOKEN=$CI_JOB_TOKEN --build-arg BRANCH=$CI_COMMIT_BRANCH --file ./dockerfiles/Dockerfile.wjs ./dockerfiles | ||
- docker push $TAG | ||
|
||
build_janeway_image_wjs_develop: | ||
extends: | ||
- .build_janeway_image | ||
variables: | ||
TAG: "$CI_REGISTRY_IMAGE/debian-python-git-janeway:develop" | ||
rules: | ||
- if: $CI_COMMIT_BRANCH == "wjs-develop" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# A docker image with Janeway ready to `runserver` from branch jcom | ||
# and with BB typesetting plugin linked into Janeway's plugins folder. | ||
FROM python:3.11 | ||
# The two cache mounts seem to have no effect | ||
# (at least when the image is build from a dind in a CI/CD job) | ||
ARG CI_JOB_TOKEN | ||
ENV CI_JOB_TOKEN ${CI_JOB_TOKEN} | ||
ARG BRANCH | ||
ENV BRANCH ${BRANCH} | ||
RUN --mount=type=cache,mode=0755,target=/var/cache/apt \ | ||
apt-get update && \ | ||
apt-get install -y file \ | ||
python3 python3-dev pip \ | ||
git \ | ||
mariadb-client libmariadb-dev \ | ||
libssl-dev \ | ||
postgresql-client | ||
RUN echo "Cloning Janeway code ${BRANCH}..." && \ | ||
git clone --branch ${BRANCH} --single-branch https://github.com/sissamedialab/janeway.git && \ | ||
cd /janeway && \ | ||
git checkout origin/${BRANCH} && \ | ||
git pull | ||
RUN echo "Installing Janeway requirements..." && \ | ||
pip install -r /janeway/requirements.txt | ||
RUN echo "Cloning typesetting plugin at tag v1.3.0-RC-1..." && \ | ||
cd / && git clone --branch master --single-branch https://github.com/BirkbeckCTP/typesetting && \ | ||
ln -s /typesetting /janeway/src/plugins/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [[ $# -lt 1 ]]; then | ||
echo -e "Missing parameter\nCommand: $0 /path/to/python" | ||
exit 1 | ||
fi | ||
|
||
PYTHON=$1 | ||
|
||
$PYTHON manage.py link_plugins | ||
$PYTHON manage.py install_themes | ||
|
||
$PYTHON manage.py migrate | ||
$PYTHON manage.py build_assets | ||
$PYTHON manage.py collectstatic --noinput | ||
|
||
$PYTHON manage.py add_coauthors_submission_email_settings | ||
$PYTHON manage.py add_generic_analytics_code_setting | ||
$PYTHON manage.py add_publication_alert_settings | ||
$PYTHON manage.py add_user_as_main_author_setting |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.