Skip to content

Commit

Permalink
added license to files
Browse files Browse the repository at this point in the history
  • Loading branch information
joemiller committed Feb 28, 2012
1 parent 15c7e80 commit e1fd238
Show file tree
Hide file tree
Showing 8 changed files with 329 additions and 48 deletions.
116 changes: 71 additions & 45 deletions README.md
Expand Up @@ -47,10 +47,49 @@ Installation


TODO TODO


Usage Typical workflow
----- ----------------


### Preparing a repo After a repo has been prepared by running `git flux init` and your
environment branches have been created and published to the remote,
the typical workflow for changes might look like this:

1. Create a feature branch based on the `production` environment branch.
`git flux feature new Feature_name`
2. Make edits, commit, push.
3. Merge the feature branch into the `development` environment branch.
4. Test the changes, repeat steps 2 and 3 if necessary.
5. Merge the feature branch into the `testing` environment branch.
6. Do moar testing.
7. Merge the feature branch into the `production` environment branch.
8. Done.

### Create a new feature branch.

$ git flux feature new TKT-512_adding_cool_stuff
<edit files, `git commit`, then..>
$ git flux publish TKT-512_adding_cool_stuff

It is not required to publish feature branches but it can be very
useful for the rest of the team to be able to see your work in
progress, or they can finish merging it into environment branches if
you get hit by a bus.

### Merge a feature branch into an environment branch:

$ git flux feature merge TKT-512_adding_cool_stuff development

### Publish/push updated environment branch to remote server:

