# Groundskeeper The goal of this gem is to manage the workflow related to releasing and deploying Rails applications. ## Installation Install this gem globally via: ```bash gem install groundskeeper-bitcore ``` Note: if you have multiple versions of Ruby installed (via RVM e.g.), you will need to install this gem for each of them. Additionally, to integrate with Jira you will need to set some environment variables. One standard place to do this is in the `~/.bash_profile`: ```bash export JIRA_USERNAME="my-username" export JIRA_API_TOKEN="my-token" export JIRA_SITE="https://cbit123.atlassian.net" ``` For integration with Sentry, find or create your auth token [from here](https://sentry.io/settings/account/api/auth-tokens/) with the scopes `event:admin, event:read, member:read, org:read, project:read, project:releases, team:read`: ```bash export SENTRY_AUTH_TOKEN="auth-token" export SENTRY_ORG=cbits ``` Then you will need to [install/update the Sentry CLI](https://docs.sentry.io/learn/cli/installation/). Jira integration also depends on a repository that contains metadata for projects. Clone it as follows: ```bash git clone git@github.com:NU-CBITS/project_details.git ~/.project_details ``` To integrate with Slack, set the following environment variables: ```bash SLACK_WORKSPACE SLACK_CHANNEL SLACK_TOKEN ``` ## Usage To display tag/release information about a Rails project, use the `info` command within a Rails application directory: ```bash ground info ``` To create a new release tag, use the `release` command within a Rails application directory: ```bash ground release ``` To prepare the server (only required the first time) for deployment: ```bash tag=0.0.0 stage=production ground predeploy ``` To deploy the release (note that `stage` is optional and will be set to staging by default): ```bash tag=0.0.0 stage=production ground deploy ``` ## Development After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). ## Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/NU-CBITS/groundskeeper. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. ## License The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT). ## Code of Conduct Everyone interacting in the Groundskeeper project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/NU-CBITS/groundskeeper/blob/master/CODE_OF_CONDUCT.md). ## Troubleshooting If ssh connection to github requires a passphrase, this will cause issues with deployment. Add `ssh-add -K ~/.ssh/id_rsa` to the `~/.bash_profile` to solve.