Skip to content

Conversation

Fgruntjes
Copy link
Contributor

@Fgruntjes Fgruntjes commented Sep 21, 2022

This allows the run-task command to deploy some file to a server for example:

<?php

namespace Hypernode\DeployConfiguration;

use function Deployer\run;
use function Deployer\task;
use function Deployer\upload;

$configuration = new Configuration();

$productionStage = $configuration->addStage('production', '****');
$productionStage->addServer('****.hypernode.io');

task('app_deploy', static function () {
    $imageTag = getenv('IMAGE_TAG');
    run('mkdir -p /data/web/auth_gateway');
    upload('docker-compose.yaml', '/data/web/auth_gateway/docker-compose.yaml');
    run("echo '$imageTag' > /data/web/auth_gateway/.env");
    run('cd /data/web/auth_gateway && docker-compose up -d');
});

$configuration->addDeployTask('app_deploy');

return $configuration;

Copy link
Member

@tdgroot tdgroot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, this looks neat! :)

@Fgruntjes Fgruntjes merged commit e64014e into master Sep 21, 2022
@vdloo vdloo deleted the run-task-server-build-configuration branch September 21, 2022 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants