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