After merging a feature branch into an environment branch, the next step will
be to push your changes to the remote server (if you're ready):

$ git flux publish development

Other Commands
--------------

### Preparing a repo (one-time task) - git flux init


git-flux assumes the following: git-flux assumes the following:


Expand Down Expand Up @@ -85,45 +124,6 @@ commit is push'd.
$ git flux publish development $ git flux publish development
$ git flux publish testing $ git flux publish testing


### Typical workflow

This is the most common task you will perform since it is the mechanism you
will use to make changes to your config management and then push them to your
various environments.

A typical change workflow might look like this:

1. Create a feature branch based on the `production` environment branch.
2. Make edits, commit, push.
3. Merge the feature branch into the `development` environment branch.
4. Test the changes, repeat steps 2 and 3 if necessary.
5. Merge the feature branch into the `testing` environment branch.
6. Do moar testing.
7. Merge the feature branch into the `production` environment branch.
8. Done.

#### Create a new feature branch.

$ git flux feature new TKT-512_adding_cool_stuff
<edit files, `git commit`, then..>
$ git flux publish TKT-512_adding_cool_stuff

It is not required to publish feature branches but it can be very
useful for the rest of the team to be able to see your work in
progress, or they can finish merging it into environment branches if
you get hit by a bus.

#### Merge a feature branch into an environment branch:

$ git flux feature merge TKT-512_adding_cool_stuff development

#### Publish/push updated environment branch to remote server:

After merging a feature branch into an environment branch, the next step will
be to push your changes to the remote server (if you're ready):

$ git flux publish development

### List feature branches waiting to be merged into environment branches ### List feature branches waiting to be merged into environment branches


It is possible to get a list of feature branches that have not yet been It is possible to get a list of feature branches that have not yet been
Expand Down Expand Up @@ -190,7 +190,33 @@ TODO
License License
------- -------


Portions of this code are borrowed from [git-flow](https://github.com/nvie/gitflow). Portions of this code are taken from [git-flow](https://github.com/nvie/gitflow).
See `gitflux-common` for the git-flow license. `git-flow` is Copyright Vincent Driessen.
See `gitflux-common` for the git-flow license.


TODO Copyright 2012 Joe Miller. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY JOE MILLER ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
EVENT SHALL JOE MILLER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

The views and conclusions contained in the software and documentation are
those of the authors and should not be interpreted as representing official
policies, either expressed or implied, of Joe Miller.
38 changes: 35 additions & 3 deletions git-flux
@@ -1,7 +1,39 @@
#!/bin/sh #!/bin/sh
# TODO: license and descriptions in each src file #

# git-flux -- A collection of git tools to help with workflows
# see SPEC.md and README.md for more info # often associated with "infrastructure as code" or configuration
# management.
#
# Feel free to contribute to this project at:
# http://github.com/joemiller/git-flux
#
# Copyright 2012 Joe Miller. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY JOE MILLER ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL JOE MILLER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# The views and conclusions contained in the software and documentation are
# those of the authors and should not be interpreted as representing official
# policies, either expressed or implied, of Joe Miller.
#


if [ "$DEBUG" = "yes" ]; then if [ "$DEBUG" = "yes" ]; then
set -x set -x
Expand Down
36 changes: 36 additions & 0 deletions git-flux-checkout
@@ -1,3 +1,39 @@
#
# git-flux -- A collection of git tools to help with workflows
# often associated with "infrastructure as code" or configuration
# management.
#
# Feel free to contribute to this project at:
# http://github.com/joemiller/git-flux
#
# Copyright 2012 Joe Miller. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY JOE MILLER ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL JOE MILLER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# The views and conclusions contained in the software and documentation are
# those of the authors and should not be interpreted as representing official
# policies, either expressed or implied, of Joe Miller.
#

gitflux_load_settings gitflux_load_settings


usage() { usage() {
Expand Down
36 changes: 36 additions & 0 deletions git-flux-env
@@ -1,3 +1,39 @@
#
# git-flux -- A collection of git tools to help with workflows
# often associated with "infrastructure as code" or configuration
# management.
#
# Feel free to contribute to this project at:
# http://github.com/joemiller/git-flux
#
# Copyright 2012 Joe Miller. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY JOE MILLER ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL JOE MILLER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# The views and conclusions contained in the software and documentation are
# those of the authors and should not be interpreted as representing official
# policies, either expressed or implied, of Joe Miller.
#

gitflux_load_settings gitflux_load_settings


usage() { usage() {
Expand Down
36 changes: 36 additions & 0 deletions git-flux-feature
@@ -1,3 +1,39 @@
#
# git-flux -- A collection of git tools to help with workflows
# often associated with "infrastructure as code" or configuration
# management.
#
# Feel free to contribute to this project at:
# http://github.com/joemiller/git-flux
#
# Copyright 2012 Joe Miller. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY JOE MILLER ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL JOE MILLER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# The views and conclusions contained in the software and documentation are
# those of the authors and should not be interpreted as representing official
# policies, either expressed or implied, of Joe Miller.
#

gitflux_load_settings gitflux_load_settings


usage() { usage() {
Expand Down
43 changes: 43 additions & 0 deletions git-flux-init
@@ -1,3 +1,39 @@
#
# git-flux -- A collection of git tools to help with workflows
# often associated with "infrastructure as code" or configuration
# management.
#
# Feel free to contribute to this project at:
# http://github.com/joemiller/git-flux
#
# Copyright 2012 Joe Miller. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY JOE MILLER ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL JOE MILLER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
# OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
# EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# The views and conclusions contained in the software and documentation are
# those of the authors and should not be interpreted as representing official
# policies, either expressed or implied, of Joe Miller.
#

usage() { usage() {
echo "usage: git flux init" echo "usage: git flux init"
} }
Expand All @@ -7,6 +43,12 @@ cmd_default() {
die "This is not a valid git repository." die "This is not a valid git repository."
fi fi


# TODO: new model:
# static feature and environment branch prefixes. stored in gitflux-common
# init - 1) check for remote environment/production branch, if exists, use it
# 2) check for local environment/production branch, if exists, use it and push to remote
# 3) ask for local branch to use as production? clone it and push to remote

# is git-flux already initialized? if so, warn user, require -f flag # is git-flux already initialized? if so, warn user, require -f flag
if gitflux_is_initialized; then if gitflux_is_initialized; then
warn "Already initialized for git-flux. Re-initializing should be safe," warn "Already initialized for git-flux. Re-initializing should be safe,"
Expand Down Expand Up @@ -50,6 +92,7 @@ cmd_default() {
die "I could not find a local or remote 'master' branch. Create one then re-run 'git flux init'." die "I could not find a local or remote 'master' branch. Create one then re-run 'git flux init'."
fi fi


# TODO: only need to push if no remote prod branch existed?
echo "Pushing '$prod_branch' to remote 'origin'" echo "Pushing '$prod_branch' to remote 'origin'"
git push origin "$prod_branch" git push origin "$prod_branch"
if [ $? -gt 0 ]; then if [ $? -gt 0 ]; then
Expand Down

0 comments on commit e1fd238

Please sign in to comment.