Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking new patch for TYPO3 recipe usage #3722

Closed
rlvk-tc opened this issue Nov 6, 2023 · 17 comments
Closed

Breaking new patch for TYPO3 recipe usage #3722

rlvk-tc opened this issue Nov 6, 2023 · 17 comments
Labels

Comments

@rlvk-tc
Copy link

rlvk-tc commented Nov 6, 2023

  • Deployer version: 7.3.2
  • Deployment OS: Windows and Mac
import:
  - recipe/typo3.php

config:
  repository: '[git-ssh-repository]'
  typo3_webroot: 'public'
  keep_releases: 5
  shared_dirs:
    - '{{typo3_webroot}}/fileadmin'
    - '{{typo3_webroot}}/typo3temp'
    - 'config'
  shared_files:
    - '{{typo3_webroot}}/.htaccess'
    - '{{typo3_webroot}}/apple-touch-icon.png'
    - '{{typo3_webroot}}/favicon.ico'

hosts:
  [server-ip]:
    remote_user: deployer
    deploy_path: '[server-deploy-path]'

tasks:
  typo3:cache:flush:
    - cd: "{{release_path}}"
    - run: "{{bin/composer}} exec typo3 cache:flush"
  deploy:
  - 'deploy:prepare'
  - 'deploy:vendors'
  - 'deploy:symlink'
  - 'typo3:cache:flush'
  - 'deploy:unlock'
  - 'deploy:cleanup'
  - 'deploy:success'

after:
  deploy:failed: deploy:unlock

After updating from Deployer 7.3.1 -> 7.3.2, my deployments are no longer working. After investigating a little bit, I can see that the TYPO3 recipe that I'm depending on, has been changed quite a lot, and is now using some different steps in the deploy task. Specifically it is the rsync that is causing issues, as it seems that it doesn't work with the git repository setup, that I'm running. It tells me that the local path cannot be remote.

Anyone had similar issues and can help me, so I can stay up-to-date?

@antonmedv
Copy link
Member

Let’s try to contact dev who made those changes.

@antonmedv antonmedv added the bug label Nov 6, 2023
@Konafets
Copy link
Contributor

Konafets commented Nov 7, 2023

I wonder why the recipe uses rsync anyway while Laravel recipe just pulls the Git repository.

@antonmedv
Copy link
Member

Me too

@antonmedv
Copy link
Member

Reverted #3723

@antonmedv
Copy link
Member

Released https://github.com/deployphp/deployer/releases/tag/v7.3.3

@mbrodala
Copy link
Contributor

mbrodala commented Nov 8, 2023

@Konafets Because it is generally good practice to build everything locally first (Git, Composer, NPM/Yarn, etc.) and then only upload (rsync) the bare minimum of files for a working system.

@Konafets
Copy link
Contributor

Konafets commented Nov 8, 2023

@mbrodala Interestingly the TYPO3 recipe would have been the only one who uses rsync.

@antonmedv
Copy link
Member

I agree what building and uploading will be better. But due to historical reasons, by default, Deployer uses git archive/clone.

@rlvk-tc
Copy link
Author

rlvk-tc commented Nov 9, 2023

I also see a benefit to building and uploading, however it also depends a lot on the usecase. My specific workflow goal is to automatically deploy when something is merged into my main branch. So for this reason it is easier to deal with when it simple puls from GitHub and then builds and installs dependencies based on that one source of truth. This also serves the most important goal for me with is that I Can know for sure that my produktion is aligned with GitHub, whereas with local artifact uploads, my developers would be able to deploy changes that are not approved.

@Konafets
Copy link
Contributor

Konafets commented Nov 9, 2023

I think local is not meant as local machine of a developer here. The idea is to build the artefacts (Composer, NPM) on the GitHub runner and rsync this to the staging/production server. This will comply with your described workflow.

You don't need GIT, Composer, NPM and all the other tools on your server, but as mentioned before its nothing I would expect from a Deployer recipe as all others pull from Github/Gitlab.

@rlvk-tc
Copy link
Author

rlvk-tc commented Nov 9, 2023

I think local is not meant as local machine of a developer here. The idea is to build the artefacts (Composer, NPM) on the GitHub runner and rsync this to the staging/production server. This will comply with your described workflow.

You don't need GIT, Composer, NPM and all the other tools on your server, but as mentioned before its nothing I would expect from a Deployer recipe as all others pull from Github/Gitlab.

Yes that is true, and would definetly also align with my goal setup. However it would need to come with a v8 release as it is quite breaking.

@infabo
Copy link
Contributor

infabo commented Dec 7, 2023

Just use https://github.com/helhum/typo3-deployer-recipe if you need an advanced TYPO3 recipe.

@ochorocho
Copy link
Contributor

@antonmedv @rlvk-tc would it be an option to add this using a extra recipe?
Something like recipe/typo3-rsync.php ?

I used the old (now current again) TYPO3 recipe quite some time and never understood why i had to write most of the stuff myself.
Turned out, because it was outdated. Written for TYPO3 6.2.

The people i talked to preferred rsync over git. This is offered by deployer. So my idea was to build in CI and ship
the final "build". On top of this i have added the option to simply add a task before/after a task in a task group which seemed very handy to me.

In general, i did not expect this recipe to be released in a bugfix release. The repo owner makes the rules and that's ok, but it felt really unusual to me and others.

Thanks for your time. Ii'll wait for your response on how to proceed.

@derhansen
Copy link

+1 for adding a dedicated TYPO3 recipe which supports rsync.

@rlvk-tc
Copy link
Author

rlvk-tc commented Dec 12, 2023

@ochorocho I completely agree with you. I've also written most of my recipe myself because the current typo3 recipe is very outdated. I agree that it needs to be updated, the only problem I have with it, is that it needs to be done in a non-breaking fashion, or the update needs to come with a new major version release of deployer.

Therefore I agree with you that it could be a good solution to introduce a new recipe, that offers a more up-to-date solution, but without breaking production pipelines for people depending on the current typo3 recipe.

@mbrodala
Copy link
Contributor

mbrodala commented Dec 12, 2023

Generally speaking other recipes could also benefit from a "push vs pull" switch/flavor. Here "push" preparing as much as possible locally and using rsync or similar for a bundled upload and "pull" doing everything on the remote server.

E.g. we also only use parts of the shipped symfony recipe for Symfony projects exactly because of the same reasons. In between we have a custom build task (using on(localhost(), ...)) for local preparation.

@rlvk-tc
Copy link
Author

rlvk-tc commented Dec 12, 2023

@mbrodala Always good with options. Personally I would like to keep using the "pull" approach for simple projects that do not have any complex build steps, but then it would be great with the option to switch to a "push" approach for more complex projects, that needs to do a lot of processing before shipping some built code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants