Skip to content

Commit

Permalink
Adds self-update command for phar to autodeploy.
Browse files Browse the repository at this point in the history
  • Loading branch information
typhonius committed Mar 22, 2020
1 parent 607713a commit c9d267b
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 17 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ robo.yml
vendor
.idea
tests/logs
tools
*.phar
41 changes: 25 additions & 16 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
sudo: false
language: php

php:
- 7.1
- 7.2
- 7.3

- 7.1
- 7.2
- 7.3
before_install:
- composer self-update
- composer validate --no-check-all --ansi

- composer self-update
- composer validate --no-check-all --ansi
install:
- travis_retry composer install --no-interaction --prefer-source

- travis_retry composer install --no-interaction --prefer-source
script:
- cd ${TRAVIS_BUILD_DIR}
- composer test

after_script:
- cd ${TRAVIS_BUILD_DIR}
- composer coveralls
- cd ${TRAVIS_BUILD_DIR}
- composer test
after_success:
- cd ${TRAVIS_BUILD_DIR}
- composer coveralls
before_deploy:
- composer phar:install-tools
- rm -rf vendor/*
- composer install --prefer-dist --no-dev --no-interaction
- composer phar:build
deploy:
provider: releases
api_key:
secure: TC2XhUtEj4pjaAEmVKWLUCvQqN+rrm5N1MnS1bVORO7IxcOUCyDkqWnx/N4yfOniTrT0swkO/aBECqjCW52dfn1fkPw9xntpVm20VjG6XUE+L1jctVeEq2KGFYnrQPzUjRVANMYZuLOS5enqhDgLSzuNOhdTIJN2Zt3IERhqcBY39V7+gyZUPN6Zk7NglYH2mLC+0b7qKTRnoZfWAahlFBvayvQzPt8DVlj1J58b+9QFmEBcHjycTIUAHqMRrgYhdz2K4pZ8nWTZN8mcZt8wssNHekYPXPXQSPjoLpbs4ZOeWRpht4bfyvKJAbrG1xV7va1C1WYqWPLbuHUBOt9sc8UtqVY3+W0Zcy4uYXCTei1V21zvb9PO0Z1pGXJRLem/hkohuTvNO+OpKg8rAzglC0uG6FdrwexDM9TsF7hvsAcMYT2zVIzB/WjC4tsIKiJkBS7ljM/FMWAN0PIUvwfyML8ecp8T7KQIKnUIX9dZ4Hrayh4ULPr5M6E57IFJxhAY6/SmHrS1oj7ZhBovp7YpUCbeqrjG0e3qbUe02cc6tyAma5keWyiX7rMcKJxyQOwJVIK9dNiUDh9cxqPXSFzDNSe2oetA0nBc5VYeT4JG2pcH6zGSU+jaDGImQL52TY8ctKXvxZWYbstJ9o/Jur59gOW5r+/KtY+06fwr/Dmlo7w=
file: acquiacli.phar
skip_cleanup: true
on:
tags: true
repo: typhonius/acquia_cli
6 changes: 6 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@
"phpstan/phpstan-phpunit": "^0.11.2"
},
"scripts": {
"phar:install-tools": [
"mkdir -p tools",
"curl -L https://github.com/humbug/box/releases/download/3.8.4/box.phar -o tools/box",
"chmod +x tools/box"
],
"phar:build": "env PATH=tools:$PATH box compile",
"lint": [
"find src -name '*.php' -print0 | xargs -0 -n1 php -l",
"find tests -name '*.php' -print0 | xargs -0 -n1 php -l"
Expand Down
1 change: 1 addition & 0 deletions src/Cli/AcquiaCli.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ public function __construct(
$this->runner = new RoboRunner();
$this->runner->setContainer($container);
$this->runner->registerCommandClasses($application, $commandClasses);
$this->runner->setSelfUpdateRepository('typhonius/acquia_cli');
}

public function getContainer($input, $output, $application, $config, $client)
Expand Down
2 changes: 1 addition & 1 deletion tests/AcquiaCliApplicationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function testVersion()

$actualValue = $this->execute($command);

$this->assertSame('AcquiaCli 2.0.0-dev' . PHP_EOL, $actualValue);
$this->assertContains('AcquiaCli 2', $actualValue);
}

public function testClientOptions()
Expand Down

0 comments on commit c9d267b

Please sign in to comment.