-
Notifications
You must be signed in to change notification settings - Fork 185
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
Masterfiles stage rewrite #2465
Changes from 31 commits
18cca43
3bf4eb9
18f844c
42da03f
01e7822
96a849e
c016016
6d499c5
facdcdb
f11edd9
5ffc134
ae11575
b1c4168
a8a6a67
51933de
53edd2d
5764aa3
e85296d
924da17
a332eb9
5d9c42c
00a73f5
88d595b
2dda41a
9a1a2ca
ffd7a51
d7919ea
a1772e1
362e11b
d26907f
986aa45
537f3a9
19c6ddb
387b32c
a57c700
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,23 +38,26 @@ simple environments this will be `$(sys.masterdir)` (typically | |
- VCS_TYPE="GIT" | ||
- VCS_TYPE="GIT_TAG_OR_COMMIT" | ||
- VCS_TYPE="SVN" | ||
- VCS_TYPE="GIT_POLICY_CHANNELS" | ||
|
||
* Dependancies | ||
This script has the following dependancies | ||
* Dependencies | ||
This script has the following dependencies | ||
- bash | ||
- rsync | ||
- rsync (SVN only) | ||
- git|svn | ||
|
||
* Installation | ||
Installation simply consists of saving `masterfiles-stage.sh` and its | ||
supporting `common.sh` to the same directory on your hub and making | ||
sure that `masterfiles-stage.sh` is executable. | ||
supporting `common.sh` and `options.sh` to the same directory on your hub | ||
and making sure that `masterfiles-stage.sh` is executable. | ||
|
||
#+begin_src example | ||
wget https://raw.githubusercontent.com/cfengine/core/master/contrib/masterfiles-stage/masterfiles-stage.sh -O /var/cfengine/bin/masterfiles-stage.sh | ||
wget https://raw.githubusercontent.com/cfengine/core/master/contrib/masterfiles-stage/common.sh -O /var/cfengine/bin/common.sh | ||
chown root:root /var/cfengine/bin/masterfiles-stage.sh | ||
wget https://raw.githubusercontent.com/cfengine/core/master/contrib/masterfiles-stage/options.sh -O /var/cfengine/bin/options.sh | ||
chown root:root /var/cfengine/bin/masterfiles-stage.sh /var/cfengine/bin/common.sh /var/cfengine/bin/options.sh | ||
chmod 555 /var/cfengine/bin/masterfiles-stage.sh | ||
chmod 444 /var/cfengine/bin/common.sh /var/cfengine/bin/options.sh | ||
#+end_src | ||
|
||
*Warning:* The above commands may not work out of the box depending on | ||
|
@@ -64,8 +67,9 @@ sure that `masterfiles-stage.sh` is executable. | |
|
||
The `masterfiles-stage.sh` script takes options in order to specify the | ||
directory where the masterfiles should be deployed after staging, as well as | ||
the file that contains the paramaters that should be used in order to interface | ||
the file that contains the parameters that should be used in order to interface | ||
with the given upstream source implementation (git url, branch etc ..) | ||
Run masterfiles-stage.sh --help to see exact option flags. | ||
|
||
- `MASTERDIR` is the fully qualified path to the location that you | ||
want masterfiles to be deployed to after successful staging. | ||
|
@@ -75,7 +79,7 @@ with the given upstream source implementation (git url, branch etc ..) | |
staging method (currently reffered to as `VCS_TYPE`). The format of | ||
the file is a simple KEY="VALUE". It is sourced by the | ||
`masterfiles-stage.sh` script. Each staging method or `VCS_TYPE` | ||
defines may define its own parameters. It is reccomended that the | ||
defined may define its own parameters. It is recommended that the | ||
parameters defined by the `VCS_TYPE` be prefixed with the `VCS_TYPE` | ||
so as not to conflict with other staging methods. | ||
|
||
|
@@ -86,7 +90,7 @@ The following parameters are in use, be sure to avoid their collision | |
when developing new staging methods. | ||
|
||
- VCS_TYPE - The staging method to use | ||
- Currently supported: (GIT|GIT_TAG_OR_COMMIT|SVN) | ||
- Currently supported: (GIT|GIT_TAG_OR_COMMIT|GIT_POLICY_CHANNELS|SVN) | ||
|
||
- GIT_URL - The URL to the git repository | ||
- Example values: | ||
|
@@ -101,6 +105,15 @@ when developing new staging methods. | |
- 88335d36b48c8808b12b48667a463182dc8d0338 | ||
- mytag | ||
|
||
- channel_config_file - The path to the config file for multiple policy channels | ||
- Example value: | ||
- /var/cfengine/policy_channels/channel_to_source.txt | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could this be done with bash arrays in the params or options instead of a new separate file? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting idea. I think yes, it could. (It would be in params, not options, as it's VCS_TYPE specific.) I think simplest would be just one array channel_config which would be expected to contain at least two elements, and if it had an odd number of elements the last would be ignored (perhaps with a warning). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's fine, yeah. I was actually thinking of bash associative arrays but those may not be available in older shells (bash 4 got these IIRC):
So any implementation is OK with me, as long as it doesn't require separate config files. |
||
|
||
- channel_deployment_dir - The directory in which to deploy each policy channel | ||
(each in a separate subdirectory named according to channel name) | ||
- Example value: | ||
- /var/cfengine/policy_channels/masterfiles_dirs | ||
|
||
- SVN_URL - The URL to the svn repository | ||
|
||
- SVN_BRANCH - The svn branch to checkout | ||
|
@@ -121,22 +134,22 @@ have no effect on functionality of `masterfiles-stage.sh` | |
operations (not used by `masterfiles-stage.sh`) | ||
- This is used by Design Center in CFEngine Enterprise | ||
|
||
- PKEY - Private SSH Key used for authrorization when pushing | ||
- PKEY - Private SSH Key used for authorization when pushing | ||
integrated write operations | ||
- This is used by Design Center in CFEngine Enterprise | ||
|
||
- SCRIPT_DIR - Directory contianing supporting scripts | ||
- This is used by Design Center in CFEngine Enterprise | ||
|
||
*** Special Note | ||
The executing user may require addational configuration in order to | ||
The executing user may require additional configuration in order to | ||
successfully authenticate. The specifics depend on the specifics of | ||
your upstream repository. For example, an upstream repository over | ||
http or https that allows anonymous access may need no addtional | ||
configuration, but an upstream that uses ssh keys for authentication | ||
may require trust establishment (accepting the host key fingerprint), | ||
and the presence of an ssh key for authentication. Depending on the | ||
security requirements of your orginization, you may use a | ||
security requirements of your organization, you may use a | ||
passphraseless key, or you may use something like ssh-agent. | ||
|
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd add a note here that
GIT_TAG_OR_COMMIT
is legacy and equivalent to the other one.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll hold off on that until Nick and I come to an agreement regarding mirrored repos and how cf_promises_release_id gets populated.