Skip to content
Snippets Groups Projects
Commit 322777e5 authored by darkbit's avatar darkbit
Browse files

Separated building and deploying in the Gitlab CI

As forked projects don't have the permissions to access the
deployment runner, these cannot run the deployment job.
Therefore the build was splitted into two stages, where everyone
can run the build stage, as this only needs a docker compatible runner.
parent fd350a8e
No related branches found
No related tags found
No related merge requests found
Pipeline #1794 passed
deployment:
stage: deploy
only:
- /^testbed*$/i
- /^master*$/i
build:
stage: build
image: python:3
tags:
- docker
script:
- cd flamingo
- echo $CI_COMMIT_REF_SLUG > REF_SLUG
- make html
- touch /var/www/$CI_COMMIT_REF_SLUG/htdocs/foo
- rm -r /var/www/$CI_COMMIT_REF_SLUG/htdocs/*
- cp -r output/* /var/www/$CI_COMMIT_REF_SLUG/htdocs/
artifacts:
paths:
- flamingo/output
expire_in: 1 week
deployment:
stage: deploy
tags:
- ffbs-deploy
only:
refs:
- master
- /^testbed/i
variables:
- $CI_PROJECT_PATH == "ffbs/ffbs-website"
script:
- rm -r /var/www/$CI_COMMIT_REF_SLUG/htdocs
- cp -r flamingo/output /var/www/$CI_COMMIT_REF_SLUG/htdocs
- chmod go+r -R /var/www/$CI_COMMIT_REF_SLUG/htdocs/*
- touch /var/www/$CI_COMMIT_REF_SLUG/cgi/foo
- rm -r /var/www/$CI_COMMIT_REF_SLUG/cgi/*
- cp -r ../cgi/* /var/www/$CI_COMMIT_REF_SLUG/cgi/
- rm -r /var/www/$CI_COMMIT_REF_SLUG/cgi
- cp -r cgi /var/www/$CI_COMMIT_REF_SLUG/cgi
- chmod go+r -R /var/www/$CI_COMMIT_REF_SLUG/cgi/*
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment