Repository navigation
feat(project): create named deployment archives - #1712
Conversation
|
Caution Review failedThe pull request is closed. No actionable comments were generated in the recent review. ℹ️ Recent review info
Walkthrough
Merge Risk:
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1712 +/- ##
==========================================
- Coverage 66.54% 66.46% -0.08%
==========================================
Files 474 478 +4
Lines 32010 32426 +416
==========================================
+ Hits 21301 21553 +252
- Misses 10709 10873 +164
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Lena Forlin (moshimorschi)
left a comment
There was a problem hiding this comment.
There is nothing that I saw that blocks this, however some improvements could be considered, see the following report:
1. Earlier archives and local dumps end up in the next deployment. The staging copy takes everything in the checkout except a short fixed list, so local files get shipped. Inherited from #1539, but create is where people will hit it.
Observed: --output ./builds/v1.tar.gz and then ./builds/v2.tar.gz from the project root, v2 (122 MB) contains builds/v1.tar.gz (61 MB). A dump.sql from project dump is in there as well.
Desired: skip archives the command wrote itself and known CLI outputs like dump.sql, or honour .gitignore. A warning would already help.
2. .shopware-cli/deployments is not ignored in existing projects. Only project create puts /.shopware-cli into .gitignore. Shops from composer create-project shopware/production don't have it, and the command writes no ignore file.
Observed: after deploy create, git status shows ?? .shopware-cli/ with a 244 MB tarball inside, git add . stages it.
Desired: write a .gitignore with * into the deployments dir on first use, or a one-time hint.
3. The reference cannot be captured in a script. rollout will consume this value, so CI needs to grab it.
Observed: ref=$(shopware-cli project deploy create -e production) gives 28 lines: the Shopware version banner, the whole asset:install output and at the end Created deployment "name", quoted. Composer already goes to stderr, bin/ci does not.
Desired: only the reference on stdout, unquoted, everything else on stderr like the progress lines from #1718. Or a --format json.
4. Non-ssh environments fail without a hint. Without -e the command targets local, and an ssh: block without type: ssh counts as local too.
Observed: cannot create deployments for environment type "local": deployment not supported, in both cases and also without any config.
Desired: name the environment and the fix, e.g. environment "local" has type "local", deploy create needs an environment with type: ssh (-e <name>).
5. Ctrl+C reads like a build failure. Cleanup is fine, no archive and the temp dir is gone.
Observed: during composer install cannot create deployment archive: build archive: signal: killed, during bin/ci ... failed to warmup container cache (php bin/ci --version): signal: interrupt.
Desired: context canceled or "deployment cancelled, nothing written", like validate after #1718.
6. --output with a directory. The flag takes a file path, but directories are not handled as such.
Observed: an existing directory gives archive output ".../builds" already exists, and --output ./dist/ writes a 244 MB gzip file literally named dist.
Desired: treat a directory as the target folder and generate the name inside it, or reject it with "is a directory".
7. create vs package archive. Both produce the same tar.gz in the same place. create prints only the name and needs an ssh environment, package archive prints the path and takes any environment. deploy --help does not say which one to use.
Observed: Created deployment "lucid-resilient-hawking" vs Created archive ".../lucid-resilient-hawking.tar.gz".
Desired: one sentence in deploy --help on when to use which, and the path in the create output, since there is no rollout yet and people will upload the file by hand.
|
Documentation check: no update needed This PR adds However, the entire Since this command isn't reachable in any released Changed-file category: new internal CLI command + backend code behind an unreleased feature flag (not yet user-facing). If/when the |
What changed?
Registers the
deploy createcommand which triggers the interface to create an deployment. For SSH we re-useproject cito create an tar.gz fileWhy?
How was this tested?
Related issue or discussion
Summary by CodeRabbit
project deploy createto create an immutable deployment archive for SSH environments.deploy, withdeploymentretained as an alias.