Magento: Fix artifact_path generation (#3459)

* Magento: Fix artifact_path generation

- Fix 1. Add -p parameter to mkdir command
   {{artifact_path}} could be configured with multiple folders such as build/artifacts
- Fix 2. run() -> runLocally()
   The {{artifact_dir}} is used to keep artifacts archive file.
   It should be called at CI server only and not at target server.
   Then the task `artifact:upload` uploads this file at target server host under {{release_path}}.
   It is not needed to have {{artifact_dir}} at target server.

* Update docs
This commit is contained in:
Fabian Schmengler / 2023-01-30 21:15:09 +01:00 committed by GitHub
parent 30c66cee47
commit 8a94172fd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -273,8 +273,8 @@ null
```php title="Default value"
if (!test('[ -d {{artifact_dir}} ]')) {
run('mkdir {{artifact_dir}}');
if (!testLocally('[ -d {{artifact_dir}} ]')) {
runLocally('mkdir -p {{artifact_dir}}');
}
return get('artifact_dir') . '/' . get('artifact_file');
```

View File

@ -235,8 +235,8 @@ set('build_from_repo', false);
set('repository', null);
set('artifact_path', function () {
if (!test('[ -d {{artifact_dir}} ]')) {
run('mkdir {{artifact_dir}}');
if (!testLocally('[ -d {{artifact_dir}} ]')) {
runLocally('mkdir -p {{artifact_dir}}');
}
return get('artifact_dir') . '/' . get('artifact_file');
});