Commit dfda85e6 authored by Matthieu Boileau's avatar Matthieu Boileau
Browse files

Update .gitlab-ci.yml

try to simplify
parent 98d09af4
Pipeline #3683 failed
......@@ -3,29 +3,14 @@ stages:
- build
- deploy
# Only for publishing stages, must be overridden in other stages
before_script:
# Run ssh-agent (inside the build environment)
- eval $(ssh-agent -s)
# Add ssh private key
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
# Create the SSH directory and give it the right permissions
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
# Ensure host is verified
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- echo "Publishing to $PUBLISH_DIR"
deps:
stage: deps
tags:
- pelican
before_script:
script:
- echo "Building $CI_REGISTRY_IMAGE"
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker info
script:
- docker build --pull -t $CI_REGISTRY_IMAGE -f ./docker/Dockerfile .
- docker push $CI_REGISTRY_IMAGE
......@@ -34,9 +19,8 @@ build:
image: $CI_REGISTRY_IMAGE
tags:
- docker
before_script:
- echo "Building website using docker image $CI_REGISTRY_IMAGE"
script:
- echo "Building website using docker image $CI_REGISTRY_IMAGE"
- pelican -s publishconf.py --fatal errors
artifacts:
untracked: true
......@@ -46,8 +30,6 @@ apache-dev:
stage: deploy
tags:
- pelican
variables:
PUBLISH_DIR: "/var/www/calcul-dev/$CI_COMMIT_REF_NAME"
only:
- pr_branch_deploy
- TEST-job-form
......@@ -58,17 +40,16 @@ apache-dev:
- embed_twitter_v2
dependencies:
- build
before_script:
- echo "Publishing to $PUBLISH_DIR"
script:
- [ "$CI_COMMIT_REF_NAME" == "master" ] && PUBLISH_DIR="/var/www/html" || PUBLISH_DIR="/var/www/calcul-dev/$CI_COMMIT_REF_NAME"
- echo "Publishing branch $CI_COMMIT_REF_NAME to $PUBLISH_DIR"
- rsync -av --delete --exclude 'attachments' output/ $PUBLISH_DIR/
- rsync -avv --delete content/attachments/ $PUBLISH_DIR/attachments/
- rsync -av --delete content/attachments/ $PUBLISH_DIR/attachments/
apache:
stage: deploy
image: $CI_REGISTRY_IMAGE
tags:
- docker
- pelican
variables:
PUBLISH_DIR: "gitlab-runner@calcul.math.unistra.fr:/var/www/html"
only:
......@@ -76,6 +57,7 @@ apache:
dependencies:
- build
script:
- echo "Publishing to $PUBLISH_DIR"
- rsync -av --delete --exclude 'attachments' output/ $PUBLISH_DIR/
- rsync -av --delete content/attachments/ $PUBLISH_DIR/attachments/
......@@ -87,7 +69,6 @@ update-issue:
only:
- develop
dependencies: []
before_script:
- echo "Updating issue \#49"
script:
- echo "Updating issue \#49"
- python3 utils/follow_transfer.py --issue
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