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

Testing mergability of mike weilgars masterfiles stage changes #2707

Conversation

nickanderson
Copy link
Member

No description provided.

Mike Weilgart added 30 commits January 5, 2016 13:42
Add double quoting to variables so script won't break on spaces.
Clean up comments (remove obsolete comment, add comment with
section header).
Make error_exit function def consistent with other defs syntax.
avoid_triggering_unneeded_policy_updates, and
rollout_staged_policy_to_masterdir
in masterfiles-stage.sh.  It calls git_stage_policy_channels_from_mirror.
git_tag_or_commit_masterstage, and
git_branch_masterstage,
have been modified to use the recently added rollout functions:
avoid_triggering_unneeded_policy_updates, and
rollout_staged_policy_to_masterdir.

Also rollout_staged_policy_to_masterdir was modified slightly
in its comments, and using dirname instead of bash string handling.
git_tag_or_commit_masterstage and git_branch_masterstage
have both been modified to call the functions
git_setup_local_mirrored_repo and git_stage_refspec.

The only distinction between these functions now is
that one uses GIT_TAG_OR_COMMIT where the other uses
GIT_BRANCH.
Moved setting of PARAMS and MASTERDIR to within options.sh

Combined git_tag_or_commit_masterstage and
git_branch_masterstage into a single function,
git_masterstage, which accepts as an argument
either GIT_TAG_OR_COMMIT or GIT_BRANCH.

Add comments clarifying where certain variables are set.

Add failure catch in case options.sh or common.sh not found.
Document options.sh and new VCS_TYPE.
since it's redundant; now ALL the git stage functions use a mirror.

Change from GIT_MIRROR_POLICY_CHANNELS
to GIT_POLICY_CHANNELS.
to be set in the params.sh file for the GIT_POLICY_CHANNELS vcs type.
Updated readme.org with this info also.

Add mkdir command for channel_deployment_dir so we don't fail easily.

Add -x flag to git clean command to prevent any issue with a .gitignore file
in the staging dir causing the deployed code to differ from the intended
code from the git repo.
- Use bash array for the channel config instead of a separate file.
- Use empty temp directory (mktemp) for staging to simplify checkout code.
- Copy .git/HEAD from mirrored repo to allow release_id population therefrom.
- Simplify logic for rolling out changes to the deployment dir
- Allow independent deployment paths for each policy channel
  rather than putting all channels in one parent directory.
- Include safety check that the deployment path is absolute, not relative.
- Document all of the above concisely in the inline comments.
This is to allow cf_promises_release_id to be populated correctly;
see cfengine#2465 (comment)
Now git_masterstage and git_stage_policy_channels again run
nearly identical function calls.  The only real difference is that
git_stage_policy_channels runs "git_deploy_refspec" in a loop, to stage
all policy channels, and of course git_masterstage just runs it once.

Integration fixes:
- .git/HEAD is populated (with a git commit hash) in all cases.
- Nothing is put inside ROOT.

Simplifications:
- A temp directory is used instead of STAGING_DIR.  It is placed
  right next to the deploy dir (created safely with mktemp) and finally
  dropped in place with an atomic `mv` operation. There are then no edge
  cases to handle regarding contents of the STAGING_DIR because it is
  created empty each time and populated only by a git checkout command.
Mike Weilgart and others added 6 commits January 21, 2016 19:21
This VCS_TYPE was never publicly used and is now unneeded,
as the GIT vcs type will handle git tags or commit hashes
as well as git branches.

README was brought in sync with recent code changes.
Now the extra temp dir will get removed if the script error exits,
which is particularly important if the code validation fails (since otherwise
the temp staging dirs would build up every time the script runs\!)
…ilgart/core into mikeweilgart-masterfiles_stage_rewrite

fixed conflict in contrib/masterfiles-stage/README.org
removed contrib/masterfiles-stage/lib/optparse/README.md
@nickanderson nickanderson merged commit 21ea76b into cfengine:master Oct 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant