Commit c9c2233d authored by Christophe Benz's avatar Christophe Benz

Use GitLab Pages

parent 515677af
Pipeline #157017 failed with stage
in 5 minutes and 24 seconds
stages:
- docker
- build
- deploy
Build CI Docker image:
stage: docker
when: manual
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile.ci --destination $CI_REGISTRY_IMAGE:latest
Generate dashboard:
stage: build
pages:
stage: deploy
image: python:3.8
variables:
FETCHERS_YML: https://git.nomics.world/dbnomics-fetchers/management/raw/master/fetchers.yml
GITLAB_BASE_URL: https://git.nomics.world
......@@ -23,7 +9,6 @@ Generate dashboard:
NB_DATA_MODEL_JOBS: "1000"
NB_IMPORTER_JOBS: "1000"
PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache/pip"
image: python:3.8
cache:
paths:
- .cache/pip
......@@ -32,56 +17,10 @@ Generate dashboard:
before_script:
- python -m venv venv
- source venv/bin/activate
- pip install --requirement requirements.txt
- pip install -r requirements.txt
- mkdir public
script:
- python generate-dashboard.py > dashboard.html
- python generate-dashboard.py > public/index.html
artifacts:
paths:
- dashboard.html
.deploy_job:
stage: deploy
variables:
DASHBOARD_HOST: dashboard.db.nomics.world
GIT_STRATEGY: none
image: $CI_REGISTRY_IMAGE:latest
before_script:
# Run ssh-agent (inside the build environment).
- eval $(ssh-agent -s)
# Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store.
- ssh-add <(echo "$SSH_PRIVATE_KEY")
# Add the SSH keys of remote Git servers, to disable host key checking questions.
- mkdir -p ~/.ssh
- ssh-keyscan -t rsa $DASHBOARD_HOST >> ~/.ssh/known_hosts
Deploy review dashboard:
extends: .deploy_job
only:
- branches
except:
- master
environment:
name: review/$CI_COMMIT_REF_NAME
url: https://$DASHBOARD_HOST/$CI_COMMIT_REF_NAME.html
on_stop: Stop review dashboard
script:
- scp dashboard.html dashboard@$DASHBOARD_HOST:dbnomics-dashboard-static/$CI_COMMIT_REF_NAME.html
Stop review dashboard:
extends: .deploy_job
when: manual
environment:
name: review/$CI_COMMIT_REF_NAME
action: stop
script:
- ssh dashboard@$DASHBOARD_HOST "rm dbnomics-dashboard-static/$CI_COMMIT_REF_NAME.html"
Deploy production dashboard:
extends: .deploy_job
only:
- master
environment:
name: production
url: https://$DASHBOARD_HOST/
script:
- scp dashboard.html dashboard@$DASHBOARD_HOST:dbnomics-dashboard-static/index.html
- public/
FROM debian:stable
RUN apt-get update && apt-get -y install ssh
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment