README.md in robopigeon-0.1.0 vs README.md in robopigeon-0.2.0

- old
+ new

@@ -32,143 +32,23 @@ Best way to get started is by running `robopigeon init` and having it write the default robopigeon.rb file. Then, you can reference the DSL below to make changes to your file. -## DSL Reference: -- [Helpers](#helpers) -- [Slack](#slack-1) -- [GitLab](#gitlab-1) +## DSL Reference -### Helpers +Coming soon, stay tuned. In the mean time you can [look at our example file](https://gitlab.com/pigeons/robopigeon/blob/master/lib/robopigeon/resources/initial_robopigeon.rb). -Helpers can be used anywhere in your config! They're useful for things like looking up someone's slack username to mention it in an email, or looking up who's oncall via pagerduty! - -#### Slack -```ruby -slack_name_for 'Email or Name' # slack username just with the @ sign -slack_user_for 'Email or Name' # slack message formatted slack user -slack_user_group 'Group id' # slack message group mention with an id -``` - -#### Git -```ruby -git_committer_name # name of the person who made the last commit -git_committer_email # email address of the person who made the last commit -git_merger_name # name of the person who made the last merge -git_merger_email # email address of the person who made the last merge -git_branch_merged_source # source branch of the last merge -git_branch_merged_target # target branch of the last merge -``` - -#### GitLab -```ruby -deployment_sha 'environment name' # the current deployed sha for a given environment -deployment_ref 'environment name' # the current deploy ref for a given environment -deployment_shortlog 'environment name' # the shortlog comparison between head and an environment -``` - -### Slack - -Here's an example of how to use the slack integration! - -There are two basic parts of the slack integration, there's the top level with the api_key, bot name, and emoji icon. And the job configuration that let's you select channels, users, and specify the text and attachments. - -```ruby -slack do - api_key ENV['SLACK_API_KEY'] # Sets the api key, I like to set it as an env var, defaults to ENV['SLACK_API_KEY'] - name 'RoboPigeon 9000' # The name that Slack displays in the chat - emoji ':robot:' # The emoji icon that the bot uses -end - -job 'super basic' do - slack do - channel '#testing-slackbots' - text 'some information you want to relate' - end -end - -job 'mention a user' do - slack do - channel '#testing-slackbots' - text "#{slack_user_for ENV['GITLAB_USER_EMAIL']} did something awesome!" - end -end - -job 'test failed' do - slack do - channel '#testing-slackbots' # A channel to post the message to - channel '#testing-more-slackbots' # Another channel to post the message to - user 'someone@example.com' # A user that it also sends the message to - user 'someone-else@example.com' # Another user that it also sends the message to - text "Test on #{ENV['CI_MERGE_REQUEST_SOURCE_BRANCH_NAME']} has failed!" - attachment do - title 'Website' - title_link 'http://alex.ives.mn' - pretext 'Here is a button!' - color 'danger' - # Actions take type, text, url, and style - action 'button', 'Website', 'https://alex.ives.mn', 'danger' - end - end -end - -job 'in a different workspace' do - slack do - api_key ENV['SLACK_KEY_FOR_SECOND_SPACE'] - name 'SadBot 9000' - emoji ':sad-pigeon:' - channel '#testing-slackbots' - user 'someone@example.com' - text 'Sent to a different workspace' - end -end - -job 'with complex attachments' do - slack do - user ENV['GITLAB_USER_EMAIL'] - attachment do - color 'good' - fallback "Stuff is happening! <#{ENV['CI_PIPELINE_URL']}|Pipeline> <#{ENV['CI_PROJECT_URL']}|Project>" - action 'button', 'Pipeline', ENV['CI_PIPELINE_URL'], 'primary' - action 'button', 'Project', ENV['CI_PROJECT_URL'], 'primary' - end - attachment do - color 'danger' - fallback "Stuff is happening! <#{ENV['CI_PIPELINE_URL']}|Pipeline> <#{ENV['CI_PROJECT_URL']}|Project>" - action 'button', 'Bad Pipeline', ENV['CI_PIPELINE_URL'], 'danger' - action 'button', 'Bad Project', ENV['CI_PROJECT_URL'] - end - end -end -``` - -### GitLab - -```ruby -gitlab do - api_url 'https://gitlab.example.com/api/v4' # api endpoint for your gitlab server, defaults to ENV['CI_API_V4_URL'] - api_key ENV['GITLAB_API_KEY'] # api key for your gitlab server, defaults to ENV['GITLAB_API_KEY'] -end - -job 'comment on a merge request' do - gitlab do - branch ENV['CI_COMMIT_REF_NAME'] - merge_request_comment 'This comment will appear on all merge requests for the current specified branch' - end -end -``` - ## Development After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` 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 GitLab at https://gitlab.com/robopigeon/robopigeon. +Bug reports and pull requests are welcome on GitLab at https://gitlab.com/pigeons/robopigeon. ### Contributors [Alex Ives](https://alex.ives.mn) [Erik Braegelmann](https://gitlab.com/ebraegelmann) @@ -185,13 +65,13 @@ GitLab - [x] Create, comment on, and merge merge requests - [x] Get data from the gitlab deployments api as a helper - [x] Add helpers to get a list of jira tickets since the provided deployment - [x] Create Tag -- [ ] Create Commits +- [x] Create Commits -Semver Helpers +Semver - [ ] Read a version from a file - [ ] Update version files Slack - [x] Post notifications to channels or users @@ -207,15 +87,27 @@ Git - [x] Add helpers to get information about changes since the last release Jenkins -- [ ] Kick off and monitor a jenkins job until it is completed +- [x] Kick off and monitor a jenkins job until it is completed Extensions -- [ ] Create basic example dsl extension gem template +- [x] Create basic example dsl extension gem template +PagerDuty +- [ ] Get current oncall user from pagerduty api + +Risk Metrics Helpers +- [ ] Globally configure deploy risk metrics +- [ ] Output risk metrics as markdown via kramdown + +Changelog +- [ ] Aggregates changes into log +- [ ] Helpers provide changes since last deployment +- [ ] Changelog yaml front matter informs risk of change + ### Features for future version GitLab - [ ] Wait for a merge request to be ready to merge - [ ] Kick off a pipeline @@ -224,31 +116,42 @@ - [ ] Push subtree - [ ] Create releases - [ ] Create Issue - [ ] Update issue tags - [ ] Assign Issue +- [ ] Write file to wiki page +- [ ] Write to snippet GitHub - [ ] Create, comment on, and merge pull requests - [ ] Create Tag - [ ] Create Commits - [ ] Create Release - [ ] Push subtree - [ ] Create Issue - [ ] Update issue tags - [ ] Assign Issue +- [ ] Write to Gist +Gitter +- [ ] Post notifications to channels or users +- [ ] Post notifications and wait for a response + +Confluence +- [ ] Write Content to Confluence Page + +MediaWiki +- [ ] Write Content to Wiki Page + Slack - [ ] Migrate to block syntax for messages -Changelog -- [ ] Aggregates changes into log -- [ ] Helpers provide changes since last deployment - Extensions - [ ] Default jobs extension - [ ] Jira ticket configuration extension - [ ] Slack action template +- [ ] Gitlab issue configuration extension +- [ ] GitHub issue configuration extension ### Technical Debt - [x] Document all the dsl methods with RoboPigeon::Documentarian - [x] Re-organize code into modules by subject (eg: git, slack, gitlab, jira, ect)