Coder Social home page Coder Social logo

Comments (11)

ivey avatar ivey commented on July 24, 2024

I disagree about before_migrate ... I think it should only be run if we are migrating.

from artifact-cookbook.

ivey avatar ivey commented on July 24, 2024

Do we need an after_extract to handle "Where do I put bundle install?"

from artifact-cookbook.

ivey avatar ivey commented on July 24, 2024

Actually, I may disagree on the whole issue. We're having a problem where bundler is running every time in the before_migrate. My feeling is that this is a bug: if the deployed code hasn't changed, I don't want bundler running. Do you think that is a correct statement?

from artifact-cookbook.

reset avatar reset commented on July 24, 2024

@ivey I think you are right that before_migrate and after_migrate (if it existed) should only run on migrate.

We may not have enough hooks defined and that may be why you disagree on the whole issue. We should allow people to configure their application within the LWRP to have access to the folder structure and we want to make sure the configuration is valid even if the application doesn't need to be re-deployed.

Let's take the case where we change an attribute that affects a configuration file. If the application is already deployed then this would be missed since configuration is placed within the hooks we have implemented and those only fire if an application deploys.

from artifact-cookbook.

ivey avatar ivey commented on July 24, 2024

Shouldn't that config file be in a template resource outside the artifact block? Or does it need to be inside for some reason? My feeling right now is that "Deploying an artifact" is the job of this cookbook, and if v1.2.3 of the artifact is deployed, and :force is not set, we shouldn't do anything. Configuration should happen regardless of the artifact state. Happy to be convinced otherwise though.

I agree about hooks, though. I'm working on a list of hooks we may want to add, plus the change to migration hooks to only run if migrating.

from artifact-cookbook.

ivey avatar ivey commented on July 24, 2024

The simple solution would be to have some hooks that always run, some that only run if the artifact is being deployed, and let users pick the one that meets their needs.

from artifact-cookbook.

KAllan357 avatar KAllan357 commented on July 24, 2024

I think one of the reasons for the templates in procs argument is the current idempotency check. The manifest file that is used is meant to ensure that the artifact is still in the state is was deployed in. Randomly deleting a file from the deployed directory should prompt a redeploy on the next chef run.

Similarly, adding a file into the deployment directory after deployment would cause the manifest check to fail. I'm not sure the correct path here, but I think the manifest checking is useful for ensuring that the artifact is still in the correct state.

I had some other thoughts on this that I wrote about in #26

from artifact-cookbook.

ivey avatar ivey commented on July 24, 2024

Got it. Honestly, I didn't realize we did that. Makes sense.

I'll finish my hooks list and add it to this thread.

from artifact-cookbook.

ivey avatar ivey commented on July 24, 2024

Here's what I am thinking. Adds a few redundant hooks, but I have always been bothered that you have to know symlink comes after extract and use before_symlink instead of after_extract, for example.

  • check the manifest and save the result
  • run before_deploy
  • if deploy?
    • run before_extract / extract / run after_extract
    • run before_symlink / symlink / run after_symlink
  • run configure
  • if deploy? and migrate?
    • run before_migrate / migrate / run after_migrate
  • if deploy? or manifest has changed so far (we changed configs)
    • run restart
  • run after_deploy
  • write the manifest

before_deploy and after_deploy would be catch-all for "do this inside the manifest write"

configure would be the preferred place to do templates, since you don't have to remember where in the process it comes.

This does add an extra manifest check to see if we should run restart.

from artifact-cookbook.

reset avatar reset commented on July 24, 2024

@ivey looks good to me. Is configure a hook as well or all configuration would occur in before_deploy?

from artifact-cookbook.

KAllan357 avatar KAllan357 commented on July 24, 2024

I like this. Makes sense to me.

from artifact-cookbook.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.