Skip to content
Snippets Groups Projects
Commit 397aeca2 authored by Steinwender, Tamara's avatar Steinwender, Tamara
Browse files

Add a pipeline for deploying

parent 4b4d8cc1
No related branches found
No related tags found
No related merge requests found
Pipeline #15111 failed
......@@ -31,3 +31,45 @@ publish:
- yarn install
- yarn run build
- yarn run publish
.deploy_defaults: &deploy_defaults
except:
- schedules
stage: deploy
script:
# Add ssh key
- mkdir -p ~/.ssh
- echo "${DEPLOY_KEY}" | tr -d '\r' > ~/.ssh/id_rsa
- chmod 700 ~/.ssh && chmod 600 ~/.ssh/id_rsa
- ssh-keyscan -t rsa "${DEPLOY_HOST}" >> ~/.ssh/known_hosts
# Deploy
- dep deploy "${CI_ENVIRONMENT_NAME}"
- echo "Deployed to ${CI_ENVIRONMENT_URL}"
# Simple health check
- curl --max-time 10 --retry 3 --output /dev/null --silent --show-error --fail --location "${CI_ENVIRONMENT_URL}"
deploy_demo:
only:
refs:
- demo
environment:
name: demo
url: https://frontend-demo.tugraz.at/apps/demo
variables:
DEPLOY_HOST: mw01-dev.tugraz.at
DEPLOY_KEY: "$DEPLOY_SSH_KEY"
<<: *deploy_defaults
deploy_development:
only:
refs:
- master
environment:
name: development
url: https://mw-frontend-dev.tugraz.at/apps/demo
url: https://mw-frontend-dev.tugraz.at/apps/demo
variables:
DEPLOY_HOST: mw01-dev.tugraz.at
DEPLOY_KEY: "$DEPLOY_SSH_KEY"
<<: *deploy_defaults
<?php
namespace Deployer;
require 'recipe/common.php';
require 'recipe/rsync.php';
// Global config
set('allow_anonymous_stats', false);
set('rsync',[
'exclude' => [
'.git',
'deploy.php',
],
'exclude-file' => false,
'include' => [],
'include-file' => false,
'filter' => [],
'filter-file' => false,
'filter-perdir'=> false,
'flags' => 'rz',
'options' => ['delete'],
'timeout' => 60,
]);
set('rsync_src', __DIR__ . '/dist');
set('rsync_dest','{{release_path}}');
// Hosts
host('demo')
->stage('demo')
->hostname('mw@mw01-dev.tugraz.at')
->set('deploy_path', '/home/mw/demo/deploy/apps/demo');
host('development')
->stage('development')
->hostname('mw@mw01-dev.tugraz.at')
->set('deploy_path', '/home/mw/dev/deploy/apps/demo');
// Demo build task
task('build-demo', function () {
runLocally("yarn install");
runLocally("yarn run build-demo");
})->onStage('demo');
// Demo dev task
task('build-development', function () {
runLocally("yarn install");
runLocally("yarn run build-dev");
})->onStage('development');
// Deploy task
task('deploy', [
'deploy:info',
'build-demo',
'build-development',
'build-production',
'deploy:prepare',
'deploy:lock',
'deploy:release',
'rsync',
'deploy:shared',
'deploy:symlink',
'deploy:unlock',
'cleanup',
'success',
]);
after('deploy:failed', 'deploy:unlock');
......@@ -62,7 +62,7 @@ switch (build) {
pdfAsQualifiedlySigningServer = 'sig-dev.tugraz.at';
break;
case 'development':
basePath = '/apps/toolkit-showcase/';
basePath = '/apps/demo/';
entryPointURL = 'https://mw-dev.tugraz.at';
// "/pers" can't go here because it's not allowed in the "Content-Security-Policy"
nextcloudBaseURL = 'https://nc-dev.tugraz.at';
......@@ -74,6 +74,7 @@ switch (build) {
keyCloakClientId = 'auth-dev-mw-frontend';
pdfAsQualifiedlySigningServer = 'sig-dev.tugraz.at';
break;
default:
console.error('Unknown build environment: ' + build);
process.exit(1);
......
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