Comments (11)
I disagree about before_migrate ... I think it should only be run if we are migrating.
from artifact-cookbook.
Do we need an after_extract to handle "Where do I put bundle install?"
from artifact-cookbook.
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.
@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.
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.
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.
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.
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.
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.
@ivey looks good to me. Is configure
a hook as well or all configuration would occur in before_deploy
?
from artifact-cookbook.
I like this. Makes sense to me.
from artifact-cookbook.
Related Issues (20)
- ChefSpec and unit-testing recipes with artifact-cookbook callbacks. HOT 4
- Dont unzip war/jars HOT 10
- wrong tar command HOT 17
- ability to select nexus_cli gem version HOT 1
- Cookbook does not follow 302 Responses
- use_symlinks option to deploy without symlinks HOT 2
- artifact_file try to verify the checksum when it's not provided in the recipe HOT 4
- Feature Request: add chef-vault support HOT 1
- file:// schema support
- Tag versions of cookbook HOT 1
- pass http headers to Chef::Resource::RemoteFile
- artifact_file with credentials
- Avoid the package extraction HOT 3
- Messy ChefSpec tests with artifacts (previos definition of ... was here) HOT 1
- Still maintained? HOT 5
- artifact_test does not appear to be a valid cookbook. Does it have metadata.rb ? HOT 2
- Latest versions of chef do not include activesupport HOT 1
- uninitialized constant Chef::Resource::ArtifactFile on Chef client 13 HOT 3
- NoMethodError: undefined method `split' for :mid:Symbol on Chef Server 13.7.16
- This cookbook doesn't support newer version of nexus, since Nexus 3 has different endpoint for downloaidng artifacts, seems this cookbook doesnt work for nexus version 3.x HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from artifact-cookbook.