Recipes to install git related tools on OS X.
./sprout
- 
- you can now specify that a project should auto-update using the update: trueattribute (defaultfalse)
 
- you can now specify that a project should auto-update using the 
- 
also adds subattribute recursiveto allow all given projects to be cloned recursively e.g.node_attributes: sprout: git: projects_settings: recursive: true projects: - github: foo/bar - github: pivotal-sprout/sprout-gitwill cause the git commands: $ git clone --recursive [email protected]:foo/bar.git bar $ git clone --recursive [email protected]:pivotal-sprout:sprout-git.git pivotal-sproutto be used 
- 
- you can now clone a specific branch using the branch: branch_nameattribute (defaultmaster)
- you can now clone the repositories submodules using recursive: true(default false)
- you can now specify git Github url using github: account]/reposyntax. theurlattribute will override this attribute if both are provided.
 e.g. node_attributes: sprout: git: projects: - github: pivotal-sprout/sprout-git branch: develop recursive: truewill cause the git command: $ git clone -b develop --recursive [email protected]:pivotal-sprout/sprout-git.git pivotal-sproutto be used
- you can now clone a specific branch using the 
- 
Brew has recently changed the output of each brew taptap from "name-of-tap/homebrew-tap" to "name-of-tap/tap". If you getting an error adding custom taps, update your Cheffile.lock to use the latest sprout-git cookbook by usinglibrarian-chef update sprout-git.
- 
This will install git-duet, which allows git commits to have multiple authors. See the git-duet repo 
- 
This will add a custom bash_it plugin that causes git-duet to rotate which author is the committer. 
- 
This will add a custom bash_it plugin that causes git-duet to set global git properties. 
- 
NOTE support for the array syntax has been removed as of 2016-06-08 node_attributes: sprout: git: projects: - # e.g. ~/workspace/foo - foo - https://github.com/pivotal-sprout/sprout-git.gitto an array of hashes: node_attributes: sprout: git: projects: - # e.g. ~/workspace/foo url: https://github.com/pivotal-sprout/sprout-git.git name: foothe tuple syntax is deprecated but will continue to work for the near term until enough people have transitioned. See the Attributes section for more details an the new syntax. 
The commands will be run in sequence. If one of the commands fails (retunrs non-zero) subsequen commands continue to run and the Sprout run is not affected. Future runs of sprout would not re-run these commands unless the repo was previously deleted. i.e. they only get run on a fresh clone of the project.
node_attributes:
  sprout:
    git:
      projects:
        - # an example that initializes submodules, installs all gems, sets up the databases, runs rspec, and executes other arbitrary commands even with some failing
          url: https://github.com/pivotal-sprout/sprout-git.git
          post_clone_commands:
            - git submodule update --init
            - gem install bundler
            - bundle
            - rake db:create db:migrate
            - RAILS_ENV=test rake db:create db:migrate
            - rake spec
            - false
            - echo "I'm still run even though the last command failed"
This is done when the repo is cloned so sprout does not need to explicitly do this.
If the project needs to have submodules initialized then those entries should include the command as a post-clone command. If the soloistrc is still using the legacy tuple syntax which cannot specify post_clone_commands then we continue to run the submodule update --init on all projects regardless of whether they have submodules.
NOTE: All preferences are namespaced under sprout => git they include:
- prefix— the email prefix to used by git-pair — default is- 'pair'
- domain— email address domain to be used by git-pair — default is- 'example.com'
- authors— a list of authors to install either into the ~/.pairs or ~/.git-authors files — default is empty. _see the soloistrc file for examples.
- editor— the value to set for- GIT_EDITOR, defaults to- vim.
- global_configA set of configurations to be installed globally by the- global_configrecipe. — see config.rb
- base_aliasesA set of git aliases like- ci,- br, etc to install. Used by the- aliasesrecipe — dfault is empty. see the soloistrc or aliases.rb files for examples.
- aliases— an additional set of custom aliases to be installed in addition to the- base_aliases. Used by the- aliasesrecipe — default is empty. see the soloistrc or aliases.rb files for examples.
- projects_settings— Global project settings. Used by the- projectsrecipe — this is empty by default see the soloistrc or the attributes/projects.rb files for examples. it contains an array of project hashes with the following keys:- recursive— optional — if- truewill recursively clone all project repos — defaults to- falseand is overridden by the specific project flag
 
- projects— The list of repositories to automatically clone. Used by the- projectsrecipe — this is empty by default see the soloistrc or the attributes/projects.rb files for examples. it contains an array of project hashes with the following keys:- url— optional — The repo url to clone. Note: attribute is required unless- githubis provided — e.g.- https://example.com/some/repo.git
- github— optional — The github repo to clone. Note: will be overridden by the- urlattribute — e.g.- pivotal-sprout/sprout-gitgenerates a- [email protected]:account/repo.giturl
- name— optional — The name of the local folder containing the repo. — e.g.- my_repo
- branch— optional — the initial branch to clone — e.g.- develop
- recursive— optional — if- truewill recursively clone the repo (essintially cloning the projects submodules if present) — defaults to- false
- update— optional — if- truewill update existing repos with a rebase — defaults to- false
- workspace_path— optional — The path to clone into. — e.g.- ~/personal_projectsor- /abs/path/to/personal_projects
- post_clone_commands— optional — A list of commands to run on the freshly cloned repository. Note this is only run on a fresh clone. Future runs of sprout will not cause these commands to be re-run. — Some example commands could include:- gem install bundler
- bundle
- rake db:create:all db:test:prepare default
- pod install
- git submodule update --init
 
 
- sprout-git— default recipe
- sprout-git::aliases— installs common git aliases such as- git st
- sprout-git::authors— install ~/.git-authors file used by git-duet ; note: this is not in the default recipe
- sprout-git::default_editor— installs bash-it plugin to set default git editor
- sprout-git::git_duet— installs git-duet, which allows git commits to have multiple authors. See the git-duet repo ; note: this is not in the default recipe
- sprout-git::git_duet_global— installs a custom bash_it plugin that causes git-duet to set global git properties ; note: this is not in the default recipe
- sprout-git::git_duet_rotate_authors— installs a custom bash_it plugin that causes git-duet to rotate which author is the committer ; note: this is not in the default recipe
- sprout-git::git_scripts— installs pivotal [git_scripts] onto to the system using system ruby. Also installs/overwrites the ~/.pairs file. ; note: this is not in the default recipe
- sprout-git::global_config— adds global git configurations defined by the- sprout => git => global_confignode attributes
- sprout-git::global_ignore— adds basic global git ignore file.- node.git_global_ignore_idea, which is used to determine if .idea files should be ignored, has been flipped from the original behavior in effort to be more intuitive.
- sprout-git::install— install git using homebrew
- sprout-git::projects— clones all projects defined byt the- sprout => git => projectsnode attribute ; note: this is not in the default recipe
./sprout exec rake
The default rake task includes rubocop, foodcritic, unit specs
./sprout exec rake rubocop
./sprout exec rake foodcritic
Unit specs use ChefSpec
./sprout exec rake spec:unit
Integrations specs will run the default recipe on the host system (destructive) and make assertions on the system after install.
Note: It has a precondition that git-pair is not already installed on the system.
./sprout exec rake spec:integration