#!/usr/bin/env php
<?php

require __DIR__ . '/vendor/autoload.php';

use Shopware\CI\Command\EditReleaseCommand;
use Shopware\CI\Command\ReleaseInfoCommand;
use Shopware\CI\Command\ReleasePackageCommand;
use Shopware\CI\Command\ReleaseTagsCommand;
use Shopware\CI\Command\GenerateChangelogCommand;
use Shopware\CI\Command\ReleasePrepareCommand;
use Shopware\CI\Command\ShowNextTagCommand;
use Shopware\CI\Command\ShowPlatformBranchCommand;
use Symfony\Component\Console\Application;
use Symfony\Component\Dotenv\Dotenv;

$application = new Application('Shopware CI');

if (is_readable(__DIR__ . '/x_env')) {
    (new Dotenv())->load(__DIR__ . '/x_env');
}

$application->add(new GenerateChangelogCommand());
$application->add(new ShowNextTagCommand());
$application->add(new ReleaseTagsCommand());
$application->add(new ReleasePrepareCommand());
$application->add(new ReleasePackageCommand());
$application->add(new EditReleaseCommand());
$application->add(new ShowPlatformBranchCommand());
$application->add(new ReleaseInfoCommand());

$application->run();
