* 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
* 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
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.
* 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>
* 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>
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/
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.