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

gitlab-ci: avoid deleting attachments

parent 11a972cb
Pipeline #3654 passed with stages
in 3 minutes and 22 seconds
......@@ -28,7 +28,7 @@ apache-dev:
tags:
- docker
variables:
PUBLISH_DIR: "/var/www/calcul-dev/$CI_COMMIT_REF_NAME"
PUBLISH_DIR: "gitlab-runner@calcul.math.unistra.fr:/var/www/calcul-dev/$CI_COMMIT_REF_NAME"
only:
- pr_branch_deploy
- TEST-job-form
......@@ -42,29 +42,18 @@ apache-dev:
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
## We're using tr to fix line endings which makes ed25519 keys work
## without extra base64 encoding.
## https://gitlab.com/gitlab-examples/ssh-private-key/issues/1#note_48526556
##
# 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
- whoami
- ssh gitlab-runner@calcul.math.unistra.fr
script:
- echo "Publishing to $PUBLISH_DIR"
- sed "s/^[[:space:]]*SITEURL[[:space:]]*=.*/SITEURL = 'https:\/\/calcul-dev.math.unistra.fr\/$CI_COMMIT_REF_NAME'/" publishconf.py > publishconf-dev.py
- pelican -s publishconf-dev.py --fatal errors
- rsync -av --delete output/ gitlab-runner@calcul.math.unistra.fr:$PUBLISH_DIR/
- whoami
- rsync -av --delete content/attachments/ gitlab-runner@calcul.math.unistra.fr:$PUBLISH_DIR/attachments/
- rsync -av --delete --filter 'protect $PUBLISH_DIR/attachments/' output/ $PUBLISH_DIR/
- rsync -av --delete content/attachments/ $PUBLISH_DIR/attachments/
Supports Markdown
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