Commit 1b34d90f authored by Pietro Saccardi's avatar Pietro Saccardi

Using yaml anchors to type script only once

parent 2b48cd11
Pipeline #510 canceled with stages
in 4 minutes and 23 seconds
......@@ -16,12 +16,8 @@ build:lektor:
- www
staging:testing:
stage: staging
.deploy_template: &deploy_definition # Hidden key that defines an anchor named 'job_definition'
image: nikolaik/python-nodejs
environment:
name: staging
url: https://www.test.mittelab.org
before_script:
- apt-get update -qq
- apt-get install -qq -yy rsync
......@@ -29,29 +25,28 @@ staging:testing:
- chmod 700 ~/.ssh
- echo "${DEPLOY_KNOWN_HOST}" > ~/.ssh/known_hosts
- pipenv install
script:
- pipenv run lektor deploy -O www --key "${DEPLOY_KEY}" --username "${DEPLOY_USER}" testing
only:
- master
staging:testing:
stage: staging
<<: *deploy_definition
environment:
name: staging
url: https://www.test.mittelab.org
script:
- pipenv run lektor deploy -O www --key "${DEPLOY_KEY}" --username "${DEPLOY_USER}" testing
deploy:production:
stage: deploy
image: nikolaik/python-nodejs
<<: *deploy_definition
environment:
name: deploy
url: https://www.mittelab.org
before_script:
- apt-get update -qq
- apt-get install -qq -yy rsync
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "${DEPLOY_KNOWN_HOST}" > ~/.ssh/known_hosts
- pipenv install
script:
- pipenv run lektor deploy -O www --key "${DEPLOY_KEY}" --username "${DEPLOY_USER}" production
only:
- master
when: manual
dependencies:
- build:lektor
......
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