Skip to content
Snippets Groups Projects
Verified Commit 86eb1e59 authored by Frank Sauerburger's avatar Frank Sauerburger
Browse files

Add deployment jobs

parent cc2a5907
No related branches found
No related tags found
1 merge request!6Resolve "Add deployment"
Pipeline #3179 failed
variables:
LOCAL_DIR: public
stages:
- build
- test_deployment
- production_deployment
.sftp: &sftp_template
image: ${CI_REGISTRY_IMAGE}/ubuntu_sftp
tags:
- wasenweiler.sit-servers.net
script:
- mkdir -p ~/.ssh
- echo "${SFTP_KEY}" > ~/.ssh/id_rsa
- echo "${SFTP_HOSTCERT}" > ~/.ssh/known_hosts
- chmod 600 ~/.ssh/*
- mv ${LOCAL_DIR} ${REMOTE_DIR}
- sftp ${SFTP_USERNAME}@${SFTP_HOST} <<< "put -r ${REMOTE_DIR}"
brunch_build:
stage: build
image: node
before_script:
- npm i -g brunch
script:
- brunch b --production
artifacts:
paths:
- public/*
expire_in: 3 days
test_deploy:
stage: test_deployment
dependencies:
- brunch_build
variables:
SFTP_USERNAME: ${TEST_USERNAME}
SFTP_KEY: ${TEST_KEY}
SFTP_HOST: ${TEST_HOST}
SFTP_HOSTCERT: ${TEST_HOSTCERT}
REMOTE_DIR: ${TEST_DIR}
GIT_STRATEGY: none
environment:
name: Preview
url: https://longroute.preview.sauerburger.com/
<<: *sftp_template
production_deploy:
stage: production_deployment
dependencies:
- brunch_build
variables:
SFTP_USERNAME: ${PRODUCTION_USERNAME}
SFTP_KEY: ${PRODUCTION_KEY}
SFTP_HOST: ${PRODUCTION_HOST}
SFTP_HOSTCERT: ${PRODUCTION_HOSTCERT}
REMOTE_DIR: ${PRODUCTION_DIR}
GIT_STRATEGY: none
only:
- master
when: manual
environment:
name: Production
url: https://longroute.sauerburger.com/
<<: *sftp_template
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