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

Enhancement:Build and deploy identified artifact #52

Open
Seb2nim opened this issue Mar 18, 2020 · 4 comments
Open

Enhancement:Build and deploy identified artifact #52

Seb2nim opened this issue Mar 18, 2020 · 4 comments
Labels
question Further information is requested

Comments

@Seb2nim
Copy link

Seb2nim commented Mar 18, 2020

Well, actually i'm not big fan of "building" the app on the target server : The "build / deploy-artifact" approach makes more sense to me.

Only issue is that the build actually packages the current application version (local).

Actually the standard Deployer "deploy" can handle branch and tag options...

I think that would make sense to enhance the "build" task to grab (git clone) a specific branch / tag version and package it. Then the "deploy-package" would accept an archive parameter to deploy this specific archive.

This way a tagged version artifact could be deployed on staging server, then, exactly same archive could be deployed to production.

Deploying a developper snapshot version archive (what the tools do right now) would just be a particular scenario of the "archive" deployment mecanism.

@osrecio
Copy link
Collaborator

osrecio commented Apr 9, 2020

You have the option to use git if you don't use artifact:

https://github.com/jalogut/magento2-deployer-plus/blob/master/deploy.php.sample_2_2#L14-L15

Check it out

@osrecio osrecio added the question Further information is requested label Apr 9, 2020
@osrecio osrecio closed this as completed Apr 16, 2020
@Seb2nim
Copy link
Author

Seb2nim commented Apr 17, 2020

Sorry @osrecio, i didn't answer fast enough.

Of course i know...

Sorry, it seems it was not clear :

  1. The native "Deployer php" deploy principe is to "pull" code from git repo on the deployment server. (deploy:update_code) : branch, head, tag, etc...
    => Not fan of this : need to have "dev" tools on deploy server, each server compiles its own "version" of app : download composer dependencies, lot of reasons... For me : bad idea.

  2. The "artifact-build-deploy" strategy proposed in this project has much more sense to me :

  • Build an artifact on a build machine (CI, etc).
  • Deploy this artifact on deploy server.

The only "issue" is that the "artifact-build" task actually just packages current local version of the (supposed) repository. It is not capable to build a specific version.

To be more precise, the artifact task DOESNT use git at all : it packs the local folder, whatever is in it and thats all. Thats pretty dangerous...

My suggestion is to rewrite artifact:build to base on update_code :
Download an identified git tree prepare it, the pack it.
Then enhance artifact-deploy to deploy that identified version.

I'll try to share what i've done. Not that simple to create PR as i refactored lot of stuff (version-folder stuff etc...). I'll be back with it this week-end

@osrecio osrecio reopened this Apr 17, 2020
@osrecio
Copy link
Collaborator

osrecio commented Apr 17, 2020

I reopened the issue to give you an answer. During this day I will answer you :)

@Seb2nim
Copy link
Author

Seb2nim commented Apr 17, 2020

Done, created PR #58. Hope that will help.
Regards

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

No branches or pull requests

2 participants