57 Commits

Author SHA1 Message Date
Fritz Michael Gschwantner
fc9a2f13ad
Escape shell arguments correctly (#3603)
* escape shell argument depending on target operating system

* only escape unix style

* add some basic tests

* use json_encode in test

* correctly escape single quotes on the Linux command line
2024-02-11 23:01:51 +01:00
Tom Scott-Malden
97cbbd4d79
Add username in deploy:lock error message (#3046)
* Update to the lock recipe so that it shows you who currently has the lock on the deployment

* DD#0000: feat: Updated joy test

* DD#0000: feat: Regenerated docs
2022-03-22 15:27:41 +01:00
Anton Medvedev
4c1a477b91 Refactor ssh client and host connection option
No more checking of running master ssh connection. This is done automatically by ssh.
No more pre-connect to hosts. On first execution of remote command, ssh connection with multiplexing will be established.
2022-03-22 14:55:43 +01:00
Anton Medvedev
025227885a Remove bin/changelog 2022-03-17 20:51:59 +01:00
Anton Medvedev
5082861bb9 Fixes #2968
Add default host config values
2022-03-13 17:18:36 +01:00
Anton Medvedev
28615d075b Separate legacy and joy tests 2022-03-13 17:08:44 +01:00
Kamil Kuzminski
810ff98e31
Make the Importer class extendable (#3010)
* Make the importer extendable

* Fix the existing unit tests

* Add the unit test
2022-03-10 13:12:09 +01:00
Alex Mayer
2ff8593027
Refactor deploy:cleanup Command (#2788)
* Refactor deploy:cleanup Command

Remove $runOpts since it's not actually used
Move release symlink deletion to beginning of method. This will
allow the release symlink to be deleted even if deleting the old
releases fails.

* Refactor deploy:releases_log

Fixes issue where multiple failed releases in a row cause old
releases to not be cleaned up.

Fixes #2759

Co-authored-by: Anton Medvedev <anton@medv.io>
2022-01-13 14:29:32 +01:00
Anton Medvedev
c1bef57396 Fix once() on a group task 2021-11-21 22:37:15 +01:00
Anton Medvedev
3e1540440e Remove shallow() task method 2021-11-21 10:57:25 +01:00
Anton Medvedev
dae6185800 Fix phpstan error 2021-11-14 22:46:42 +01:00
Anton Medvedev
c893ca5a94 Fix blackjack 2021-11-13 12:19:53 +01:00
Anton Medvedev
55879f95ee Replace ``bash with `` 2021-11-10 23:20:32 +01:00
Anton Medvedev
1f488ac612 Fix tests 2021-11-07 22:06:10 +01:00
Anton Medvedev
dcd7e75ee1 Rename getHost() to host() 2021-11-07 21:56:43 +01:00
Anton Medvedev
065c0121da Add disable/enable task methods 2021-11-07 21:30:06 +01:00
Anton Medvedev
89f64ad955 Add selectedHosts() 2021-11-06 16:51:19 +01:00
Anton Medvedev
20ca4718f2 Add on() func test 2021-11-06 01:14:05 +01:00
Anton Medvedev
eca779c847 Fix e2e 2021-11-05 16:15:01 +01:00
Anton Medvedev
704af44600 Fix ProcessRunner 2021-11-05 15:47:54 +01:00
Kevin Reniers
8ac587e621
feat: add support for hidden keys in yaml files (#2715)
* feat: add support for hidden keys in yaml files

During YAML loading the aliases are already resolved so there is no point in validating them or trying to execute them during import. That's why I've chosen to remove them completely after parsing.

I had to add the "# test.yaml" comment at the end because the importer checks for this, assuming a file will be passed to it. However, I wasn't sure where to put the file and keeping it isolated to the test seemed fine as well.

* fix: allow for future root-levels keys with dots in the name

* test: restore the Deployer input/output after test

This is necessary because the static instance gets set somewhere before TaskTest.php is executed, but gets overridden for the purposes of this test. Simply unsetting the deployer causes the instance to get garbage collected, which causes TaskTest.php to fail because it no longer exists.

I didn't really want to touch other code since it'd become pretty massive in scope, I think. As such, this was the quickest way to work around the current design of the code and how it interacts with tests.

Also, this may cause issues in other tests because the hosts I'm importing in this test will remain in the container, but I couldn't figure out how to remove hosts again after they've already been set. I tried extending the container with a new "hosts" value but that gave me a FrozenServiceException, as did directly overriding it, so I'm at a bit of a loss here. :)

Co-authored-by: Kevin R <22906111+cgkkevinr@users.noreply.github.com>
2021-11-03 19:59:51 +01:00
Anton Medvedev
3bd6954964 Fix context constructor calls 2021-11-03 15:51:19 +01:00
Anton Medvedev
4f97a68448 Move input/output out of context 2021-11-03 15:48:48 +01:00
Anton Medvedev
572e487fd5 Remove local() tasks 2021-11-03 08:56:15 +01:00
Anton Medvedev
44dec5f76b Fix e2e 2021-10-21 21:32:26 +02:00
Anton Medvedev
35a442f532 Refactor release process 2021-10-21 21:14:30 +02:00
Anton Medvedev
ed2bf332c4 Fix e2e test 2021-10-21 21:13:23 +02:00
Anton Medvedev
36ef8aa8b3 Add new e2e tests 2021-10-21 21:08:07 +02:00
Anton Medvedev
f02d896a14 Fix tests 2021-10-16 00:40:47 +02:00
Anton Medvedev
446f481fb1 Disable test 2021-10-13 19:48:44 +02:00
Anton Medvedev
87bd48adc3 Add oncePerNode() 2021-10-12 22:49:11 +02:00
Anton Medvedev
0228fddfb0 Refactor OnceTest.php 2021-10-12 22:48:09 +02:00
Anton Medvedev
82c2b44561 Add oncePerNode() test 2021-10-12 22:47:59 +02:00
Anton Medvedev
70733a42b7 Refactor EnvTest.php 2021-10-12 22:47:44 +02:00
Anton Medvedev
08d1191148 Fix e2e tests 2021-10-11 22:30:05 +02:00
Anton Medvedev
4d49300f65 Debug e2e tests 2021-10-11 22:23:31 +02:00
Anton Medvedev
34b4114a81 Improve tests 2021-10-11 22:06:46 +02:00
Anton Medvedev
90db1c16d2 Improve tests 2021-10-11 22:03:43 +02:00
Anton Medvedev
456d8881a8 Fix e2e 2021-09-24 16:49:47 +02:00
Anton Medvedev
91409192b2 Fix e2e 2021-09-24 16:47:57 +02:00
Anton Medvedev
d4a4fdcbdc Fix e2e 2021-09-24 16:37:47 +02:00
Anton Medvedev
6b73b44a2f Fix e2e 2021-09-24 16:34:10 +02:00
Anton Medvedev
d5d0e34bb0 Fix e2e 2021-09-24 16:31:04 +02:00
Anton Medvedev
7fa6c6220d Fix e2e test 2021-09-24 16:23:14 +02:00
Anton Medvedev
f3152a5264 Fix worker process creation 2021-09-19 17:34:37 +02:00
Anton Medvedev
2d9a9dcfaa
Remove vars (#2596) 2021-07-01 23:17:23 +03:00
Markus Staab
2a5d5c2032
Support passing null as default in get() (#2560)
* Support passing `null` as $default in get()

* Update CHANGELOG.md

Co-authored-by: Markus Staab <m.staab@complex-it.de>
2021-06-17 07:30:44 +03:00
Sacharski Bartłomiej
d3b6eaf9fe
Added support for code coverage in E2E tests (#2533)
The E2E docker-compose stack has been modified to include code
coverage for all scripts that are kept in /project and are not
in the exclusion list.

The start command for `deployer` container has been replaced
with a `start-e2e-test.sh` script, which will execute E2E tests,
generate a Clover report and then return the exit code of E2E test
process to make sure that CI is aware of the test result.

Whole idea for collecting E2E coverage has been inspired by the
[this][1] article. All of scripts in `deployer` container will
now start with additional wrapper-like PHP code, which checks
if the `PHP_CCOV_START_FILE` variable is present. If not,
then nothing happens, but if the variable points to a PHP file,
then that file is being included.

The `docker-compose.yml` file has `PHP_CCOV_START_FILE` configured
to point to a file, which sets up code coverage, that starts counting
which instructions in `/project` directory have been called. Once
`php` interpreter starts shutting down, the coverage report is being
dumped into temporary files.

Once all tests have been processed, a script for merging partial
coverage reports is executed and finally a Clover code coverage file
is stored in the path defined in the `PHP_CCOV_OUTPUT_FILE` env var.

[1]: https://tarunlalwani.com/post/php-code-coverage-web-selenium/
2021-05-02 15:15:19 +02:00
Sacharski Bartłomiej
165ffa119a
Implemented ConsoleApplicationTester for isolated E2E tests (#2513)
Added a new class ConsoleApplicationTester, which during E2E tests
will create a separate isolated process for the Deployer to run in.

This class exposes methods for interacting with stdin and to grab
stdout, stderr and status code of finished process.
2021-04-17 23:11:26 +03:00
Anton Medvedev
f0ac01a248 Update phpstan-baseline.neon 2021-04-15 22:53:41 +02:00