Skip to content
Snippets Groups Projects
Commit 21309f2c authored by Kocher, Manuel's avatar Kocher, Manuel
Browse files

Merge branch 'master' into dbp-translation-component

parents f69672e8 7a2e492e
No related branches found
No related tags found
No related merge requests found
Pipeline #113329 passed
image: registry.gitlab.tugraz.at/dbp/web-components/toolkit/main:v1
image: registry.gitlab.tugraz.at/dbp/web-components/toolkit/main:v2
cache:
key: ${CI_PROJECT_PATH}
......@@ -51,8 +51,10 @@ publish:
- chmod 700 ~/.ssh && chmod 600 ~/.ssh/id_rsa
- ssh-keyscan -t rsa "${DEPLOY_HOST}" >> ~/.ssh/known_hosts
# Deploy
- cd toolkit-showcase
- dep deploy --file ./../.gitlab-ci/deploy.php "${CI_ENVIRONMENT_NAME}"
- cd .gitlab-ci
- export DO_NOT_TRACK=1
- composer install
- composer exec -- deployer.phar deploy "stage=${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}"
......
vendor/
\ No newline at end of file
FROM debian:buster
FROM debian:bullseye
ENV LANG C.UTF-8
ENV DEBIAN_FRONTEND noninteractive
......@@ -26,6 +26,7 @@ RUN apt-get update && apt-get install -y \
firefox-esr \
composer \
php-zip \
php-curl \
rsync \
sudo \
&& rm -rf /var/lib/apt/lists/*
......@@ -34,11 +35,3 @@ RUN useradd -u 1000 -ms /bin/bash user
RUN echo 'user ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
USER user
WORKDIR /home/user
# Install deployer globally and add it to PATH
ENV COMPOSER_HOME="/home/user/.composer"
RUN mkdir -p "${COMPOSER_HOME}"
ADD composer.lock "${COMPOSER_HOME}"
ADD composer.json "${COMPOSER_HOME}"
RUN composer global install
ENV PATH "${COMPOSER_HOME}/vendor/bin:${PATH}"
\ No newline at end of file
#!/bin/bash
set -e
TAG="registry.gitlab.tugraz.at/dbp/web-components/toolkit/main:v1"
TAG="registry.gitlab.tugraz.at/dbp/web-components/toolkit/main:v2"
sudo docker build --tag "${TAG}" --file "Dockerfile" .
echo "Now run: sudo docker push '$TAG'"
{
"require": {
"symfony/process": " ^4.4",
"symfony/console": " ^4.4",
"symfony/yaml": " ^4.4",
"deployer/deployer": " ^6.4",
"deployer/recipes": " ^6.2"
"symfony/process": " ^5.0",
"symfony/console": " ^5.0",
"symfony/yaml": " ^5.0",
"deployer/deployer": "^7.0.0-rc.3"
},
"config": {
"platform": {
"php": "7.3"
}
}
}
This diff is collapsed.
<?php
declare(strict_types=1);
namespace Deployer;
require 'recipe/common.php';
require 'recipe/rsync.php';
import('recipe/common.php');
import('contrib/rsync.php');
// Global config
set('allow_anonymous_stats', false);
$PROJECT_ROOT = dirname(__DIR__).'/toolkit-showcase';
set('rsync',[
'exclude' => [
'.git',
'deploy.php',
],
$RSYNC_CONFIG = [
'exclude' => [],
'exclude-file' => false,
'include' => [],
'include' => [],
'include-file' => false,
'filter' => [],
'filter-file' => false,
'filter-perdir'=> false,
'flags' => 'rz',
'options' => ['delete'],
'timeout' => 60,
]);
set('rsync_src', __DIR__ . '/../toolkit-showcase/dist');
set('rsync_dest','{{release_path}}');
'filter' => [],
'filter-file' => false,
'filter-perdir' => false,
'flags' => 'rz',
'options' => ['delete', 'links'],
'timeout' => 60,
];
// Hosts
host('demo')
->stage('demo')
->hostname('mw@vpu01-demo.tugraz.at')
->set('labels', ['stage' => 'demo'])
->setHostname('mw@vpu01-demo.tugraz.at')
->set('rsync', $RSYNC_CONFIG)
->set('rsync_src', $PROJECT_ROOT.'/dist')
->set('deploy_path', '/home/mw/demo/deploy/apps/demo');
host('development')
->stage('development')
->hostname('mw@mw01-dev.tugraz.at')
->set('labels', ['stage' => 'development'])
->setHostname('mw@mw01-dev.tugraz.at')
->set('rsync', $RSYNC_CONFIG)
->set('rsync_src', $PROJECT_ROOT.'/dist')
->set('deploy_path', '/home/mw/dev/deploy/apps/demo');
task('build', function () {
$stage = get('stage');
runLocally("yarn install --frozen-lockfile");
runLocally("APP_ENV=$stage yarn run build");
task('build', function () use ($PROJECT_ROOT) {
$options = ['cwd' => $PROJECT_ROOT];
$stage = get('labels')['stage'];
runLocally("yarn install --frozen-lockfile", $options);
runLocally("APP_ENV=$stage yarn run build", $options);
});
// Deploy task
task('deploy', [
'deploy:info',
'build',
'deploy:prepare',
'deploy:setup',
'deploy:lock',
'deploy:release',
'rsync',
'deploy:shared',
'deploy:symlink',
'deploy:unlock',
'cleanup',
'success',
'deploy:cleanup',
'deploy:success',
]);
after('deploy:failed', 'deploy:unlock');
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment