├── .bundler-audit.yml
├── .dockerignore
├── .env.bootstrap
├── .env.example
├── .env.test
├── .env.virtualbox
├── .github
├── CODEOWNERS
├── PULL_REQUEST_TEMPLATE.md
└── workflows
│ └── actions.yml
├── .gitignore
├── .irbrc.rb
├── .node-version
├── .rubocop.yml
├── .ruby-version
├── Dockerfile
├── Gemfile
├── Gemfile.lock
├── LICENSE
├── Procfile
├── README.md
├── Rakefile
├── app.json
├── app
├── assets
│ ├── images
│ │ ├── ajax-loader.gif
│ │ ├── bitbucket.png
│ │ ├── favicons
│ │ │ ├── 32x32_dark.png
│ │ │ ├── 32x32_green.png
│ │ │ ├── 32x32_light.png
│ │ │ ├── 32x32_red.png
│ │ │ ├── 32x32_yellow.png
│ │ │ ├── 64x64_dark.png
│ │ │ └── 64x64_light.png
│ │ ├── github.png
│ │ ├── gitlab.png
│ │ ├── google.png
│ │ ├── grabber.png
│ │ ├── ldap.png
│ │ ├── logo_dark.png
│ │ ├── logo_dark.transparent.png
│ │ ├── logo_light.png
│ │ └── zendesk.png
│ ├── javascripts
│ │ ├── application.js
│ │ ├── autosubmit.js
│ │ ├── cable.js
│ │ ├── changelog.js
│ │ ├── changesets.js
│ │ ├── channels
│ │ │ ├── deploy_notifications_channel.js
│ │ │ └── job_outputs_channel.js
│ │ ├── collapse_fieldset.js
│ │ ├── dashboards.js
│ │ ├── deploys.js
│ │ ├── expanded_textarea.js
│ │ ├── filter_list.js
│ │ ├── focus_on.js
│ │ ├── instant_errors.js.erb
│ │ ├── lazy_load_nav.js
│ │ ├── lock.js
│ │ ├── log_line_selection.js
│ │ ├── output_scrolling.js
│ │ ├── poll_for_changes.js
│ │ ├── popover.js
│ │ ├── profile.js
│ │ ├── projects.js
│ │ ├── ref_status_typeahead.js
│ │ ├── releases.js
│ │ ├── remove_container.js.erb
│ │ ├── responsive_load.js.erb
│ │ ├── secrets_search.js
│ │ ├── sessions.js
│ │ ├── set_all_row.js
│ │ ├── shared.js
│ │ ├── stages.js
│ │ ├── tabs.js
│ │ ├── time_format.js
│ │ ├── type_to_delete.js
│ │ ├── tz_cookie.js
│ │ ├── underscore_mixins.js
│ │ └── whitespace_stripper.js
│ └── stylesheets
│ │ ├── admin.scss
│ │ ├── admin
│ │ ├── commands.scss
│ │ └── users.scss
│ │ ├── application.scss
│ │ ├── constants.scss
│ │ ├── dashboards.scss
│ │ ├── deploys.scss
│ │ ├── dialogs.scss
│ │ ├── global.scss
│ │ ├── jobs.scss
│ │ ├── locks.scss
│ │ ├── login.scss
│ │ ├── projects.scss
│ │ ├── releases.scss
│ │ ├── sessions.scss
│ │ ├── spinners.scss
│ │ ├── stages.scss
│ │ ├── timeline.scss
│ │ ├── typeahead.scss
│ │ └── webhooks.scss
├── channels
│ ├── application_cable
│ │ └── connection.rb
│ ├── deploy_notifications_channel.rb
│ └── job_outputs_channel.rb
├── controllers
│ ├── access_requests_controller.rb
│ ├── access_tokens_controller.rb
│ ├── application_controller.rb
│ ├── audits_controller.rb
│ ├── automated_deploys_controller.rb
│ ├── build_commands_controller.rb
│ ├── builds_controller.rb
│ ├── changelogs_controller.rb
│ ├── commands_controller.rb
│ ├── commit_statuses_controller.rb
│ ├── concerns
│ │ ├── current_project.rb
│ │ ├── current_stage.rb
│ │ ├── current_user.rb
│ │ ├── json_exceptions.rb
│ │ ├── json_pagination.rb
│ │ ├── json_renderer.rb
│ │ └── wrap_in_with_deleted.rb
│ ├── csv_exports_controller.rb
│ ├── dashboards_controller.rb
│ ├── deploy_groups_controller.rb
│ ├── deploys_controller.rb
│ ├── doorkeeper_base_controller.rb
│ ├── environments_controller.rb
│ ├── integrations
│ │ ├── base_controller.rb
│ │ ├── buildkite_controller.rb
│ │ ├── circleci_controller.rb
│ │ ├── generic_controller.rb
│ │ ├── github_controller.rb
│ │ ├── jenkins_controller.rb
│ │ ├── semaphore_controller.rb
│ │ ├── tddium_controller.rb
│ │ └── travis_controller.rb
│ ├── jobs_controller.rb
│ ├── locks_controller.rb
│ ├── mass_rollouts_controller.rb
│ ├── oauth_test_controller.rb
│ ├── outbound_webhooks_controller.rb
│ ├── ping_controller.rb
│ ├── profiles_controller.rb
│ ├── projects_controller.rb
│ ├── references_controller.rb
│ ├── releases_controller.rb
│ ├── resource_controller.rb
│ ├── secret_sharing_grants_controller.rb
│ ├── secrets_controller.rb
│ ├── sessions_controller.rb
│ ├── stages_controller.rb
│ ├── stars_controller.rb
│ ├── unauthorized_controller.rb
│ ├── user_merges_controller.rb
│ ├── user_project_roles_controller.rb
│ ├── users_controller.rb
│ ├── vault_servers_controller.rb
│ └── webhooks_controller.rb
├── helpers
│ ├── access_request_helper.rb
│ ├── application_helper.rb
│ ├── audits_helper.rb
│ ├── builds_helper.rb
│ ├── dashboards_helper.rb
│ ├── date_time_helper.rb
│ ├── deploys_helper.rb
│ ├── jobs_helper.rb
│ ├── locks_helper.rb
│ ├── projects_helper.rb
│ ├── releases_helper.rb
│ ├── secrets_helper.rb
│ ├── sessions_helper.rb
│ ├── stages_helper.rb
│ ├── status_helper.rb
│ ├── user_project_roles_helper.rb
│ └── webhooks_helper.rb
├── jobs
│ └── csv_export_job.rb
├── mailers
│ ├── access_request_mailer.rb
│ ├── application_mailer.rb
│ ├── csv_mailer.rb
│ ├── deploy_mailer.rb
│ └── project_mailer.rb
├── models
│ ├── access_control.rb
│ ├── access_request.rb
│ ├── build.rb
│ ├── changeset.rb
│ ├── changeset
│ │ ├── code_push.rb
│ │ ├── commit.rb
│ │ ├── github_user.rb
│ │ ├── issue_comment.rb
│ │ ├── jira_issue.rb
│ │ └── pull_request.rb
│ ├── command.rb
│ ├── commit_status.rb
│ ├── concerns
│ │ ├── attr_encrypted_support.rb
│ │ ├── audit_on_association.rb
│ │ ├── group_scope.rb
│ │ ├── has_role.rb
│ │ ├── inlinable.rb
│ │ ├── lockable.rb
│ │ ├── permalinkable.rb
│ │ ├── searchable.rb
│ │ └── soft_delete_with_destroy.rb
│ ├── csv_export.rb
│ ├── deploy.rb
│ ├── deploy_build.rb
│ ├── deploy_group.rb
│ ├── deploy_groups_stage.rb
│ ├── deploy_metrics.rb
│ ├── deploy_service.rb
│ ├── docker_builder_service.rb
│ ├── docker_registry.rb
│ ├── environment.rb
│ ├── event_streamer.rb
│ ├── git_repository.rb
│ ├── image_builder.rb
│ ├── job.rb
│ ├── job_execution.rb
│ ├── job_queue.rb
│ ├── job_viewers.rb
│ ├── lock.rb
│ ├── multi_lock.rb
│ ├── null_user.rb
│ ├── outbound_webhook.rb
│ ├── outbound_webhook_stage.rb
│ ├── output_buffer.rb
│ ├── project.rb
│ ├── release.rb
│ ├── release_service.rb
│ ├── restart_signal_handler.rb
│ ├── role.rb
│ ├── secret_sharing_grant.rb
│ ├── stage.rb
│ ├── stage_command.rb
│ ├── star.rb
│ ├── terminal_executor.rb
│ ├── terminal_output_scanner.rb
│ ├── user.rb
│ ├── user_project_role.rb
│ ├── webhook.rb
│ └── webhook_recorder.rb
├── presenters
│ ├── deploy_group_usage_csv_presenter.rb
│ └── user_csv_presenter.rb
└── views
│ ├── access_requests
│ └── new.html.erb
│ ├── access_tokens
│ ├── index.html.erb
│ └── new.html.erb
│ ├── audits
│ ├── _table.html.erb
│ ├── index.html.erb
│ └── show.html.erb
│ ├── build_commands
│ └── show.html.erb
│ ├── builds
│ ├── _build.html.erb
│ ├── edit.html.erb
│ ├── index.html.erb
│ ├── new.html.erb
│ └── show.html.erb
│ ├── changelogs
│ └── show.html.erb
│ ├── changeset
│ ├── _commits.html.erb
│ ├── _files.html.erb
│ ├── _jira_issues.html.erb
│ ├── _pull_requests.html.erb
│ ├── _risks.html.erb
│ └── _tab_list.html.erb
│ ├── commands
│ ├── _buttons.html.erb
│ ├── _form.html.erb
│ ├── edit.html.erb
│ ├── index.html.erb
│ ├── new.html.erb
│ └── show.html.erb
│ ├── csv_exports
│ ├── index.html.erb
│ ├── new.html.erb
│ ├── new_deploy_group_usage.erb
│ ├── new_users.html.erb
│ └── show.html.erb
│ ├── dashboards
│ ├── _row.html.erb
│ └── show.html.erb
│ ├── deploy_groups
│ ├── _deploy_group_select.html.erb
│ ├── _fields.html.erb
│ ├── _mass_rollout_form.html.erb
│ ├── _mass_stage_creation_form.html.erb
│ ├── edit.html.erb
│ ├── index.html.erb
│ ├── missing_config.html.erb
│ ├── new.html.erb
│ └── show.html.erb
│ ├── deploy_mailer
│ ├── _commit_info.html.erb
│ ├── _commit_info.text.erb
│ ├── bypass_email.html.erb
│ ├── bypass_email.text.erb
│ ├── bypass_jira_email.html.erb
│ ├── bypass_jira_email.text.erb
│ ├── deploy_email.html.erb
│ └── deploy_email.text.erb
│ ├── deploys
│ ├── _buddy_check.html.erb
│ ├── _currently_deployed.html.erb
│ ├── _deploy.html.erb
│ ├── _header.html.erb
│ ├── _job_executions.html.erb
│ ├── _queued.html.erb
│ ├── _recent_releases.html.erb
│ ├── _table.html.erb
│ ├── active.erb
│ ├── changeset.html.erb
│ ├── index.html.erb
│ ├── new.html.erb
│ └── show.html.erb
│ ├── environments
│ ├── index.html.erb
│ └── show.html.erb
│ ├── jobs
│ ├── _header.html.erb
│ ├── _job.html.erb
│ ├── _log.html.erb
│ ├── _restarting.html.erb
│ ├── index.html.erb
│ └── show.html.erb
│ ├── kaminari
│ ├── _first_page.html.erb
│ ├── _gap.html.erb
│ ├── _last_page.html.erb
│ ├── _next_page.html.erb
│ ├── _page.html.erb
│ ├── _paginator.html.erb
│ └── _prev_page.html.erb
│ ├── layouts
│ ├── _alerts.html.erb
│ ├── _footer.html.erb
│ ├── _header.html.erb
│ └── application.html.erb
│ ├── locks
│ ├── _button.html.erb
│ ├── _lock.html.erb
│ └── _lock_button.html.erb
│ ├── mass_rollouts
│ ├── new.html.erb
│ └── review_deploy.html.erb
│ ├── outbound_webhooks
│ ├── _fields.html.erb
│ ├── index.html.erb
│ └── show.html.erb
│ ├── profiles
│ └── show.html.erb
│ ├── projects
│ ├── _docker_fields.html.erb
│ ├── _form.html.erb
│ ├── _header.html.erb
│ ├── _nav.html.erb
│ ├── _project.html.erb
│ ├── _stage.html.erb
│ ├── _stage_name_filter.html.erb
│ ├── edit.html.erb
│ ├── index.html.erb
│ ├── new.html.erb
│ └── show.html.erb
│ ├── releases
│ ├── _deploy_to_button.html.erb
│ ├── _release.html.erb
│ ├── index.html.erb
│ ├── new.html.erb
│ ├── row_content.html.erb
│ └── show.html.erb
│ ├── secret_sharing_grants
│ ├── index.html.erb
│ ├── new.html.erb
│ └── show.html.erb
│ ├── secrets
│ ├── _extras.html.erb
│ ├── _header.html.erb
│ ├── _row.html.erb
│ ├── _sharing_grants.html.erb
│ ├── duplicates.html.erb
│ ├── history.html.erb
│ ├── index.html.erb
│ └── show.html.erb
│ ├── sessions
│ └── new.html.erb
│ ├── shared
│ ├── _access_token_table.html.erb
│ ├── _dashboard.html.erb
│ ├── _dashboard_field.html.erb
│ ├── _errors.html.erb
│ ├── _github_link.html.erb
│ ├── _gitlab_link.html.erb
│ ├── _notify_buddy_box.html.erb
│ ├── _output.html.erb
│ ├── _output_stream.html.erb
│ ├── _project_tabs.html.erb
│ ├── _search_bar.html.erb
│ ├── _search_query.erb
│ └── _user_project_role.html.erb
│ ├── stages
│ ├── _commands.html.erb
│ ├── _deploy_failure_emails.html.erb
│ ├── _fields.html.erb
│ ├── _form.html.erb
│ ├── _new_command.html.erb
│ ├── edit.html.erb
│ ├── index.html.erb
│ ├── new.html.erb
│ └── show.html.erb
│ ├── user_merges
│ └── new.html.erb
│ ├── user_project_roles
│ ├── _search_bar.html.erb
│ ├── _user_project_role.html.erb
│ └── index.html.erb
│ ├── users
│ ├── _project.html.erb
│ ├── _roles.html.erb
│ ├── _user.html.erb
│ ├── index.html.erb
│ ├── new.html.erb
│ └── show.html.erb
│ ├── vault_servers
│ ├── index.html.erb
│ └── show.html.erb
│ └── webhooks
│ └── index.html.erb
├── bin
├── decode_dot_env
├── rails
├── rake
├── script-executor
└── setup
├── config.ru
├── config
├── application.rb
├── boot.rb
├── brakeman.ignore
├── cable.yml
├── database.mysql.yml.example
├── database.postgres.yml.example
├── database.sqlite.yml.example
├── dotenv.rb
├── environment.rb
├── environments
│ ├── development.rb
│ ├── production.rb
│ ├── staging.rb
│ └── test.rb
├── initializers
│ ├── audited.rb
│ ├── backtrace_cleaner.rb
│ ├── backtrace_silencers.rb
│ ├── bootstrap.rb
│ ├── console.rb
│ ├── docker.rb
│ ├── doorkeeper.rb
│ ├── extra_dig.rb
│ ├── faraday.rb
│ ├── git.rb
│ ├── ignored_errors.rb
│ ├── inflections.rb
│ ├── migration_resetter.rb
│ ├── mime_types.rb
│ ├── multithreaded_loading.rb
│ ├── octokit.rb
│ ├── omniauth.rb
│ ├── pagy.rb
│ ├── periodical.rb
│ ├── secret_token.rb
│ ├── session_store.rb
│ ├── smtp.rb
│ ├── sockify.rb
│ ├── statsd.rb
│ ├── thread_abort.rb
│ ├── timezone.rb
│ ├── vault.rb
│ ├── version.rb
│ ├── warden.rb
│ └── wrap_parameters.rb
├── locales
│ └── en.yml
├── logging.rb
├── puma.rb
└── routes.rb
├── db
├── migrate
│ ├── 20130807182821_create_projects.rb
│ ├── 20130807191252_create_users.rb
│ ├── 20130813002317_add_user_roles.rb
│ ├── 20131007183106_add_user_current_token.rb
│ ├── 20140106235614_create_stages.rb
│ ├── 20140107000028_create_jobs.rb
│ ├── 20140107000258_create_deploys.rb
│ ├── 20140108010302_add_token_to_projects.rb
│ ├── 20140108011517_create_webhooks.rb
│ ├── 20140108043655_add_notify_email_address_to_stages.rb
│ ├── 20140109041859_add_order_to_stage.rb
│ ├── 20140109053431_job_text_upgrade.rb
│ ├── 20140109073634_create_commands.rb
│ ├── 20140109074325_remove_command_from_stage.rb
│ ├── 20140110000439_create_stage_commands.rb
│ ├── 20140113083726_add_project_and_global_to_commands.rb
│ ├── 20140114004419_add_deletion_time_to_stages.rb
│ ├── 20140114051012_add_reference_to_jobs.rb
│ ├── 20140115063327_add_index_to_deploy.rb
│ ├── 20140115222724_add_stage_confirmation.rb
│ ├── 20140116001521_add_soft_deletion_to_users.rb
│ ├── 20140116041043_create_stars.rb
│ ├── 20140116050403_create_locks.rb
│ ├── 20140227211403_make_confirm_default_to_true.rb
│ ├── 20140331081549_create_releases.rb
│ ├── 20140331094429_add_release_branch_to_projects.rb
│ ├── 20140331121039_add_deploy_on_release_to_stages.rb
│ ├── 20140414123939_rename_user_current_token.rb
│ ├── 20140415011020_add_user_external_id.rb
│ ├── 20140416194907_add_deploy_and_job_indexes.rb
│ ├── 20140520043144_add_description_to_lock.rb
│ ├── 20140625070348_add_buddy_to_deploy.rb
│ ├── 20140707225625_add_started_at_to_deploys.rb
│ ├── 20140717013754_add_production_to_stages.rb
│ ├── 20140804204455_add_soft_deletion_to_deploys.rb
│ ├── 20140902105205_add_indices.rb
│ ├── 20140908154402_add_permalink_to_projects.rb
│ ├── 20140910113325_add_desktop_notify_to_users.rb
│ ├── 20141002162529_add_github_deployment_api_flag_to_stages.rb
│ ├── 20141011000131_add_permalink_to_stages.rb
│ ├── 20141014165353_add_deleted_at_column_to_webhooks.rb
│ ├── 20141021202831_fix_invalid_permalinks.rb
│ ├── 20141021204733_stage_permalink_unique_by_project.rb
│ ├── 20141124214629_remove_unique_index_from_webhooks.rb
│ ├── 20141211003651_jobs_index_on_status.rb
│ ├── 20141211004054_deploys_index_deleted_at.rb
│ ├── 20141211005552_stages_index_deleted_at.rb
│ ├── 20141211005600_projects_index_deleted_at.rb
│ ├── 20141211010750_locks_index_deleted_at.rb
│ ├── 20141211010825_users_index_deleted_at.rb
│ ├── 20141218225050_create_macros.rb
│ ├── 20150109005441_add_description_to_projects.rb
│ ├── 20150220193142_add_dashboard_to_stages.rb
│ ├── 20150223135916_create_deploy_groups.rb
│ ├── 20150224031239_add_email_settings_to_stages.rb
│ ├── 20150228003920_add_warning_to_locks.rb
│ ├── 20150302060555_enforce_lock_user_id.rb
│ ├── 20150312110723_add_permalink_to_environments.rb
│ ├── 20150317205551_jobs_add_tag.rb
│ ├── 20150416231106_add_source_to_webhook.rb
│ ├── 20150508140514_create_builds.rb
│ ├── 20150508142111_add_build_references.rb
│ ├── 20150520210103_create_build_statuses.rb
│ ├── 20150605194346_rename_build_columns.rb
│ ├── 20150605194347_add_docker_build_columns.rb
│ ├── 20150611013506_rename_docker_digest_columns.rb
│ ├── 20150618182108_add_env_value_to_deploy_group.rb
│ ├── 20150619170905_projects_add_deploy_with_docker.rb
│ ├── 20150720121725_add_auto_build_docker_image_to_projects.rb
│ ├── 20150903201829_add_number_to_builds.rb
│ ├── 20150924082915_create_user_project_roles.rb
│ ├── 20151001140703_add_access_request_pending_to_users.rb
│ ├── 20151201104205_add_permalink_to_deploy_groups.rb
│ ├── 20151211031950_add_delete_at_to_lock.rb
│ ├── 20160205015635_add_bypass_buddy_check_to_stages.rb
│ ├── 20160218161746_add_csv_export.rb
│ ├── 20160316233616_soft_delete_stage_command.rb
│ ├── 20160317212902_add_release_flag_to_deploys.rb
│ ├── 20160317215713_rename_bypass_buddy_check.rb
│ ├── 20160328221058_add_time_format_to_user.rb
│ ├── 20160407181257_remove_macros_command.rb
│ ├── 20160408193842_remove_user_from_macro.rb
│ ├── 20160409160258_unify_roles.rb
│ ├── 20160413171549_unique_roles.rb
│ ├── 20160414181707_add_secrets.rb
│ ├── 20160422223358_create_versions.rb
│ ├── 20160429203410_remove_build_statuses.rb
│ ├── 20160508055458_rename_is_production.rb
│ ├── 20160701215002_delete_bad_deploy_groups_stages.rb
│ ├── 20160722205359_create_doorkeeper_tables.rb
│ ├── 20160726210144_add_vault_instance_to_deploy_groups.rb
│ ├── 20160815185747_create_outbound_webhooks.rb
│ ├── 20160818194622_add_visibility_to_secrets.rb
│ ├── 20160818210955_add_comment_to_secrets.rb
│ ├── 20160827172550_add_deploy_to_new_pods_to_projects.rb
│ ├── 20160831151133_add_is_template_to_stage.rb
│ ├── 20160909013442_add_docker_release_branch_to_projects.rb
│ ├── 20160927223306_save_source_template_to_clone_stage.rb
│ ├── 20160929164204_remove_3_state_booleans.rb
│ ├── 20161011173842_add_vault_servers.rb
│ ├── 20161012161509_add_user_id_index_to_jobs.rb
│ ├── 20161014175742_move_vault_instance_to_id.rb
│ ├── 20161019000833_add_environment_to_lock.rb
│ ├── 20161019034559_add_jenkins_email_committers_to_stage.rb
│ ├── 20161026004331_remove_duplicate_versions.rb
│ ├── 20161028173926_add_last_login_at_to_users.rb
│ ├── 20161028211415_track_last_seen_at.rb
│ ├── 20161102201243_add_metadata_to_access_tokens.rb
│ ├── 20161103205530_add_run_in_parallel_to_stages.rb
│ ├── 20161103221846_remove_invalid_users.rb
│ ├── 20161114194705_releases_number_to_string.rb
│ ├── 20161116002724_delete_bogus_builds.rb
│ ├── 20161116022637_add_jenkins_auto_config_build_params_to_stage.rb
│ ├── 20161118215353_add_project_id_to_deploys.rb
│ ├── 20161208170829_bump_lock_description.rb
│ ├── 20161213182356_add_flag_to_skip_kubernetes_rollback.rb
│ ├── 20161216183341_make_project_fields_truly_unique.rb
│ ├── 20161216202909_add_release_sources.rb
│ ├── 20161228210729_rename_docker_ref_to_tag.rb
│ ├── 20170106212807_privatize_all_vault_secrets.rb
│ ├── 20170118172040_add_finished_at_to_builds.rb
│ ├── 20170130235020_add_cancel_queued_deploys_to_stages.rb
│ ├── 20170207193042_add_build_command_to_projects.rb
│ ├── 20170208195102_add_source_url_to_builds.rb
│ ├── 20170208221802_enforce_ordering.rb
│ ├── 20170317001258_add_dashboard_to_projects.rb
│ ├── 20170328214722_add_undecided_deploy_group_for_invalid_stages.rb
│ ├── 20170402035231_add_macro_to_stages.rb
│ ├── 20170407001330_add_canceller_to_jobs.rb
│ ├── 20170502160403_remove_foreign_key.rb
│ ├── 20170505201145_convert_macros_to_stages.rb
│ ├── 20170513222253_remove_macros.rb
│ ├── 20170608174705_create_secret_sharing_grants.rb
│ ├── 20170615183209_install_audited.rb
│ ├── 20170616180533_seed_audited_from_versions.rb
│ ├── 20170622010111_move_scopes.rb
│ ├── 20170718083150_cleanup_bad_roles.rb
│ ├── 20170727181942_add_deprecated_at_to_secret.rb
│ ├── 20170728231915_add_daily_deploymemnt_to_stages.rb
│ ├── 20170817213634_bump_audit_size_for_big_envs.rb
│ ├── 20170821222130_add_docker_builds_disabled_flag_to_projects.rb
│ ├── 20170824004459_enable_multiple_dockerfiles.rb
│ ├── 20170824174718_remove_build_from_releases.rb
│ ├── 20170825225929_rename_build_label.rb
│ ├── 20170929181901_add_external_build_attributes.rb
│ ├── 20171012004814_make_build_dockerfile_universal.rb
│ ├── 20171020184047_increase_build_external_id_index_size.rb
│ ├── 20171029071120_backfill_invalid_external_status.rb
│ ├── 20171031104602_make_external_id_unique.rb
│ ├── 20171031110801_remove_noreply.rb
│ ├── 20171215234357_add_builds_in_environment_flag.rb
│ ├── 20171221213213_drop_docker_image_id.rb
│ ├── 20180126004937_remove_build_external_id.rb
│ ├── 20180601222241_remove_user_token.rb
│ ├── 20180611172637_add_average_deploy_time_to_stages.rb
│ ├── 20180719171414_add_confidential_to_doorkeeper_application.rb
│ ├── 20180921170100_add_default_reference_to_stages.rb
│ ├── 20181009022203_add_full_checkout_to_stages.rb
│ ├── 20181111003546_remove_binary_builder.rb
│ ├── 20181127191406_add_redeploy_previous_when_failed.rb
│ ├── 20181201004640_add_versioned_kv_to_vault_server.rb
│ ├── 20190206191721_add_preferred_vault_server.rb
│ ├── 20190311225109_add_sortable_column_for_deploy_groups.rb
│ ├── 20190326183413_de_poly_release_author.rb
│ ├── 20190514215712_alter_secret_sharing_grants_indexes.rb
│ ├── 20190527160620_add_github_username_to_users.rb
│ ├── 20190911050155_alter_build_indexes.rb
│ ├── 20191029174730_remove_deploy_build_id.rb
│ ├── 20191029181037_add_deploy_builds.rb
│ ├── 20191101221308_add_pending_checks_ignore_to_project.rb
│ ├── 20191105170029_make_outbound_webhooks_global.rb
│ ├── 20191108204120_add_auth_types_to_outbound_webhooks.rb
│ ├── 20191108215712_remove_deleted_webhook_columns.rb
│ ├── 20191108223054_add_before_deploy_to_outbound_webhooks.rb
│ ├── 20191108232023_add_status_path_to_outbound_webhook.rb
│ ├── 20191203072937_add_disabled_to_webhooks.rb
│ ├── 20191203085811_add_disabled_to_outbound_webhooks.rb
│ ├── 20191218163745_add_name_to_outbound_webhooks.rb
│ ├── 20200219043627_delete_orphaned_outbound_webhooks.rb
│ └── 20200923223936_change_csv_export_filter_to_text.rb
├── schema.rb
└── seeds.rb
├── docker-compose.yml
├── docs
├── api.md
├── ci.md
├── components.md
├── extra_features.md
├── images
│ ├── datadog.png
│ ├── deploy_group_admin.png
│ ├── deploy_group_admin2.png
│ ├── deploy_group_dash1.png
│ ├── deploy_group_dash2.png
│ ├── request_access_page.png
│ ├── request_access_popup.png
│ └── request_access_profile.png
├── permissions.md
├── plugins.md
├── pre_build_command_example.md
├── secrets.md
├── setup.md
└── stats.md
├── lib
├── generators
│ └── plugin
│ │ ├── USAGE
│ │ ├── plugin_generator.rb
│ │ └── templates
│ │ ├── README
│ │ ├── samson_plugin.gemspec.erb
│ │ ├── samson_plugin.rb.erb
│ │ └── test_helper.rb.erb
├── omniauth
│ └── github_authorization.rb
├── samson
│ ├── boot_check.rb
│ ├── buddy_check.rb
│ ├── build_finder.rb
│ ├── bump_touch.rb
│ ├── command_executor.rb
│ ├── console_extensions.rb
│ ├── diff.rb
│ ├── dynamic_ttl_cache.rb
│ ├── env_check.rb
│ ├── error_notifier.rb
│ ├── extra_dig.rb
│ ├── form_builder.rb
│ ├── hooks.rb
│ ├── integration.rb
│ ├── mapped_database_exceptions.rb
│ ├── natural_order.rb
│ ├── output_utils.rb
│ ├── parallelizer.rb
│ ├── performance_tracer.rb
│ ├── periodical.rb
│ ├── periodical_deploy.rb
│ ├── process_utils.rb
│ ├── readonly_db.rb
│ ├── redeploy_params.rb
│ ├── repo_provider_status.rb
│ ├── retry.rb
│ ├── secrets.rb
│ ├── secrets
│ │ ├── db_backend.rb
│ │ ├── hashicorp_vault_backend.rb
│ │ ├── key_resolver.rb
│ │ ├── manager.rb
│ │ ├── shared
│ │ │ └── list_recursive.rb
│ │ ├── vault_client_manager.rb
│ │ ├── vault_client_wrapper.rb
│ │ ├── vault_kv_wrapper.rb
│ │ ├── vault_logical_wrapper.rb
│ │ └── vault_server.rb
│ ├── syslog_formatter.rb
│ └── time_sum.rb
├── tasks
│ ├── dump.rake
│ ├── maintenance.rake
│ └── reports.rake
└── warden
│ └── strategies
│ └── doorkeeper.rb
├── log
└── .keep
├── package.json
├── plugins
├── airbrake
│ ├── README.md
│ ├── config
│ │ └── initializers
│ │ │ └── airbrake.rb
│ ├── lib
│ │ └── samson_airbrake
│ │ │ └── samson_plugin.rb
│ ├── samson_airbrake.gemspec
│ └── test
│ │ ├── samson_airbrake
│ │ └── samson_plugin_test.rb
│ │ └── test_helper.rb
├── airbrake_hook
│ ├── README.md
│ ├── app
│ │ └── views
│ │ │ └── samson_airbrake_hook
│ │ │ └── _stage_form.html.erb
│ ├── db
│ │ └── migrate
│ │ │ └── 20160915042046_add_airbrake_to_project.rb
│ ├── lib
│ │ └── samson_airbrake_hook
│ │ │ └── samson_plugin.rb
│ ├── samson_airbrake_hook.gemspec
│ └── test
│ │ ├── samson_airbrake_hook
│ │ └── samson_plugin_test.rb
│ │ └── test_helper.rb
├── assertible
│ ├── README.md
│ ├── app
│ │ └── views
│ │ │ └── samson_assertible
│ │ │ └── _stage_form_checkbox.html.erb
│ ├── db
│ │ └── migrate
│ │ │ └── 20180209012126_add_notify_assertible_to_stages.rb
│ ├── lib
│ │ └── samson_assertible
│ │ │ └── samson_plugin.rb
│ ├── samson_assertible.gemspec
│ └── test
│ │ ├── samson_assertible
│ │ └── samson_plugin_test.rb
│ │ └── test_helper.rb
├── aws_ecr
│ ├── README.md
│ ├── lib
│ │ └── samson_aws_ecr
│ │ │ └── samson_plugin.rb
│ ├── samson_aws_ecr.gemspec
│ └── test
│ │ ├── samson_aws_ecr
│ │ └── samson_plugin_test.rb
│ │ └── test_helper.rb
├── aws_sts
│ ├── README.md
│ ├── app
│ │ └── views
│ │ │ └── samson_aws_sts
│ │ │ └── _stage_form.html.erb
│ ├── db
│ │ └── migrate
│ │ │ └── 20181001083613_add_aws_sts_arn_to_stages.rb
│ ├── decorators
│ │ └── stage_decorator.rb
│ ├── lib
│ │ └── samson_aws_sts
│ │ │ └── samson_plugin.rb
│ ├── samson_aws_sts.gemspec
│ └── test
│ │ ├── decorators
│ │ └── stage_decorator_test.rb
│ │ ├── samson_aws_sts
│ │ └── samson_plugin_test.rb
│ │ └── test_helper.rb
├── datadog
│ ├── README.md
│ ├── app
│ │ ├── controllers
│ │ │ └── datadog
│ │ │ │ └── monitors_controller.rb
│ │ ├── models
│ │ │ ├── concerns
│ │ │ │ └── accepts_datadog_monitor_queries.rb
│ │ │ ├── datadog_deploy_event.rb
│ │ │ ├── datadog_monitor.rb
│ │ │ └── datadog_monitor_query.rb
│ │ └── views
│ │ │ └── samson_datadog
│ │ │ ├── _datadog_monitor_queries_fields.html.erb
│ │ │ ├── _monitor_list.html.erb
│ │ │ ├── _project_dashboard.html.erb
│ │ │ ├── _project_form.html.erb
│ │ │ ├── _stage_form.html.erb
│ │ │ └── _stage_show.html.erb
│ ├── config
│ │ └── routes.rb
│ ├── db
│ │ └── migrate
│ │ │ ├── 20140203155241_add_datadog_tag_to_stages.rb
│ │ │ ├── 20150309212516_add_datadog_monitor_id_to_stage.rb
│ │ │ ├── 20190620184209_migrate_datadog_monitors_to_table.rb
│ │ │ ├── 20190621145446_remove_old_datadog_ids_column.rb
│ │ │ ├── 20190621175829_add_rollback_to_datadog_monitors.rb
│ │ │ ├── 20190626012607_rename_rollback_on_failure.rb
│ │ │ ├── 20190626163916_add_scoping_to_datadog_monitors.rb
│ │ │ ├── 20190627154835_add_failure_options_to_datadog.rb
│ │ │ ├── 20190627175546_add_datadog_check_duration_min.rb
│ │ │ ├── 20190627201304_add_monitors_to_projects.rb
│ │ │ ├── 20190627211709_remove_deprecated_monitor_stage_id.rb
│ │ │ └── 20190808225957_add_datadog_timestamps.rb
│ ├── decorators
│ │ ├── deploy_decorator.rb
│ │ ├── project_decorator.rb
│ │ └── stage_decorator.rb
│ ├── lib
│ │ └── samson_datadog
│ │ │ └── samson_plugin.rb
│ ├── samson_datadog.gemspec
│ └── test
│ │ ├── controllers
│ │ └── datadog
│ │ │ └── monitors_controller_test.rb
│ │ ├── decorators
│ │ ├── deploy_decorator_test.rb
│ │ ├── project_decorator_test.rb
│ │ └── stage_decorator_test.rb
│ │ ├── models
│ │ ├── concerns
│ │ │ └── accepts_datadog_monitor_queries_test.rb
│ │ ├── datadog_deploy_event_test.rb
│ │ ├── datadog_monitor_query_test.rb
│ │ └── datadog_monitor_test.rb
│ │ ├── samson_datadog
│ │ └── samson_plugin_test.rb
│ │ └── test_helper.rb
├── datadog_tracer
│ ├── README.md
│ ├── config
│ │ └── initializers
│ │ │ └── datadog_tracer.rb
│ ├── lib
│ │ └── samson_datadog_tracer
│ │ │ └── samson_plugin.rb
│ ├── samson_datadog_tracer.gemspec
│ └── test
│ │ ├── samson_datadog_tracer
│ │ └── samson_plugin_test.rb
│ │ └── test_helper.rb
├── env
│ ├── README.md
│ ├── app
│ │ ├── assets
│ │ │ ├── javascripts
│ │ │ │ └── env
│ │ │ │ │ └── application.js
│ │ │ └── stylesheets
│ │ │ │ └── env
│ │ │ │ └── application.css
│ │ ├── controllers
│ │ │ ├── env
│ │ │ │ └── environment_controller.rb
│ │ │ ├── environment_variable_groups_controller.rb
│ │ │ ├── environment_variables_controller.rb
│ │ │ └── external_environment_variable_groups_controller.rb
│ │ ├── helpers
│ │ │ └── environment_variables_helper.rb
│ │ ├── models
│ │ │ ├── concerns
│ │ │ │ ├── accepts_environment_variables.rb
│ │ │ │ └── scopes_environment_variables.rb
│ │ │ ├── environment_variable.rb
│ │ │ ├── environment_variable_group.rb
│ │ │ ├── external_environment_variable_group.rb
│ │ │ └── project_environment_variable_group.rb
│ │ └── views
│ │ │ ├── environment_variable_groups
│ │ │ ├── _projects.html.erb
│ │ │ ├── form.html.erb
│ │ │ ├── index.html.erb
│ │ │ └── preview.html.erb
│ │ │ ├── environment_variables
│ │ │ └── index.html.erb
│ │ │ ├── external_environment_variable_groups
│ │ │ ├── _fields.html.erb
│ │ │ └── preview.html.erb
│ │ │ └── samson_env
│ │ │ ├── _deploy_changeset_tab_body.html.erb
│ │ │ ├── _deploy_changeset_tab_nav.html.erb
│ │ │ ├── _deploy_form.html.erb
│ │ │ ├── _environment_variables.html.erb
│ │ │ ├── _environment_variables_fields.html.erb
│ │ │ ├── _manage_menu.html.erb
│ │ │ ├── _project_form.html.erb
│ │ │ └── _stage_form.html.erb
│ ├── config
│ │ └── routes.rb
│ ├── db
│ │ └── migrate
│ │ │ ├── 20150527210505_add_environment_variables.rb
│ │ │ ├── 20150603211116_change_env_deploy_group_to_scope.rb
│ │ │ ├── 20150608214904_move_env_to_project.rb
│ │ │ ├── 20170320213836_delete_abandomed_env_vars.rb
│ │ │ ├── 20170922174850_expand_env_vars.rb
│ │ │ ├── 20180329204838_add_env_state_to_deploy.rb
│ │ │ ├── 20180528222146_delete_deploy_env_vars.rb
│ │ │ ├── 20180802182824_bump_env_state_size.rb
│ │ │ ├── 20181023212711_add_use_env_repo_to_project.rb
│ │ │ ├── 20190513171548_add_config_service_to_project.rb
│ │ │ ├── 20191113043345_add_owners_to_env_groups.rb
│ │ │ ├── 20200109202014_remove_config_service_from_projects.rb
│ │ │ ├── 20200110213328_create_external_environment_variable_groups.rb
│ │ │ ├── 20200402190202_add_external_url_to_env_groups.rb
│ │ │ └── 20200402195119_remove_env_repo.rb
│ ├── decorators
│ │ ├── deploy_decorator.rb
│ │ ├── deploy_group_decorator.rb
│ │ ├── environment_decorator.rb
│ │ ├── project_decorator.rb
│ │ └── stage_decorator.rb
│ ├── lib
│ │ └── samson_env
│ │ │ └── samson_plugin.rb
│ ├── samson_env.gemspec
│ └── test
│ │ ├── controllers
│ │ ├── env
│ │ │ └── environment_controller_test.rb
│ │ ├── environment_variable_groups_controller_test.rb
│ │ ├── environment_variables_controller_test.rb
│ │ └── external_environment_variable_groups_controller_test.rb
│ │ ├── decorators
│ │ ├── deploy_decorator_test.rb
│ │ ├── deploy_group_decorator_test.rb
│ │ ├── environment_decorator_test.rb
│ │ ├── project_decorator_test.rb
│ │ └── stage_decorator_test.rb
│ │ ├── helpers
│ │ └── environment_variables_helper_test.rb
│ │ ├── models
│ │ ├── concerns
│ │ │ ├── accepts_environment_variables_test.rb
│ │ │ └── scopes_environment_variables_test.rb
│ │ ├── environment_variable_group_test.rb
│ │ ├── environment_variable_test.rb
│ │ ├── external_environment_variable_group_test.rb
│ │ └── project_environment_variable_group_test.rb
│ │ ├── samson_env
│ │ └── samson_plugin_test.rb
│ │ └── test_helper.rb
├── flowdock
│ ├── README.md
│ ├── app
│ │ ├── controllers
│ │ │ └── flowdock_controller.rb
│ │ ├── models
│ │ │ ├── flowdock_flow.rb
│ │ │ ├── flowdock_notification.rb
│ │ │ └── flowdock_notification_renderer.rb
│ │ └── views
│ │ │ └── samson_flowdock
│ │ │ ├── _deploy_view.html.erb
│ │ │ ├── _stage_form.html.erb
│ │ │ └── notification.html.erb
│ ├── config
│ │ └── routes.rb
│ ├── db
│ │ └── migrate
│ │ │ ├── 20140113010124_create_flowdock_flows.rb
│ │ │ ├── 20150302060556_engine_migration.rb
│ │ │ ├── 20150327144239_add_flowdock_checkbox_to_flowdock_flows.rb
│ │ │ ├── 20160929164311_remove_3_state_booleans_p2.rb
│ │ │ └── 20170310033621_remove_enabled_flag.rb
│ ├── decorators
│ │ └── stage_decorator.rb
│ ├── lib
│ │ └── samson_flowdock
│ │ │ ├── flowdock_service.rb
│ │ │ └── samson_plugin.rb
│ ├── samson_flowdock.gemspec
│ └── test
│ │ ├── controllers
│ │ └── flowdock_controller_test.rb
│ │ ├── decorators
│ │ └── stage_decorator_test.rb
│ │ ├── models
│ │ ├── flowdock_flow_test.rb
│ │ ├── flowdock_notification_renderer_test.rb
│ │ └── flowdock_notification_test.rb
│ │ ├── samson_flowdock
│ │ ├── flowdock_service_test.rb
│ │ └── samson_plugin_test.rb
│ │ └── test_helper.rb
├── gcloud
│ ├── README.md
│ ├── app
│ │ ├── controllers
│ │ │ ├── gcloud_controller.rb
│ │ │ └── gke_clusters_controller.rb
│ │ ├── models
│ │ │ └── gke_cluster.rb
│ │ └── views
│ │ │ ├── gke_clusters
│ │ │ └── new.html.erb
│ │ │ └── samson_gcloud
│ │ │ └── _build_button.html.erb
│ ├── config
│ │ └── routes.rb
│ ├── db
│ │ └── migrate
│ │ │ ├── 20171110221726_add_build_with_gcb_to_project.rb
│ │ │ ├── 20180125005426_add_gcr_vulnerability_scanning.rb
│ │ │ └── 20190111195416_remove_scan_result_cache_col.rb
│ ├── decorators
│ │ ├── build_decorator.rb
│ │ └── project_decorator.rb
│ ├── gcloud.gemspec
│ ├── lib
│ │ └── samson_gcloud
│ │ │ ├── image_builder.rb
│ │ │ ├── image_tagger.rb
│ │ │ ├── samson_plugin.rb
│ │ │ └── tag_resolver.rb
│ └── test
│ │ ├── controllers
│ │ ├── gcloud_controller_test.rb
│ │ └── gke_clusters_controller_test.rb
│ │ ├── decorators
│ │ ├── build_decorator_test.rb
│ │ └── project_decorator_test.rb
│ │ ├── models
│ │ └── gke_cluster_test.rb
│ │ ├── samson_gcloud
│ │ ├── image_builder_test.rb
│ │ ├── image_tagger_test.rb
│ │ ├── samson_plugin_test.rb
│ │ └── tag_resolver_test.rb
│ │ └── test_helper.rb
├── github
│ ├── README.md
│ ├── app
│ │ ├── models
│ │ │ ├── github_deployment.rb
│ │ │ └── github_notification.rb
│ │ └── views
│ │ │ └── samson_github
│ │ │ └── _stage_form.html.erb
│ ├── db
│ │ └── migrate
│ │ │ ├── 20140319001623_add_github_confirmation_to_stages.rb
│ │ │ ├── 20160901175936_prevent_3_state_booleans.rb
│ │ │ └── 20190403185409_add_git_hub_pull_request_comment_to_stages.rb
│ ├── decorators
│ │ └── stage_decorator.rb
│ ├── lib
│ │ └── samson_github
│ │ │ └── samson_plugin.rb
│ ├── samson_github.gemspec
│ └── test
│ │ ├── decorators
│ │ └── stage_decorator_test.rb
│ │ ├── models
│ │ ├── github_deployment_test.rb
│ │ └── github_notification_test.rb
│ │ ├── samson_github
│ │ └── samson_plugin_test.rb
│ │ └── test_helper.rb
├── gitlab
│ ├── README.md
│ ├── app
│ │ └── models
│ │ │ └── gitlab
│ │ │ ├── changeset_presenter.rb
│ │ │ ├── commit_presenter.rb
│ │ │ └── file_presenter.rb
│ ├── lib
│ │ └── samson_gitlab
│ │ │ └── samson_plugin.rb
│ ├── samson_gitlab.gemspec
│ └── test
│ │ ├── models
│ │ └── gitlab
│ │ │ ├── changeset_presenter_test.rb
│ │ │ ├── commit_presenter_test.rb
│ │ │ └── file_presenter_test.rb
│ │ ├── samson_gitlab
│ │ └── samson_plugin_test.rb
│ │ └── test_helper.rb
├── jenkins
│ ├── README.md
│ ├── app
│ │ ├── helpers
│ │ │ └── jenkins_helper.rb
│ │ ├── models
│ │ │ ├── jenkins_job.rb
│ │ │ └── samson
│ │ │ │ └── jenkins.rb
│ │ └── views
│ │ │ └── samson_jenkins
│ │ │ ├── _deploys_header.html.erb
│ │ │ └── _stage_form.html.erb
│ ├── db
│ │ └── migrate
│ │ │ ├── 20150318215604_add_jenkins_jobs_to_stage.rb
│ │ │ ├── 20150325010900_create_jenkins_jobs.rb
│ │ │ ├── 20150519000042_add_url_to_jenkins_jobs.rb
│ │ │ ├── 20150529162928_make_jenkins_job_id_allow_null.rb
│ │ │ └── 20170616174952_delete_jenkins_versions.rb
│ ├── decorators
│ │ └── deploy_decorator.rb
│ ├── lib
│ │ └── samson_jenkins
│ │ │ └── samson_plugin.rb
│ ├── samson_jenkins.gemspec
│ └── test
│ │ ├── decorators
│ │ └── deploy_decorator_test.rb
│ │ ├── helpers
│ │ └── jenkins_helper_test.rb
│ │ ├── models
│ │ ├── jenkins_job_test.rb
│ │ └── samson
│ │ │ └── jenkins_test.rb
│ │ ├── samson_jenkins
│ │ └── samson_plugin_test.rb
│ │ └── test_helper.rb
├── jenkins_status_checker
│ ├── README.md
│ ├── app
│ │ ├── models
│ │ │ └── jenkins_status_checker.rb
│ │ └── views
│ │ │ └── samson_jenkins_status_checker
│ │ │ ├── _deploy_form.html.erb
│ │ │ └── _project_form_checkbox.html.erb
│ ├── db
│ │ └── migrate
│ │ │ └── 20180327005536_add_jenkins_status_checker.rb
│ ├── lib
│ │ └── samson_jenkins_status_checker
│ │ │ └── samson_plugin.rb
│ ├── samson_jenkins_status_checker.gemspec
│ └── test
│ │ ├── models
│ │ └── jenkins_status_checker_test.rb
│ │ ├── samson_jenkins_status_checker
│ │ └── samson_plugin_test.rb
│ │ └── test_helper.rb
├── jira
│ ├── README.md
│ ├── app
│ │ └── views
│ │ │ └── samson_jira
│ │ │ ├── _project_form.html.erb
│ │ │ └── _stage_form.html.erb
│ ├── db
│ │ └── migrate
│ │ │ └── 20190731123954_add_jira_fields.rb
│ ├── lib
│ │ └── samson_jira
│ │ │ └── samson_plugin.rb
│ ├── samson_jira.gemspec
│ └── test
│ │ ├── samson_jira
│ │ └── samson_plugin_test.rb
│ │ └── test_helper.rb
├── kubernetes
│ ├── README.md
│ ├── app
│ │ ├── assets
│ │ │ ├── images
│ │ │ │ └── kubernetes
│ │ │ │ │ └── icon.png
│ │ │ └── stylesheets
│ │ │ │ └── kubernetes
│ │ │ │ └── application.scss
│ │ ├── controllers
│ │ │ └── kubernetes
│ │ │ │ ├── clusters_controller.rb
│ │ │ │ ├── deploy_group_roles_controller.rb
│ │ │ │ ├── namespaces_controller.rb
│ │ │ │ ├── role_verifications_controller.rb
│ │ │ │ ├── roles_controller.rb
│ │ │ │ ├── stages_controller.rb
│ │ │ │ └── usage_limits_controller.rb
│ │ ├── helpers
│ │ │ └── deploy_group_roles_helper.rb
│ │ ├── models
│ │ │ └── kubernetes
│ │ │ │ ├── api
│ │ │ │ └── pod.rb
│ │ │ │ ├── cluster.rb
│ │ │ │ ├── cluster_deploy_group.rb
│ │ │ │ ├── deploy_executor.rb
│ │ │ │ ├── deploy_group_role.rb
│ │ │ │ ├── namespace.rb
│ │ │ │ ├── release.rb
│ │ │ │ ├── release_doc.rb
│ │ │ │ ├── resource.rb
│ │ │ │ ├── resource_status.rb
│ │ │ │ ├── role.rb
│ │ │ │ ├── role_config_file.rb
│ │ │ │ ├── role_validator.rb
│ │ │ │ ├── stage_role.rb
│ │ │ │ ├── template_filler.rb
│ │ │ │ ├── usage_limit.rb
│ │ │ │ └── util.rb
│ │ └── views
│ │ │ ├── kubernetes
│ │ │ ├── clusters
│ │ │ │ ├── _capacity.html.erb
│ │ │ │ ├── _deploy_group_list.html.erb
│ │ │ │ ├── _form.html.erb
│ │ │ │ ├── edit.html.erb
│ │ │ │ ├── index.html.erb
│ │ │ │ ├── new.html.erb
│ │ │ │ └── show.html.erb
│ │ │ ├── deploy_group_roles
│ │ │ │ ├── _form.html.erb
│ │ │ │ ├── edit.html.erb
│ │ │ │ ├── edit_many.html.erb
│ │ │ │ ├── index.html.erb
│ │ │ │ ├── new.html.erb
│ │ │ │ └── show.html.erb
│ │ │ ├── namespaces
│ │ │ │ ├── _form.html.erb
│ │ │ │ ├── index.html.erb
│ │ │ │ ├── new.html.erb
│ │ │ │ └── show.html.erb
│ │ │ ├── role_verifications
│ │ │ │ └── new.html.erb
│ │ │ ├── roles
│ │ │ │ ├── _form.html.erb
│ │ │ │ ├── _seed.html.erb
│ │ │ │ ├── edit.html.erb
│ │ │ │ ├── example.html.erb
│ │ │ │ ├── index.html.erb
│ │ │ │ ├── new.html.erb
│ │ │ │ └── show.html.erb
│ │ │ └── usage_limits
│ │ │ │ ├── _form.html.erb
│ │ │ │ ├── edit.html.erb
│ │ │ │ ├── index.html.erb
│ │ │ │ ├── new.html.erb
│ │ │ │ └── show.html.erb
│ │ │ └── samson_kubernetes
│ │ │ ├── _deploy_changeset_tab_body.html.erb
│ │ │ ├── _deploy_changeset_tab_nav.html.erb
│ │ │ ├── _deploy_form.html.erb
│ │ │ ├── _deploy_group_form.html.erb
│ │ │ ├── _deploy_group_show.html.erb
│ │ │ ├── _deploy_group_table_cell.html.erb
│ │ │ ├── _deploy_group_table_header.html.erb
│ │ │ ├── _manage_menu.html.erb
│ │ │ ├── _project_form.html.erb
│ │ │ ├── _project_tabs_view.html.erb
│ │ │ ├── _role_navigation.html.erb
│ │ │ ├── _stage_form.html.erb
│ │ │ └── _stage_show.html.erb
│ ├── config
│ │ ├── initializers
│ │ │ └── kubeclient.rb
│ │ └── routes.rb
│ ├── db
│ │ ├── migrate
│ │ │ ├── 20150725010056_create_kubernetes_releases.rb
│ │ │ ├── 20150819235959_create_kubernetes_roles.rb
│ │ │ ├── 20150824234709_create_kubernetes_release_docs.rb
│ │ │ ├── 20150827181056_create_kubernetes_cluster.rb
│ │ │ ├── 20150902221719_create_kubernetes_release_groups.rb
│ │ │ ├── 20150902221720_kubernetes_release_as_child_to_group.rb
│ │ │ ├── 20151013181500_create_kubernetes_cluster_deploy_groups.rb
│ │ │ ├── 20151014202234_add_live_replicas_to_kuber_release_doc.rb
│ │ │ ├── 20151014205641_set_kuber_release_default_status.rb
│ │ │ ├── 20151109142022_remove_release_groups.rb
│ │ │ ├── 20151116174240_add_soft_delete_to_kubernetes_role.rb
│ │ │ ├── 20160426223230_add_kuberetes_to_stage.rb
│ │ │ ├── 20160429224533_normalize_project_id.rb
│ │ │ ├── 20160503162523_really_add_kubernetes_to_staging.rb
│ │ │ ├── 20160503233847_create_kubernetes_deploy_group_roles.rb
│ │ │ ├── 20160504225531_add_cpu_and_ram_to_release_docs.rb
│ │ │ ├── 20160509225637_make_kubernetes_services_unique.rb
│ │ │ ├── 20160510153731_change_role_name_to_id.rb
│ │ │ ├── 20160512204809_add_deploy_to_kubernetes_release.rb
│ │ │ ├── 20160523234717_remove_role_columns.rb
│ │ │ ├── 20160617223512_add_git_sha_to_kubernetes_release.rb
│ │ │ ├── 20160621174658_drop_release_statuses.rb
│ │ │ ├── 20160627191312_nilify_service_names.rb
│ │ │ ├── 20160627212913_remove_deploy_strategy.rb
│ │ │ ├── 20160629185512_add_resource_name_to_kubernetes_roles.rb
│ │ │ ├── 20160629232753_add_generated_template_to_release_docs.rb
│ │ │ ├── 20160715165508_add_kubernetes_build_column.rb
│ │ │ ├── 20161007231901_add_ip_prefix_to_kubernetes_cluster.rb
│ │ │ ├── 20161111005027_remove_deleted_deploy_groups.rb
│ │ │ ├── 20161115181738_delete_kubernetes_commands.rb
│ │ │ ├── 20170102212707_add_flat_to_allow_build_reuse.rb
│ │ │ ├── 20170509220749_add_requests_to_kubenretes.rb
│ │ │ ├── 20170526151018_add_usage_limits.rb
│ │ │ ├── 20171026135700_extract_plugin_migrations.rb
│ │ │ ├── 20171101121933_remove_kubernetes_job.rb
│ │ │ ├── 20171215200538_add_comments_to_limits.rb
│ │ │ ├── 20171226184349_add_autoscaled_to_kubernetes_deploy_group_roles.rb
│ │ │ ├── 20180112113400_add_blue_green.rb
│ │ │ ├── 20180125203849_add_delete_resource_to_deploy_group_roles.rb
│ │ │ ├── 20180202000103_add_uniqueness_constraint_on_dgr.rb
│ │ │ ├── 20180222155246_increase_max_kubenretes_limit.rb
│ │ │ ├── 20180626154722_add_no_limit_to_deploy_group_roles.rb
│ │ │ ├── 20190109161216_add_kubernetes_stage_roles.rb
│ │ │ ├── 20190124171921_bump_limit.rb
│ │ │ ├── 20190403202316_add_cluster_config.rb
│ │ │ ├── 20190508231523_add_rollout_timeout_to_projects.rb
│ │ │ ├── 20190510213218_add_kubernetes_namespaces.rb
│ │ │ ├── 20190514231932_allow_nil_kubernetes_roles_resource_name.rb
│ │ │ ├── 20190528173915_add_kritis_breakglass.rb
│ │ │ ├── 20190714235744_add_sample_logs_to_stages.rb
│ │ │ ├── 20190822232319_add_kubernetes_hide_logs_flag.rb
│ │ │ ├── 20190919212707_add_kubernetes_ignore_vulnerabilities_to_deploys.rb
│ │ │ ├── 20191022023140_add_istio_inject_column.rb
│ │ │ ├── 20191030151254_add_template_to_kubernetes_namespaces.rb
│ │ │ ├── 20191101213212_kubernetes_stop_duplicating_resources.rb
│ │ │ └── 20200827172257_remove_kubernetes_ip_prefix.rb
│ │ └── seeds.rb
│ ├── decorators
│ │ ├── deploy_decorator.rb
│ │ ├── deploy_group_decorator.rb
│ │ ├── deploy_groups_controller_decorator.rb
│ │ ├── project_decorator.rb
│ │ └── stage_decorator.rb
│ ├── lib
│ │ └── samson_kubernetes
│ │ │ └── samson_plugin.rb
│ ├── samson_kubernetes.gemspec
│ └── test
│ │ ├── cluster_config.yml
│ │ ├── controllers
│ │ └── kubernetes
│ │ │ ├── clusters_controller_test.rb
│ │ │ ├── deploy_group_roles_controller_test.rb
│ │ │ ├── namespaces_controller_test.rb
│ │ │ ├── role_verifications_controller_test.rb
│ │ │ ├── roles_controller_test.rb
│ │ │ ├── stages_controller_test.rb
│ │ │ └── usage_limits_controller_test.rb
│ │ ├── decorators
│ │ ├── deploy_decorator_test.rb
│ │ ├── deploy_group_decorator_test.rb
│ │ ├── deploy_groups_controller_decorator_test.rb
│ │ ├── project_decorator_test.rb
│ │ └── stage_decorator_test.rb
│ │ ├── fixtures
│ │ └── kubernetes
│ │ │ ├── cluster_deploy_groups.yml
│ │ │ ├── clusters.yml
│ │ │ ├── deploy_group_roles.yml
│ │ │ ├── namespaces.yml
│ │ │ ├── release_docs.yml
│ │ │ ├── releases.yml
│ │ │ └── roles.yml
│ │ ├── helpers
│ │ └── deploy_group_roles_helper_test.rb
│ │ ├── models
│ │ └── kubernetes
│ │ │ ├── api
│ │ │ └── pod_test.rb
│ │ │ ├── cluster_deploy_group_test.rb
│ │ │ ├── cluster_test.rb
│ │ │ ├── deploy_executor_test.rb
│ │ │ ├── deploy_group_role_test.rb
│ │ │ ├── namespace_test.rb
│ │ │ ├── release_doc_test.rb
│ │ │ ├── release_test.rb
│ │ │ ├── resource_status_test.rb
│ │ │ ├── resource_test.rb
│ │ │ ├── role_config_file_test.rb
│ │ │ ├── role_test.rb
│ │ │ ├── role_validator_test.rb
│ │ │ ├── stage_role_test.rb
│ │ │ ├── template_filler_test.rb
│ │ │ ├── usage_limit_test.rb
│ │ │ └── util_test.rb
│ │ ├── samples
│ │ ├── kubernetes_cron_job.yml
│ │ ├── kubernetes_deployment.yml
│ │ ├── kubernetes_invalid_role_config_file.yml
│ │ ├── kubernetes_job.yml
│ │ ├── kubernetes_podtemplate.yml
│ │ └── kubernetes_rbac.yml
│ │ ├── samson_kubernetes
│ │ └── samson_plugin_test.rb
│ │ └── test_helper.rb
├── ledger
│ ├── README.md
│ ├── lib
│ │ └── samson_ledger
│ │ │ ├── client.rb
│ │ │ └── samson_plugin.rb
│ ├── samson_ledger.gemspec
│ └── test
│ │ ├── lib
│ │ └── samson_ledger
│ │ │ ├── client_test.rb
│ │ │ └── samson_plugin_test.rb
│ │ └── test_helper.rb
├── new_relic
│ ├── README.md
│ ├── app
│ │ ├── assets
│ │ │ └── javascripts
│ │ │ │ └── new_relic
│ │ │ │ └── application.js
│ │ ├── controllers
│ │ │ └── new_relic_controller.rb
│ │ ├── helpers
│ │ │ └── new_relic_helper.rb
│ │ ├── models
│ │ │ └── new_relic_application.rb
│ │ └── views
│ │ │ └── samson_new_relic
│ │ │ ├── _deploy_changeset_tab_body.html.erb
│ │ │ ├── _deploy_changeset_tab_nav.html.erb
│ │ │ └── _stage_form.html.erb
│ ├── config
│ │ └── routes.rb
│ ├── db
│ │ └── migrate
│ │ │ └── 20140131005054_add_stage_new_relic_applications.rb
│ ├── decorators
│ │ └── stage_decorator.rb
│ ├── lib
│ │ └── samson_new_relic
│ │ │ ├── api.rb
│ │ │ └── samson_plugin.rb
│ ├── samson_new_relic.gemspec
│ └── test
│ │ ├── controllers
│ │ └── new_relic_controller_test.rb
│ │ ├── decorators
│ │ └── stage_decorator_test.rb
│ │ ├── fixtures
│ │ └── new_relic_applications.yml
│ │ ├── helpers
│ │ └── new_relic_helper_test.rb
│ │ ├── models
│ │ └── new_relic_application_test.rb
│ │ ├── samson_new_relic
│ │ ├── api_test.rb
│ │ └── samson_plugin_test.rb
│ │ └── test_helper.rb
├── pipelines
│ ├── README.md
│ ├── app
│ │ └── views
│ │ │ └── samson_pipelines
│ │ │ ├── _deploys_header.html.erb
│ │ │ ├── _stage_form.html.erb
│ │ │ └── _stage_show.html.erb
│ ├── db
│ │ └── migrate
│ │ │ ├── 20150602113621_add_next_stage_to_stages.rb
│ │ │ ├── 20170202231551_covert_next_stage_ids_to_integer.rb
│ │ │ └── 20180510172630_add_pipelined_to_deploys.rb
│ ├── decorators
│ │ ├── deploy_decorator.rb
│ │ └── stage_decorator.rb
│ ├── lib
│ │ └── samson_pipelines
│ │ │ └── samson_plugin.rb
│ ├── samson_pipelines.gemspec
│ └── test
│ │ ├── decorators
│ │ ├── deploy_decorator_test.rb
│ │ └── stage_decorator_test.rb
│ │ ├── samson_pipelines
│ │ └── samson_plugin_test.rb
│ │ └── test_helper.rb
├── prerequisite_stages
│ ├── README.md
│ ├── app
│ │ └── views
│ │ │ └── samson_prerequisite_stages
│ │ │ ├── _stage_form.html.erb
│ │ │ └── _stage_show.html.erb
│ ├── db
│ │ └── migrate
│ │ │ └── 20180723163626_add_prerequisite_stage_ids_to_stages.rb
│ ├── decorators
│ │ └── stage_decorator.rb
│ ├── lib
│ │ └── samson_prerequisite_stages
│ │ │ └── samson_plugin.rb
│ ├── samson_prerequisite_stages.gemspec
│ └── test
│ │ ├── decorators
│ │ └── stage_decorator_test.rb
│ │ ├── samson_prerequisite_stages
│ │ └── samson_plugin_test.rb
│ │ └── test_helper.rb
├── rollbar
│ ├── README.md
│ ├── config
│ │ └── initializers
│ │ │ └── rollbar.rb
│ ├── lib
│ │ └── samson_rollbar
│ │ │ └── samson_plugin.rb
│ ├── samson_rollbar.gemspec
│ └── test
│ │ ├── samson_rollbar
│ │ └── samson_plugin_test.rb
│ │ └── test_helper.rb
├── rollbar_dashboards
│ ├── README.md
│ ├── app
│ │ ├── assets
│ │ │ ├── images
│ │ │ │ └── rollbar_dashboards
│ │ │ │ │ └── icon.png
│ │ │ └── stylesheets
│ │ │ │ └── rollbar_dashboards
│ │ │ │ └── application.css
│ │ ├── controllers
│ │ │ └── rollbar_dashboards
│ │ │ │ └── dashboards_controller.rb
│ │ ├── helpers
│ │ │ └── rollbar_dashboards
│ │ │ │ └── dashboards_helper.rb
│ │ ├── models
│ │ │ └── rollbar_dashboards
│ │ │ │ └── setting.rb
│ │ └── views
│ │ │ ├── rollbar_dashboards
│ │ │ ├── _dashboard.html.erb
│ │ │ └── _item.html.erb
│ │ │ └── samson_rollbar_dashboards
│ │ │ ├── _deploy_show_view.html.erb
│ │ │ ├── _project_dashboard.html.erb
│ │ │ └── _project_form.html.erb
│ ├── config
│ │ └── routes.rb
│ ├── db
│ │ └── migrate
│ │ │ ├── 20180316163323_create_rollbar_dashboards_settings.rb
│ │ │ └── 20180607172824_add_account_and_project_name_to_rollbar_dashboards_settings.rb
│ ├── decorators
│ │ └── project_decorator.rb
│ ├── lib
│ │ ├── rollbar_dashboards
│ │ │ └── client.rb
│ │ └── samson_rollbar_dashboards
│ │ │ └── samson_plugin.rb
│ ├── samson_rollbar_dashboards.gemspec
│ └── test
│ │ ├── controllers
│ │ └── rollbar_dashboards
│ │ │ └── dashboards_controller_test.rb
│ │ ├── decorators
│ │ └── project_decorator_test.rb
│ │ ├── helpers
│ │ └── rollbar_dashboards
│ │ │ └── dashboards_helper_test.rb
│ │ ├── lib
│ │ └── rollbar_dashboards
│ │ │ └── client_test.rb
│ │ ├── models
│ │ └── rollbar_dashboards
│ │ │ └── setting_test.rb
│ │ ├── samson_rollbar_dashboards
│ │ └── samson_plugin_test.rb
│ │ └── test_helper.rb
├── rollbar_hook
│ ├── README.md
│ ├── app
│ │ ├── models
│ │ │ ├── rollbar_notification.rb
│ │ │ └── rollbar_webhook.rb
│ │ └── views
│ │ │ └── samson_rollbar
│ │ │ └── _stage_form.html.erb
│ ├── db
│ │ └── migrate
│ │ │ └── 20170711174532_create_rollbar_webhooks.rb
│ ├── decorators
│ │ └── stage_decorator.rb
│ ├── lib
│ │ └── samson_rollbar_hook
│ │ │ └── samson_plugin.rb
│ ├── samson_rollbar_hook.gemspec
│ └── test
│ │ ├── decorators
│ │ └── stage_decorator_test.rb
│ │ ├── models
│ │ ├── rollbar_notification_test.rb
│ │ └── rollbar_webhook_test.rb
│ │ ├── samson_rollbar_hook
│ │ └── samson_plugin_test.rb
│ │ └── test_helper.rb
├── sentry
│ ├── README.md
│ ├── config
│ │ └── initializers
│ │ │ └── sentry.rb
│ ├── lib
│ │ └── samson_sentry
│ │ │ └── samson_plugin.rb
│ ├── samson_sentry.gemspec
│ └── test
│ │ ├── samson_sentry
│ │ └── samson_plugin_test.rb
│ │ └── test_helper.rb
├── slack_app
│ ├── README.md
│ ├── app
│ │ ├── controllers
│ │ │ └── slack_app_controller.rb
│ │ ├── helpers
│ │ │ └── slack_app_helper.rb
│ │ ├── models
│ │ │ └── samson_slack_app
│ │ │ │ ├── deploy_response_url.rb
│ │ │ │ ├── slack_identifier.rb
│ │ │ │ └── slack_message.rb
│ │ └── views
│ │ │ └── slack_app
│ │ │ └── oauth.html.erb
│ ├── config
│ │ └── routes.rb
│ ├── db
│ │ └── migrate
│ │ │ ├── 20160709001231_create_slack_app_table.rb
│ │ │ ├── 20160711222417_create_deploy_response_url_table.rb
│ │ │ └── 20160717144254_add_samson_app_indices.rb
│ ├── lib
│ │ └── samson_slack_app
│ │ │ └── samson_plugin.rb
│ ├── samson_slack_app.gemspec
│ └── test
│ │ ├── controllers
│ │ └── slack_app_controller_test.rb
│ │ ├── fixtures
│ │ └── samson_slack_app
│ │ │ └── slack_identifiers.yml
│ │ ├── helpers
│ │ └── slack_app_helper_test.rb
│ │ ├── models
│ │ └── samson_slack_app
│ │ │ ├── deploy_response_url_test.rb
│ │ │ ├── slack_identifier_test.rb
│ │ │ └── slack_message_test.rb
│ │ ├── samson_slack_app
│ │ └── samson_plugin_test.rb
│ │ └── test_helper.rb
├── slack_webhooks
│ ├── README.md
│ ├── app
│ │ ├── controllers
│ │ │ └── slack_webhooks_controller.rb
│ │ ├── models
│ │ │ ├── slack_webhook.rb
│ │ │ └── slack_webhook_notification.rb
│ │ └── views
│ │ │ └── samson_slack_webhooks
│ │ │ ├── _deploy_view.html.erb
│ │ │ ├── _stage_form.html.erb
│ │ │ └── notification.text.erb
│ ├── config
│ │ └── routes.rb
│ ├── db
│ │ └── migrate
│ │ │ ├── 20151123184501_create_slack_webhooks.rb
│ │ │ ├── 20160624025817_add_checkboxes_to_slack_webhooks.rb
│ │ │ ├── 20161013175858_add_only_on_failure_to_slack_webhooks.rb
│ │ │ ├── 20170310020151_make_checkboxes_off_by_default.rb
│ │ │ ├── 20170418183047_reorganize_slack_buddy.rb
│ │ │ ├── 20170424155204_cleanup_slack_channels.rb
│ │ │ └── 20180920200759_rework_webhook_deploy_notification_options.rb
│ ├── decorators
│ │ └── stage_decorator.rb
│ ├── lib
│ │ └── samson_slack_webhooks
│ │ │ ├── samson_plugin.rb
│ │ │ └── slack_webhooks_service.rb
│ ├── samson_slack_webhooks.gemspec
│ └── test
│ │ ├── controllers
│ │ └── slack_webhooks_controller_test.rb
│ │ ├── decorators
│ │ └── stage_decorator_test.rb
│ │ ├── models
│ │ ├── slack_webhook_notification_test.rb
│ │ └── slack_webhook_test.rb
│ │ ├── samson_slack_webhooks
│ │ ├── samson_plugin_test.rb
│ │ └── slack_webhooks_service_test.rb
│ │ └── test_helper.rb
└── zendesk
│ ├── README.md
│ ├── app
│ ├── models
│ │ ├── zendesk_notification.rb
│ │ └── zendesk_notification_renderer.rb
│ └── views
│ │ └── samson_zendesk
│ │ ├── _stage_form.html.erb
│ │ └── notification.erb
│ ├── db
│ └── migrate
│ │ ├── 20140410213058_add_zendesk_confirmation_to_stages.rb
│ │ └── 20160901175937_prevent_3_state_booleans2.rb
│ ├── lib
│ └── samson_zendesk
│ │ └── samson_plugin.rb
│ ├── samson_zendesk.gemspec
│ └── test
│ ├── models
│ ├── zendesk_notification_renderer_test.rb
│ └── zendesk_notification_test.rb
│ ├── samson_zendesk
│ └── samson_plugin_test.rb
│ └── test_helper.rb
├── public
├── 404.html
├── 422.html
├── 500.html
├── favicon.ico
└── robots.txt
├── script
├── create_many_projects_stages_deploys.rb
├── create_ssh_environment.example.sh
└── docker_dev_server
├── test
├── channels
│ ├── application_cable
│ │ └── connection_test.rb
│ ├── deploy_notifications_channel_test.rb
│ └── job_outputs_channel_test.rb
├── controllers
│ ├── access_requests_controller_test.rb
│ ├── access_tokens_controller_test.rb
│ ├── application_controller_test.rb
│ ├── audits_controller_test.rb
│ ├── automated_deploys_controller_test.rb
│ ├── build_commands_controller_test.rb
│ ├── builds_controller_test.rb
│ ├── changelogs_controller_test.rb
│ ├── commands_controller_test.rb
│ ├── commit_statuses_controller_test.rb
│ ├── concerns
│ │ ├── current_project_test.rb
│ │ ├── current_stage_test.rb
│ │ ├── current_user_test.rb
│ │ ├── json_exceptions_test.rb
│ │ ├── json_pagination_test.rb
│ │ ├── json_renderer_test.rb
│ │ └── wrap_in_with_deleted_test.rb
│ ├── csv_exports_controller_test.rb
│ ├── dashboards_controller_test.rb
│ ├── deploy_groups_controller_test.rb
│ ├── deploys_controller_test.rb
│ ├── doorkeeper_base_controller_test.rb
│ ├── environments_controller_test.rb
│ ├── integrations
│ │ ├── base_controller_test.rb
│ │ ├── buildkite_controller_test.rb
│ │ ├── circleci_controller_test.rb
│ │ ├── generic_controller_test.rb
│ │ ├── github_controller_test.rb
│ │ ├── jenkins_controller_test.rb
│ │ ├── semaphore_controller_test.rb
│ │ ├── tddium_controller_test.rb
│ │ └── travis_controller_test.rb
│ ├── jobs_controller_test.rb
│ ├── locks_controller_test.rb
│ ├── mass_rollouts_controller_test.rb
│ ├── oauth_test_controller_test.rb
│ ├── outbound_webhooks_controller_test.rb
│ ├── ping_controller_test.rb
│ ├── profiles_controller_test.rb
│ ├── projects_controller_test.rb
│ ├── references_controller_test.rb
│ ├── releases_controller_test.rb
│ ├── resource_controller_test.rb
│ ├── secret_sharing_grants_controller_test.rb
│ ├── secrets_controller_test.rb
│ ├── sessions_controller_test.rb
│ ├── stages_controller_test.rb
│ ├── stars_controller_test.rb
│ ├── unauthorized_controller_test.rb
│ ├── user_merges_controller_test.rb
│ ├── user_project_roles_controller_test.rb
│ ├── users_controller_test.rb
│ ├── vault_servers_controller_test.rb
│ └── webhooks_controller_test.rb
├── fixtures
│ ├── builds.yml
│ ├── commands.yml
│ ├── csv_exports.yml
│ ├── deploy_groups.yml
│ ├── deploys.yml
│ ├── environments.yml
│ ├── jobs.yml
│ ├── projects.yml
│ ├── releases.yml
│ ├── self-signed-test-cert.pem
│ ├── stage_commands.yml
│ ├── stages.yml
│ ├── user_project_roles.yml
│ └── users.yml
├── helpers
│ ├── access_request_helper_test.rb
│ ├── application_helper_test.rb
│ ├── audits_helper_test.rb
│ ├── builds_helper_test.rb
│ ├── dashboards_helper_test.rb
│ ├── date_time_helper_test.rb
│ ├── deploys_helper_test.rb
│ ├── jobs_helper_test.rb
│ ├── locks_helper_test.rb
│ ├── projects_helper_test.rb
│ ├── releases_helper_test.rb
│ ├── secrets_helper_test.rb
│ ├── sessions_helper_test.rb
│ ├── stages_helper_test.rb
│ ├── status_helper_test.rb
│ ├── user_project_roles_helper_test.rb
│ └── webhooks_helper_test.rb
├── integration
│ ├── authentication_test.rb
│ ├── cleanliness_test.rb
│ ├── database_schema_test.rb
│ └── tasks_test.rb
├── jobs
│ └── csv_export_job_test.rb
├── lib
│ ├── generators
│ │ └── plugin
│ │ │ └── plugin_generator_test.rb
│ ├── omniauth
│ │ └── github_authorization_test.rb
│ ├── samson
│ │ ├── boot_check_test.rb
│ │ ├── buddy_check_test.rb
│ │ ├── build_finder_test.rb
│ │ ├── bump_touch_test.rb
│ │ ├── command_executor_test.rb
│ │ ├── console_extensions_test.rb
│ │ ├── diff_test.rb
│ │ ├── dynamic_ttl_cache_test.rb
│ │ ├── env_check_test.rb
│ │ ├── error_notifier_test.rb
│ │ ├── extra_dig_test.rb
│ │ ├── form_builder_test.rb
│ │ ├── hooks_test.rb
│ │ ├── integration_test.rb
│ │ ├── mapped_database_exceptions_test.rb
│ │ ├── natural_order_test.rb
│ │ ├── output_utils_test.rb
│ │ ├── parallelizer_test.rb
│ │ ├── performance_tracer_test.rb
│ │ ├── periodical_deploy_test.rb
│ │ ├── periodical_test.rb
│ │ ├── process_utils_test.rb
│ │ ├── readonly_db_test.rb
│ │ ├── redeploy_params_test.rb
│ │ ├── repo_provider_status_test.rb
│ │ ├── retry_test.rb
│ │ ├── secrets
│ │ │ ├── db_backend_test.rb
│ │ │ ├── hashicorp_vault_backend_test.rb
│ │ │ ├── key_resolver_test.rb
│ │ │ ├── manager_test.rb
│ │ │ ├── shared
│ │ │ │ └── list_recursive_test.rb
│ │ │ ├── vault_client_manager_test.rb
│ │ │ ├── vault_client_wrapper_test.rb
│ │ │ ├── vault_kv_wrapper_test.rb
│ │ │ ├── vault_logical_wrapper_test.rb
│ │ │ └── vault_server_test.rb
│ │ ├── secrets_test.rb
│ │ ├── syslog_formatter_test.rb
│ │ └── time_sum_test.rb
│ └── warden
│ │ └── strategies
│ │ └── doorkeeper_test.rb
├── mailers
│ ├── access_request_mailer_test.rb
│ ├── application_mailer_test.rb
│ ├── csv_mailer_test.rb
│ ├── deploy_mailer_test.rb
│ ├── previews
│ │ └── access_request_mailer_preview.rb
│ └── project_mailer_test.rb
├── models
│ ├── access_control_test.rb
│ ├── access_request_test.rb
│ ├── build_test.rb
│ ├── changeset
│ │ ├── code_push_test.rb
│ │ ├── commit_test.rb
│ │ ├── github_user_test.rb
│ │ ├── issue_comment_test.rb
│ │ ├── jira_issue_test.rb
│ │ └── pull_request_test.rb
│ ├── changeset_test.rb
│ ├── command_test.rb
│ ├── commit_status_test.rb
│ ├── concerns
│ │ ├── attr_encrypted_support_test.rb
│ │ ├── audit_on_association_test.rb
│ │ ├── group_scope_test.rb
│ │ ├── has_role_test.rb
│ │ ├── inlinable_test.rb
│ │ ├── lockable_test.rb
│ │ ├── permalinkable_test.rb
│ │ ├── searchable_test.rb
│ │ └── soft_delete_with_destroy_test.rb
│ ├── csv_export_test.rb
│ ├── deploy_build_test.rb
│ ├── deploy_group_test.rb
│ ├── deploy_groups_stage_test.rb
│ ├── deploy_metrics_test.rb
│ ├── deploy_service_test.rb
│ ├── deploy_test.rb
│ ├── docker_builder_service_test.rb
│ ├── docker_registry_test.rb
│ ├── environment_test.rb
│ ├── event_streamer_test.rb
│ ├── git_repository_test.rb
│ ├── image_builder_test.rb
│ ├── job_execution_test.rb
│ ├── job_queue_test.rb
│ ├── job_test.rb
│ ├── job_viewers_test.rb
│ ├── lock_test.rb
│ ├── multi_lock_test.rb
│ ├── null_user_test.rb
│ ├── outbound_webhook_stage_test.rb
│ ├── outbound_webhook_test.rb
│ ├── output_buffer_test.rb
│ ├── project_test.rb
│ ├── release_service_test.rb
│ ├── release_test.rb
│ ├── restart_signal_handler_test.rb
│ ├── role_test.rb
│ ├── secret_sharing_grant_test.rb
│ ├── stage_command_test.rb
│ ├── stage_test.rb
│ ├── star_test.rb
│ ├── terminal_executor_test.rb
│ ├── terminal_output_scanner_test.rb
│ ├── user_project_role_test.rb
│ ├── user_test.rb
│ ├── webhook_recorder_test.rb
│ └── webhook_test.rb
├── presenters
│ ├── deploy_group_usage_csv_presenter_test.rb
│ └── user_csv_presenter_test.rb
├── support
│ ├── access_request_test_support.rb
│ ├── default_stubs.rb
│ ├── git_repo_test_support.rb
│ ├── integration_controller_test_helper.rb
│ ├── job_queue_support.rb
│ ├── multi_thread_db_detector.rb
│ ├── must_equal_nil.rb
│ ├── query_counter.rb
│ ├── vault_request_helper.rb
│ └── webmock.rb
└── test_helper.rb
└── vendor
└── assets
├── javascripts
├── jquery-mentions-input
│ ├── jquery.elastic.source.js
│ └── jquery.mentionsInput.js
└── tableHeaderFixer.js
└── stylesheets
└── jquery-mentions-input
└── jquery.mentionsInput.css
/.bundler-audit.yml:
--------------------------------------------------------------------------------
1 | # ignores for `rake bundle_audit`
2 | # - 1 ignore per line
3 | # - leave a comment why we can safely ignore it and where to find more details
4 | # - leave file with `ignore: []` if ignore list is empty
5 | ignore:
6 | - CVE-2024-6484 # ignore until a patch is available https://github.com/advisories/GHSA-9mvj-f7w8-pvh2
7 |
--------------------------------------------------------------------------------
/.env.virtualbox:
--------------------------------------------------------------------------------
1 | # test application samson-compose from some-public-token user (192.168.42.45:9080)
2 | # in case you are running on virtualbox based docker
3 | DEFAULT_URL="http://192.168.42.45:9080"
4 | bin/decode_dot_env-R0lUSFVCX0NMSUVOVF9JRD1iMmUxMmRlMGNiN2QzMDFkNjE1OA==
5 | bin/decode_dot_env-R0lUSFVCX1NFQ1JFVD00MzQ2NDcyZjNkMTY4ZmI3MmNhNTQwYTA0ZDJkMjc3YzBjYjhmMjQ3
6 |
--------------------------------------------------------------------------------
/.github/CODEOWNERS:
--------------------------------------------------------------------------------
1 | * @zendesk/samson @grosser
2 | plugins/kubernetes @zendesk/compute
3 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | **Note**: Samson is a public repo, do not include Zendesk-internal information, urls, etc.
2 |
3 | * Add description
4 | * Add screenshots when changing the UI
5 | * Add unit tests
6 |
7 | ### References
8 | - Jira link:
9 |
10 | ### Risks
11 | - Low/Med/High: thing that could happen
12 |
--------------------------------------------------------------------------------
/.irbrc.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | # loaded by marco-polo, cannot be in console.rb
3 | if Rails.env.production?
4 | puts "Running in readonly mode. Use Samson::ReadonlyDb.disable to switch to writable."
5 | Samson::ReadonlyDb.enable
6 | end
7 |
--------------------------------------------------------------------------------
/.node-version:
--------------------------------------------------------------------------------
1 | 18.20.5
2 |
--------------------------------------------------------------------------------
/.ruby-version:
--------------------------------------------------------------------------------
1 | 3.3.8
2 |
--------------------------------------------------------------------------------
/Procfile:
--------------------------------------------------------------------------------
1 | # TODO: using 'bundle exec rails c' fails to boot a server on heroku because of a LOAD_PATH issue
2 | web: bundle exec puma -C config/puma.rb
3 |
--------------------------------------------------------------------------------
/app/assets/images/ajax-loader.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/samson/db8bad2b146c24de29c73dfddc48bec1c527549a/app/assets/images/ajax-loader.gif
--------------------------------------------------------------------------------
/app/assets/images/bitbucket.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/samson/db8bad2b146c24de29c73dfddc48bec1c527549a/app/assets/images/bitbucket.png
--------------------------------------------------------------------------------
/app/assets/images/favicons/32x32_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/samson/db8bad2b146c24de29c73dfddc48bec1c527549a/app/assets/images/favicons/32x32_dark.png
--------------------------------------------------------------------------------
/app/assets/images/favicons/32x32_green.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/samson/db8bad2b146c24de29c73dfddc48bec1c527549a/app/assets/images/favicons/32x32_green.png
--------------------------------------------------------------------------------
/app/assets/images/favicons/32x32_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/samson/db8bad2b146c24de29c73dfddc48bec1c527549a/app/assets/images/favicons/32x32_light.png
--------------------------------------------------------------------------------
/app/assets/images/favicons/32x32_red.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/samson/db8bad2b146c24de29c73dfddc48bec1c527549a/app/assets/images/favicons/32x32_red.png
--------------------------------------------------------------------------------
/app/assets/images/favicons/32x32_yellow.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/samson/db8bad2b146c24de29c73dfddc48bec1c527549a/app/assets/images/favicons/32x32_yellow.png
--------------------------------------------------------------------------------
/app/assets/images/favicons/64x64_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/samson/db8bad2b146c24de29c73dfddc48bec1c527549a/app/assets/images/favicons/64x64_dark.png
--------------------------------------------------------------------------------
/app/assets/images/favicons/64x64_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/samson/db8bad2b146c24de29c73dfddc48bec1c527549a/app/assets/images/favicons/64x64_light.png
--------------------------------------------------------------------------------
/app/assets/images/github.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/samson/db8bad2b146c24de29c73dfddc48bec1c527549a/app/assets/images/github.png
--------------------------------------------------------------------------------
/app/assets/images/gitlab.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/samson/db8bad2b146c24de29c73dfddc48bec1c527549a/app/assets/images/gitlab.png
--------------------------------------------------------------------------------
/app/assets/images/google.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/samson/db8bad2b146c24de29c73dfddc48bec1c527549a/app/assets/images/google.png
--------------------------------------------------------------------------------
/app/assets/images/grabber.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/samson/db8bad2b146c24de29c73dfddc48bec1c527549a/app/assets/images/grabber.png
--------------------------------------------------------------------------------
/app/assets/images/ldap.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/samson/db8bad2b146c24de29c73dfddc48bec1c527549a/app/assets/images/ldap.png
--------------------------------------------------------------------------------
/app/assets/images/logo_dark.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/samson/db8bad2b146c24de29c73dfddc48bec1c527549a/app/assets/images/logo_dark.png
--------------------------------------------------------------------------------
/app/assets/images/logo_dark.transparent.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/samson/db8bad2b146c24de29c73dfddc48bec1c527549a/app/assets/images/logo_dark.transparent.png
--------------------------------------------------------------------------------
/app/assets/images/logo_light.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/samson/db8bad2b146c24de29c73dfddc48bec1c527549a/app/assets/images/logo_light.png
--------------------------------------------------------------------------------
/app/assets/images/zendesk.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/samson/db8bad2b146c24de29c73dfddc48bec1c527549a/app/assets/images/zendesk.png
--------------------------------------------------------------------------------
/app/assets/javascripts/changelog.js:
--------------------------------------------------------------------------------
1 | $(function () {
2 | $("#start-date").datepicker({ dateFormat: "yy-mm-dd"});
3 | $("#end-date").datepicker({ dateFormat: "yy-mm-dd"});
4 |
5 | $("input").change(function() {
6 | $("#status-message").removeClass("hidden").text("Regenerating...");
7 | $("#date-chooser" ).submit();
8 | });
9 | });
10 |
--------------------------------------------------------------------------------
/app/assets/javascripts/changesets.js:
--------------------------------------------------------------------------------
1 | $(function () {
2 | $("body").on("click", ".changeset-files .file-summary", function (e) {
3 | var row = $(this);
4 | var patch = row.next();
5 |
6 | patch.toggle();
7 | });
8 | });
9 |
--------------------------------------------------------------------------------
/app/assets/javascripts/dashboards.js:
--------------------------------------------------------------------------------
1 | //= require tableHeaderFixer
2 |
3 | $(document).ready(function () {
4 | $('.fixed-header-column').tableHeadFixer({'left' : 1});
5 | });
6 |
--------------------------------------------------------------------------------
/app/assets/javascripts/expanded_textarea.js:
--------------------------------------------------------------------------------
1 | // make textareas expand to their contents size
2 | // adjusting the math (+3) to make 1-line have regular size
3 | $(function(){
4 | $('textarea:visible').each(function(i, element){
5 | element.style.height = element.scrollHeight + 3 +"px";
6 | });
7 | });
8 |
--------------------------------------------------------------------------------
/app/assets/javascripts/focus_on.js:
--------------------------------------------------------------------------------
1 | // make a link trigger focus
2 | // Something
3 | //
4 | $(document).on('click', '.focus-on', function(){
5 | $($(this).data('focus')).focus();
6 | });
7 |
--------------------------------------------------------------------------------
/app/assets/javascripts/instant_errors.js.erb:
--------------------------------------------------------------------------------
1 | // <% if Rails.env.development? %>
2 | // show errors instantly so we can catch them early and fix
3 | window.onerror = function(msg, url, line, col, error) {
4 | var extra = !col ? '' : '\ncolumn: ' + col;
5 | extra += !error ? '' : '\nerror: ' + error;
6 | alert("Error: " + msg + "\nurl: " + url + "\nline: " + line + extra);
7 | };
8 | // <% end %>
9 |
--------------------------------------------------------------------------------
/app/assets/javascripts/poll_for_changes.js:
--------------------------------------------------------------------------------
1 | $.fn.pollForChange = function (interval, callback) {
2 | var self = this;
3 | var lastValue = "";
4 |
5 | setInterval(function () {
6 | var newValue = $(self).val();
7 | if (newValue !== lastValue) {
8 | lastValue = newValue;
9 | callback.call(self);
10 | }
11 | },
12 | interval
13 | );
14 | };
15 |
--------------------------------------------------------------------------------
/app/assets/javascripts/popover.js:
--------------------------------------------------------------------------------
1 | $(function () {
2 | $('[data-toggle="popover"]').popover();
3 | });
4 |
--------------------------------------------------------------------------------
/app/assets/javascripts/profile.js:
--------------------------------------------------------------------------------
1 | // ask for permission to use desktop notifications when user enabled desktop notification in profile
2 | $(document).on("change", "#user_desktop_notify", function(){
3 | if ($(this).is(":checked")) {
4 | Notification.requestPermission();
5 | }
6 | });
7 |
--------------------------------------------------------------------------------
/app/assets/javascripts/projects.js:
--------------------------------------------------------------------------------
1 | $(function() {
2 | // switch icons when user stars or unstars a project.
3 | // keep in sync with app/helpers/projects_helper.rb
4 | $('.star.project-star').bind('ajax:success', function() {
5 | $(this).toggleClass('starred');
6 | });
7 |
8 | $('#project_deploy_with_docker').change(function(){
9 | $('#docker_release_push').toggle($(this).prop('checked'));
10 | }).triggerHandler('change');
11 | });
12 |
--------------------------------------------------------------------------------
/app/assets/javascripts/sessions.js:
--------------------------------------------------------------------------------
1 | // Place all the behaviors and hooks related to the matching controller here.
2 | // All this logic will automatically be available in application.js.
3 |
--------------------------------------------------------------------------------
/app/assets/javascripts/shared.js:
--------------------------------------------------------------------------------
1 | $(function () {
2 | $('a.toggle').click(function(e) {
3 | e.preventDefault();
4 | var target = $(this).data('target');
5 | $(target).toggle();
6 | });
7 | });
8 |
--------------------------------------------------------------------------------
/app/assets/javascripts/time_format.js:
--------------------------------------------------------------------------------
1 | function timeAgoFormat() {
2 | $("span[data-time]").each(function() {
3 | var utcms = this.dataset.time,
4 | localDate = new Date(parseInt(utcms, 10));
5 |
6 | this.title = localDate.toString();
7 | this.innerHTML = moment(localDate).fromNow();
8 | });
9 | }
10 |
11 | $(document).ready(function() {
12 | timeAgoFormat();
13 | setInterval(timeAgoFormat, 60000); // update times every 60s
14 | });
15 |
--------------------------------------------------------------------------------
/app/assets/javascripts/tz_cookie.js:
--------------------------------------------------------------------------------
1 | // setting a cookie with the user's timezone in it to use on the rails side of things
2 | var tz = jstz.determine();
3 | $.cookie("timezone", tz.name(), {path: "/"});
4 |
5 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/admin.scss:
--------------------------------------------------------------------------------
1 | // make records after pagination appear on the same line, visible with multi-pages
2 | .pagination {
3 | line-height: 35px;
4 | display: inline;
5 | }
6 |
7 | .force-form-inline {
8 | display: inline-block;
9 | }
10 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/admin/commands.scss:
--------------------------------------------------------------------------------
1 | .pre-scrollable {
2 | max-height: 150px;
3 | }
4 |
5 | .pre-command {
6 | background-color: #222222;
7 | border-color: #090909;
8 | color: white;
9 | }
10 |
11 | .commands.index {
12 | .table {
13 | table-layout: fixed;
14 |
15 | tr:first-of-type, th:first-of-type {
16 | width: 50%;
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/dashboards.scss:
--------------------------------------------------------------------------------
1 | .dashboard-cell {
2 | max-width: 7rem;
3 | overflow: hidden;
4 | text-overflow: ellipsis;
5 | white-space: nowrap;
6 | }
7 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/jobs.scss:
--------------------------------------------------------------------------------
1 | .jobs.index .pre-command {
2 | max-width: 700px;
3 | }
4 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/locks.scss:
--------------------------------------------------------------------------------
1 | .datetimepicker-container {
2 | position: relative;
3 | }
4 |
5 | .lock-dropdown-menu {
6 | margin-top: 1em;
7 | }
8 |
9 | .lock-times {
10 | margin: .5em;
11 | }
12 |
13 | .lock-input {
14 | border-radius: 4px;
15 | border: 1px solid #ccc;
16 | height: 34px;
17 | padding: 6px;
18 | vertical-align: bottom;
19 | width: 405px;
20 | margin: .5em;
21 | }
22 |
23 | .lock-submit {
24 | display: block;
25 | }
26 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/sessions.scss:
--------------------------------------------------------------------------------
1 | .login-brand {
2 | margin-bottom: 5px;
3 | }
4 |
--------------------------------------------------------------------------------
/app/assets/stylesheets/webhooks.scss:
--------------------------------------------------------------------------------
1 | // Gets super bloated wih a long param or tokens
2 | // and pre auto-expands without limits ... cannot use % widths
3 | #latest_response pre {
4 | max-width: $container-lg - 170px; // body size minus some room for labels
5 | }
6 |
7 | li.disabled {
8 | color: gray;
9 | }
10 |
--------------------------------------------------------------------------------
/app/channels/application_cable/connection.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | # automagically loaded by rails and used by all channels
3 | module ApplicationCable
4 | class Connection < ActionCable::Connection::Base
5 | identified_by :current_user
6 |
7 | def connect
8 | self.current_user = env['warden'].user || reject_unauthorized_connection
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/controllers/integrations/jenkins_controller.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class Integrations::JenkinsController < Integrations::BaseController
3 | protected
4 |
5 | def deploy?
6 | params[:build][:status] == 'SUCCESS'
7 | end
8 |
9 | def commit
10 | params[:build][:scm][:commit]
11 | end
12 |
13 | def branch
14 | params[:build][:scm][:branch]
15 | end
16 |
17 | def message
18 | ''
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/app/controllers/integrations/semaphore_controller.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class Integrations::SemaphoreController < Integrations::BaseController
3 | protected
4 |
5 | def deploy?
6 | params[:result] == 'passed'
7 | end
8 |
9 | def commit
10 | params[:commit][:id]
11 | end
12 |
13 | def branch
14 | params[:branch_name]
15 | end
16 |
17 | def message
18 | params[:commit][:message]
19 | end
20 | end
21 |
--------------------------------------------------------------------------------
/app/controllers/ping_controller.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class PingController < ApplicationController
3 | skip_before_action :login_user
4 |
5 | def show
6 | head :ok
7 | end
8 |
9 | def error
10 | raise('ping#error')
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/app/controllers/stars_controller.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class StarsController < ApplicationController
3 | include CurrentProject
4 |
5 | # toggles star by creating/destroying it
6 | def create
7 | if star = current_user.stars.find_by_project_id(current_project.id)
8 | star&.destroy
9 | else
10 | current_user.stars.create!(project: current_project)
11 | end
12 |
13 | head :ok
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/app/helpers/jobs_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | module JobsHelper
3 | def job_page_title
4 | "#{@project.name} deploy (#{@job.status})"
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/app/helpers/sessions_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | module SessionsHelper
3 | def omniauth_path(type)
4 | origin = params[:redirect_to] || "/" # set by unauthorized_controller.rb
5 | raise ArgumentError, "Hackers from #{origin} ?" unless origin.start_with?("/")
6 | "/auth/#{type}?origin=#{CGI.escape(origin)}"
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/app/mailers/application_mailer.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class ApplicationMailer < ActionMailer::Base
3 | default from: "deploys@#{Rails.application.config.samson.email.sender_domain}"
4 | end
5 |
--------------------------------------------------------------------------------
/app/models/access_request.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AccessRequest
4 | include ActiveModel::Model
5 |
6 | attr_accessor(
7 | :manager_email,
8 | :reason,
9 | :project_ids,
10 | :role_id
11 | )
12 |
13 | validates :manager_email, presence: true
14 | validates :reason, presence: true
15 | validates :project_ids, presence: true
16 | validates :role_id, presence: true
17 | end
18 |
--------------------------------------------------------------------------------
/app/models/changeset/jira_issue.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class Changeset::JiraIssue
3 | attr_reader :url
4 |
5 | def initialize(url)
6 | @url = url
7 | end
8 |
9 | def reference
10 | @url.split("/").last
11 | end
12 |
13 | def ==(other)
14 | url == other.url
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/app/models/concerns/has_role.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | module HasRole
3 | def role
4 | Role.find(role_id)
5 | end
6 |
7 | Role.all.each do |role| # rubocop:disable Lint/RedundantCopDisableDirective Rails/FindEach
8 | define_method "#{role.name}?" do
9 | role_id >= role.id
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/app/models/concerns/inlinable.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | module Inlinable
3 | def allow_inline(method)
4 | (allowed_inlines << method).flatten!
5 | end
6 |
7 | def allowed_inlines
8 | (@allowed_inlines ||= [])
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/app/models/concerns/lockable.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Lockable
4 | extend ActiveSupport::Concern
5 |
6 | included do
7 | # Lock is deprecated, only gives one lock, locks gives all.
8 | has_one :lock, as: :resource, dependent: :destroy
9 | has_many :locks, as: :resource, dependent: :destroy
10 | end
11 |
12 | def locked_by?(lock)
13 | lock.global? || lock.resource_equal?(self)
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/app/models/deploy_build.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class DeployBuild < ActiveRecord::Base
3 | belongs_to :deploy, inverse_of: :deploy_builds
4 | belongs_to :build, inverse_of: :deploy_builds
5 | end
6 | Samson::Hooks.load_decorators(DeployBuild)
7 |
--------------------------------------------------------------------------------
/app/models/deploy_groups_stage.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class DeployGroupsStage < ActiveRecord::Base
3 | belongs_to :stage, touch: true, inverse_of: :deploy_groups_stages
4 | belongs_to :deploy_group, inverse_of: :deploy_groups_stages
5 |
6 | def destroy
7 | self.class.where(stage_id: stage_id, deploy_group_id: deploy_group_id).delete_all
8 | end
9 | end
10 | Samson::Hooks.load_decorators(DeployGroupsStage)
11 |
--------------------------------------------------------------------------------
/app/models/outbound_webhook_stage.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class OutboundWebhookStage < ActiveRecord::Base
3 | belongs_to :outbound_webhook, dependent: nil, inverse_of: :outbound_webhook_stages
4 | belongs_to :stage, dependent: nil, inverse_of: :outbound_webhook_stages
5 |
6 | validates :stage_id, uniqueness: {scope: :outbound_webhook_id, message: "is already connected to this webhook"}
7 | end
8 |
--------------------------------------------------------------------------------
/app/models/secret_sharing_grant.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class SecretSharingGrant < ActiveRecord::Base
3 | audited
4 | belongs_to :project, inverse_of: :secret_sharing_grants
5 | validates :key,
6 | uniqueness: {scope: :project_id, message: "and project combination already in use", case_sensitive: true}
7 | end
8 | Samson::Hooks.load_decorators(SecretSharingGrant)
9 |
--------------------------------------------------------------------------------
/app/models/stage_command.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class StageCommand < ActiveRecord::Base
3 | has_soft_deletion default_scope: true
4 | include SoftDeleteWithDestroy
5 |
6 | belongs_to :stage, inverse_of: :stage_commands
7 | belongs_to :command, autosave: true, inverse_of: :stage_commands
8 | end
9 | Samson::Hooks.load_decorators(StageCommand)
10 |
--------------------------------------------------------------------------------
/app/models/star.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class Star < ActiveRecord::Base
3 | belongs_to :user, inverse_of: :stars
4 | belongs_to :project, inverse_of: :stars
5 |
6 | after_create :expire_user_cache
7 | after_destroy :expire_user_cache
8 |
9 | private
10 |
11 | def expire_user_cache
12 | Rails.cache.delete([:starred_projects_ids, user_id])
13 | end
14 | end
15 | Samson::Hooks.load_decorators(Star)
16 |
--------------------------------------------------------------------------------
/app/views/access_tokens/index.html.erb:
--------------------------------------------------------------------------------
1 | <%= page_title 'OAuth Access Tokens' %>
2 |
3 |
4 |
5 | <%= link_to "New", new_access_token_path, class: "btn btn-default" %>
6 |
7 |
8 | <%= render 'shared/access_token_table', access_tokens: @access_tokens %>
9 |
10 |
--------------------------------------------------------------------------------
/app/views/audits/show.html.erb:
--------------------------------------------------------------------------------
1 | <%= page_title "Audit ##{@audit.id}" %>
2 |
3 | <%= render 'table', audits: [@audit], global: true %>
4 |
--------------------------------------------------------------------------------
/app/views/changeset/_jira_issues.html.erb:
--------------------------------------------------------------------------------
1 | <% if jira_issues = changeset.jira_issues.presence %>
2 |
The following JIRA issues were mentioned in the pull request bodies in this deploy:
3 |
4 | <% jira_issues.each do |issue| %>
5 | <%= link_to issue.reference, issue.url %>
6 | <% end %>
7 |
8 | <% else %>
9 | No JIRA issues were referenced in this <%= type %>.
10 | <% end %>
11 |
--------------------------------------------------------------------------------
/app/views/changeset/_tab_list.html.erb:
--------------------------------------------------------------------------------
1 | <% Changeset::ATTRIBUTE_TABS.each do |tab| %>
2 | <%= tab.humanize %>
3 | <% end %>
4 |
5 | <%= Samson::Hooks.render_views(:deploy_changeset_tab_nav, self) %>
6 |
--------------------------------------------------------------------------------
/app/views/commands/_buttons.html.erb:
--------------------------------------------------------------------------------
1 | Save
2 | Cancel
3 | <%= link_to 'Delete', '#', class: 'btn btn-danger editable-destroy' %>
4 |
--------------------------------------------------------------------------------
/app/views/commands/edit.html.erb:
--------------------------------------------------------------------------------
1 | <%= page_title "Edit Command" %>
2 | <%= render 'form' %>
3 |
--------------------------------------------------------------------------------
/app/views/commands/new.html.erb:
--------------------------------------------------------------------------------
1 | <%= page_title "New Command" %>
2 | <%= render 'form' %>
3 |
--------------------------------------------------------------------------------
/app/views/commands/show.html.erb:
--------------------------------------------------------------------------------
1 | <%= page_title "Edit Command" %>
2 | <%= render 'form' %>
3 |
--------------------------------------------------------------------------------
/app/views/dashboards/_row.html.erb:
--------------------------------------------------------------------------------
1 | >
2 | <%= link_to project.name, project %>
3 |
4 | <% @deploy_groups.each do |deploy_group| %>
5 | <%= display_version(project.id, deploy_group.id) %>
6 | <% end %>
7 |
8 |
--------------------------------------------------------------------------------
/app/views/deploy_groups/new.html.erb:
--------------------------------------------------------------------------------
1 | <%= render template: 'deploy_groups/edit' %>
2 |
--------------------------------------------------------------------------------
/app/views/deploy_mailer/_commit_info.html.erb:
--------------------------------------------------------------------------------
1 | The detailed log can be viewed <%= link_to 'here', project_deploy_url(@project, @deploy) %>
2 |
3 | <% %w(risks commits pull_requests).each do |attribute| %>
4 | <%= attribute.humanize %>
5 | <%= render "changeset/#{attribute}", changeset: @changeset, type: 'deploy' %>
6 | <% end %>
7 |
--------------------------------------------------------------------------------
/app/views/deploy_mailer/bypass_email.html.erb:
--------------------------------------------------------------------------------
1 |
2 | Deploy buddy system bypassed by <%= @deploy.user.name %>
3 |
4 |
5 | The deploy buddy system has just been bypassed by <%= @deploy.user.name %>.
6 |
7 | <%= render 'commit_info' %>
8 |
--------------------------------------------------------------------------------
/app/views/deploy_mailer/bypass_email.text.erb:
--------------------------------------------------------------------------------
1 | Deploy buddy system bypassed by <%= @deploy.user.name %>
2 |
3 | <%= render 'commit_info' %>
4 |
--------------------------------------------------------------------------------
/app/views/deploy_mailer/bypass_jira_email.html.erb:
--------------------------------------------------------------------------------
1 |
2 | Deploy buddy system bypassed by <%= @deploy.user.name %>
3 |
4 |
5 | The deploy buddy system has just been bypassed by <%= @deploy.user.name %>.
6 |
7 | <%= render 'commit_info' %>
8 |
--------------------------------------------------------------------------------
/app/views/deploy_mailer/bypass_jira_email.text.erb:
--------------------------------------------------------------------------------
1 | Deploy buddy system bypassed by <%= @deploy.user.name %>
2 |
3 | <%= render 'commit_info' %>
4 |
--------------------------------------------------------------------------------
/app/views/deploy_mailer/deploy_email.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= @deploy.summary(show_project: true) %>
3 |
4 |
5 | <%= render 'commit_info' %>
6 |
--------------------------------------------------------------------------------
/app/views/deploy_mailer/deploy_email.text.erb:
--------------------------------------------------------------------------------
1 | <%= @deploy.summary %>
2 |
3 | <%= render 'commit_info' %>
4 |
--------------------------------------------------------------------------------
/app/views/deploys/_recent_releases.html.erb:
--------------------------------------------------------------------------------
1 | <% if recent_releases = @project.releases.last(5).presence %>
2 |
10 | <% end %>
11 |
--------------------------------------------------------------------------------
/app/views/deploys/changeset.html.erb:
--------------------------------------------------------------------------------
1 | <%# no page_title since this is rendered via ajax %>
2 |
3 | <% Changeset::ATTRIBUTE_TABS.each do |tab| %>
4 |
5 | <%= render "changeset/#{tab}", changeset: @changeset, type: 'deploy' %>
6 |
7 | <% end %>
8 |
9 | <%= Samson::Hooks.render_views(:deploy_changeset_tab_body, self) %>
10 |
--------------------------------------------------------------------------------
/app/views/jobs/_header.html.erb:
--------------------------------------------------------------------------------
1 | <%= status_panel @job %>
2 |
--------------------------------------------------------------------------------
/app/views/jobs/_job.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= relative_time(job.created_at) %>
3 |
4 | <%= link_to "#{job.user.name} executed:", [@project, job] %>
5 | <%= job.command %>
6 |
7 | <%= status_badge job.status %>
8 |
9 |
--------------------------------------------------------------------------------
/app/views/jobs/_log.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <% unless job.active? %>
3 | <%# needs single lines since we use them for log_lines_selection.js %>
4 | <% job.output.split("\n").each do |line| %>
5 | <%= render_log(line) %>
6 | <% end %>
7 | <% end %>
8 |
9 |
--------------------------------------------------------------------------------
/app/views/jobs/_restarting.html.erb:
--------------------------------------------------------------------------------
1 |
2 | Samson is currently restarting, your deploy has been queued and will be resumed shortly.
3 |
4 |
5 | <%= javascript_tag do %>
6 | waitUntilEnabled("<%= enabled_jobs_path %>");
7 | <% end %>
8 |
--------------------------------------------------------------------------------
/app/views/kaminari/_first_page.html.erb:
--------------------------------------------------------------------------------
1 | <%= link_to_unless current_page.first?, t('views.pagination.first').html_safe, url, remote: remote, class: "first btn btn-default" %>
2 |
--------------------------------------------------------------------------------
/app/views/kaminari/_gap.html.erb:
--------------------------------------------------------------------------------
1 | <%= t('views.pagination.truncate').html_safe %>
2 |
--------------------------------------------------------------------------------
/app/views/kaminari/_last_page.html.erb:
--------------------------------------------------------------------------------
1 | <%= link_to_unless current_page.last?, t('views.pagination.last').html_safe, url, remote: remote, class: "last btn btn-default" %>
2 |
--------------------------------------------------------------------------------
/app/views/kaminari/_next_page.html.erb:
--------------------------------------------------------------------------------
1 | <%= link_to_unless current_page.last?, t('views.pagination.next').html_safe, url, rel: 'next', remote: remote, class: "next btn btn-default" %>
2 |
--------------------------------------------------------------------------------
/app/views/kaminari/_page.html.erb:
--------------------------------------------------------------------------------
1 | <%= link_to page, url, { remote: remote, rel: page.next? ? 'next' : page.prev? ? 'prev' : nil, class: "btn btn-default page" + (page.current? ? ' active' : '')} %>
2 |
--------------------------------------------------------------------------------
/app/views/kaminari/_prev_page.html.erb:
--------------------------------------------------------------------------------
1 | <%= link_to_unless current_page.first?, t('views.pagination.previous').html_safe, url, rel: 'prev', remote: remote, class: "prev btn btn-default" %>
2 |
--------------------------------------------------------------------------------
/app/views/layouts/_alerts.html.erb:
--------------------------------------------------------------------------------
1 | <% flash.each do |type, message| %>
2 |
3 | ×
4 | <%= message %>
5 |
6 | <% end %>
7 |
--------------------------------------------------------------------------------
/app/views/locks/_button.html.erb:
--------------------------------------------------------------------------------
1 | <% if can? :write, :locks, resource %>
2 | <% prefix ||= "" %>
3 | <% warning = {resource: resource, warning: true, icon: warning_icon, text: "Add #{prefix}Warning", disabled: false} %>
4 | <% locking = {resource: resource, warning: false, icon: lock_icon, text: "Add #{prefix}Lock", disabled: false} %>
5 |
6 | <%= render '/locks/lock_button', warning %>
7 | <%= render '/locks/lock_button', locking %>
8 | <% end %>
9 |
--------------------------------------------------------------------------------
/app/views/projects/_header.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= star_for_project(project) %>
3 | <%= project.name %>
4 | <%= repository_web_link(project) %>
5 |
6 |
7 | <%= render_locks @project %>
8 |
9 |
10 | <%= render "locks/button", resource: @project %>
11 |
12 |
13 | <%= render "shared/project_tabs", project: project, active: tab %>
14 |
--------------------------------------------------------------------------------
/app/views/projects/_nav.html.erb:
--------------------------------------------------------------------------------
1 | <% @projects.each do |project| %>
2 |
3 | <%= link_to project do %>
4 | <% starred = current_user.starred_project?(project) %>
5 |
6 | <%= ' '.html_safe unless starred %>
7 |
8 | <%= project.name %>
9 | <% end %>
10 |
11 | <% end %>
12 |
--------------------------------------------------------------------------------
/app/views/projects/edit.html.erb:
--------------------------------------------------------------------------------
1 | <% page_title "Edit" %>
2 |
3 | <%= render 'projects/header', project: @project, tab: "settings" %>
4 |
5 |
6 | <%= render "form" %>
7 |
8 |
--------------------------------------------------------------------------------
/app/views/projects/new.html.erb:
--------------------------------------------------------------------------------
1 | <%= page_title 'New project' %>
2 |
3 |
4 | <%= render "form" %>
5 |
6 |
--------------------------------------------------------------------------------
/app/views/releases/_deploy_to_button.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 | Deploy to
4 |
5 |
12 |
13 |
--------------------------------------------------------------------------------
/app/views/secrets/_extras.html.erb:
--------------------------------------------------------------------------------
1 | <% @secret.except(:key, :value, :visible, :comment, :deprecated_at).reject { |_, v| v.nil? }.each do |attribute, value| %>
2 | <%= form.input attribute do %>
3 | <%= render_secret_attribute(attribute, value) %>
4 | <% end %>
5 | <% end %>
6 |
--------------------------------------------------------------------------------
/app/views/secrets/_header.html.erb:
--------------------------------------------------------------------------------
1 | <%= link_to '', 'https://github.com/zendesk/samson/blob/master/docs/secrets.md', class: "glyphicon glyphicon-info-sign" %>
2 |
3 | <%= link_to "Duplicates", duplicates_secrets_path %>
4 |
5 | <%= link_to "Sharing globals", secret_sharing_grants_path if Samson::Secrets::Manager.sharing_grants? %>
6 |
7 |
--------------------------------------------------------------------------------
/app/views/shared/_dashboard.html.erb:
--------------------------------------------------------------------------------
1 | <% if resource.dashboard.present? %>
2 | Dashboard
3 | <%= sanitize resource.dashboard, tags: Loofah::HTML5::SafeList::ACCEPTABLE_ELEMENTS + %w[iframe], attributes: Loofah::HTML5::SafeList::ACCEPTABLE_ATTRIBUTES %>
4 | <% end %>
5 |
--------------------------------------------------------------------------------
/app/views/shared/_dashboard_field.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 | Dashboard
4 | <%= additional_info "HTML that should be displayed on the show page. No Javascript allowed." %>
5 |
6 | <%= form.text_area :dashboard, class: "form-control", rows: 4 %>
7 |
8 |
--------------------------------------------------------------------------------
/app/views/shared/_errors.html.erb:
--------------------------------------------------------------------------------
1 | <% if object.errors.any? %>
2 |
3 |
4 |
Ooops! There was an error:
5 | <%= render_nested_errors(object) %>
6 |
7 |
8 | <% end %>
9 |
--------------------------------------------------------------------------------
/app/views/shared/_github_link.html.erb:
--------------------------------------------------------------------------------
1 | <%= link_to icon_tag('book'), project.repository_homepage, title: "View repository on GitHub" %>
2 |
--------------------------------------------------------------------------------
/app/views/shared/_gitlab_link.html.erb:
--------------------------------------------------------------------------------
1 | <%= link_to project.repository_homepage, class: "gitlab", target: "_blank", title: "View repository on Gitlab" do %>
2 | <%= image_tag "gitlab.png", width: 21, height: 21 %>
3 | <% end %>
4 |
--------------------------------------------------------------------------------
/app/views/shared/_output_stream.html.erb:
--------------------------------------------------------------------------------
1 | <% if job.active? %>
2 |
6 | <% end %>
7 |
--------------------------------------------------------------------------------
/app/views/shared/_search_query.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= label_tag "Search" %>
3 | <%= text_field_tag 'search[query]', params.dig(:search, :query), class: "form-control" %>
4 |
5 |
--------------------------------------------------------------------------------
/app/views/shared/_user_project_role.html.erb:
--------------------------------------------------------------------------------
1 | <%= form_tag user_project_roles_path(project_id: project.id, user_id: user.id), class: 'autosubmit' do %>
2 | <% options = [['None', nil]] + UserProjectRole::ROLES.map { |r| [r.name, r.id] } %>
3 | <% options.each do |name, id| %>
4 | <%= user_project_role_radio user, name, id, user_project_role_id %>
5 | <% end %>
6 | <% end %>
7 |
--------------------------------------------------------------------------------
/app/views/stages/_form.html.erb:
--------------------------------------------------------------------------------
1 | <%= form_for [project, stage], html: { class: "form-horizontal collapse_fieldsets" } do |form| %>
2 | <%= render 'shared/errors', object: stage %>
3 |
4 |
5 | <%= render 'stages/fields', form: form %>
6 |
7 |
8 |
9 |
10 | <%= form.actions delete: (:type if can?(:write, :stages, @project)) %>
11 | <% end %>
12 |
--------------------------------------------------------------------------------
/app/views/stages/_new_command.html.erb:
--------------------------------------------------------------------------------
1 | <% command ||= '' %>
2 |
3 |
4 |
5 | <%= text_area_tag 'stage[command_ids][]',
6 | command,
7 | class: "form-control",
8 | rows: 4,
9 | placeholder: "New stage command (e.x. 'cap production deploy')"
10 | %>
11 |
12 |
13 |
--------------------------------------------------------------------------------
/app/views/stages/edit.html.erb:
--------------------------------------------------------------------------------
1 | <%= breadcrumb @project, @stage, "Edit" %>
2 |
3 | <%= page_title "Edit #{@stage.name}" %>
4 |
5 |
6 | <%= render 'form', project: @project, stage: @stage %>
7 |
8 |
--------------------------------------------------------------------------------
/app/views/stages/new.html.erb:
--------------------------------------------------------------------------------
1 | <% page_title "New Stage" %>
2 |
3 | <%= breadcrumb @project, "New Stage" %>
4 |
5 |
6 | <%= render 'form', project: @project, stage: @stage %>
7 |
8 |
--------------------------------------------------------------------------------
/app/views/user_project_roles/_user_project_role.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= user.id %>
3 | <%= link_to_if can?(:write, :users), user.name, user %>
4 | <%= user.email %>
5 |
6 | <%= render partial: 'shared/user_project_role', locals: {user: user, project: @project, user_project_role_id: user.user_project_role_id} %>
7 |
8 |
9 |
--------------------------------------------------------------------------------
/app/views/users/_project.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= project.id %>
3 | <%= link_to project.name, project %>
4 |
5 | <%= render partial: 'shared/user_project_role', locals: {user: user, project: project, user_project_role_id: project.user_project_role_id} %>
6 |
7 |
8 |
--------------------------------------------------------------------------------
/app/views/users/_roles.html.erb:
--------------------------------------------------------------------------------
1 | <% if current_user.super_admin? %>
2 | <%= form_for user, html: {class: 'autosubmit'} do |f| %>
3 | <% Role.all.each do |role| %>
4 |
5 | <%= f.radio_button :role_id, role.id %>
6 | <%= role.display_name %>
7 |
8 | <% end %>
9 | <% end %>
10 | <% else %>
11 | <%= user.role.display_name %>
12 | <% end %>
13 |
--------------------------------------------------------------------------------
/app/views/users/_user.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= user.id %>
3 | <%= link_to user.name, user %>
4 | <%= user.email %>
5 | <%= render "roles", user: user %>
6 |
7 | <%= link_to "Delete", user, method: :delete, data: { confirm: "Delete ##{user.id} #{user.name} #{user.email} ?" }, class: "btn-sm btn-danger" if current_user.super_admin? %>
8 |
9 |
10 |
--------------------------------------------------------------------------------
/app/views/users/new.html.erb:
--------------------------------------------------------------------------------
1 | <%= page_title "New integration user" %>
2 |
3 |
4 | <%= form_for @user, html: { class: "form-horizontal" } do |form| %>
5 | <%= render 'shared/errors', object: @user %>
6 |
7 |
8 | <%= form.input :name, required: true %>
9 |
10 |
11 |
12 |
13 | <%= form.actions %>
14 | <% end %>
15 |
16 |
--------------------------------------------------------------------------------
/bin/rake:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | # frozen_string_literal: true
3 | require_relative '../config/boot'
4 | require 'rake'
5 | Rake.application.run
6 |
--------------------------------------------------------------------------------
/bin/script-executor:
--------------------------------------------------------------------------------
1 | # used by app/models/terminal_executor.rb to avoid osx command startup slowness
2 | eval "$(cat $FILE)"
3 |
--------------------------------------------------------------------------------
/config.ru:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | # This file is used by Rack-based servers to start the application.
3 | ENV['SERVER_MODE'] = '1'
4 | require_relative 'config/environment'
5 | run Rails.application
6 |
--------------------------------------------------------------------------------
/config/cable.yml:
--------------------------------------------------------------------------------
1 | # samson runs as a single server process, so we don't need redis
2 | test:
3 | adapter: inline
4 |
5 | development:
6 | adapter: async
7 |
8 | staging:
9 | adapter: async
10 |
11 | production:
12 | adapter: async
13 |
--------------------------------------------------------------------------------
/config/environment.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | # Load the Rails application.
3 | require_relative 'application'
4 |
5 | # Initialize the Rails application.
6 | Rails.application.initialize!
7 |
--------------------------------------------------------------------------------
/config/environments/staging.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | load File.expand_path 'production.rb', __dir__
3 |
4 | Samson::Application.configure do
5 | # show errors for easier debugging
6 | config.consider_all_requests_local = true
7 | end
8 |
--------------------------------------------------------------------------------
/config/initializers/audited.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class << Audited
4 | def with_username(username)
5 | old = store[:audited_user]
6 | store[:audited_user] = username
7 | yield
8 | ensure
9 | store[:audited_user] = old
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/config/initializers/bootstrap.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | # Configures Rails for Twitter Bootstrap.
3 |
4 | ActionView::Base.field_error_proc = proc do |html_tag, _instance_tag|
5 | %(#{html_tag}
).html_safe
6 | end
7 |
--------------------------------------------------------------------------------
/config/initializers/extra_dig.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require 'samson/extra_dig'
3 | Hash.include Samson::ExtraDig
4 |
--------------------------------------------------------------------------------
/config/initializers/git.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | min = "2.5.0"
3 | raise "Git not found" unless version = `git --version`[/\d+\.\d+\.\d+/]
4 | raise "Need git v#{min}+" if Gem::Version.new(version) < Gem::Version.new(min)
5 |
--------------------------------------------------------------------------------
/config/initializers/mime_types.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Mime::Type.register "image/svg+xml", :svg
3 |
--------------------------------------------------------------------------------
/config/initializers/multithreaded_loading.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | # https://github.com/rails/rails/issues/24028
3 | # can be removed if a deploy on osx in development mode without eager load works
4 | ActiveSupport::Dependencies::Interlock.class_eval do
5 | undef loading
6 | def loading
7 | yield
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/config/initializers/pagy.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require 'pagy/extras/array'
3 | require 'pagy/extras/bootstrap'
4 | require 'pagy/extras/overflow'
5 |
6 | # pagination after last page renders an empty page
7 | Pagy::Backend.prepend(
8 | Module.new do
9 | private
10 |
11 | def pagy(collection, options)
12 | super collection, options.merge(overflow: :empty_page)
13 | end
14 | end
15 | )
16 |
--------------------------------------------------------------------------------
/config/initializers/session_store.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | # Restart your server when you modify this file.
3 |
4 | Samson::Application.config.session_store :cache_store
5 |
--------------------------------------------------------------------------------
/config/initializers/thread_abort.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Thread.abort_on_exception = ["test", "development"].include?(Rails.env)
3 |
--------------------------------------------------------------------------------
/config/initializers/timezone.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | # This avoids excessive calls to /etc/localtime
3 | ENV['TZ'] = 'utc'
4 |
--------------------------------------------------------------------------------
/config/initializers/vault.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | # instrument all vault calls
3 | require 'vault'
4 |
5 | Vault::Client.prepend(
6 | Module.new do
7 | def request(method, path, *)
8 | ActiveSupport::Notifications.instrument("request.vault.samson", method: method, path: path) { super }
9 | end
10 | end
11 | )
12 |
--------------------------------------------------------------------------------
/config/puma.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative "boot"
3 |
4 | threads ENV.fetch('RAILS_MIN_THREADS', 8), ENV.fetch('RAILS_MAX_THREADS', 250)
5 | preload_app!
6 |
7 | bind "tcp://0.0.0.0:#{ENV.fetch("PORT", 9080)}"
8 |
--------------------------------------------------------------------------------
/db/migrate/20130807182821_create_projects.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class CreateProjects < ActiveRecord::Migration[4.2]
3 | def change
4 | create_table :projects do |t|
5 | t.string :name, null: false
6 | t.string :repository_url, null: false
7 |
8 | t.datetime :deleted_at
9 | t.timestamps
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/db/migrate/20130807191252_create_users.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class CreateUsers < ActiveRecord::Migration[4.2]
3 | def change
4 | create_table :users do |t|
5 | t.string :name
6 | t.string :email
7 |
8 | t.timestamps
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/db/migrate/20130813002317_add_user_roles.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddUserRoles < ActiveRecord::Migration[4.2]
3 | def change
4 | change_table :users do |t|
5 | t.integer :role_id, null: false, default: 0
6 | end
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/db/migrate/20131007183106_add_user_current_token.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddUserCurrentToken < ActiveRecord::Migration[4.2]
3 | def change
4 | change_table :users do |t|
5 | t.string :current_token
6 | end
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/db/migrate/20140106235614_create_stages.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class CreateStages < ActiveRecord::Migration[4.2]
3 | def change
4 | create_table :stages do |t|
5 | t.string :name, null: false
6 | t.text :command
7 | t.integer :project_id, null: false
8 |
9 | t.timestamps
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/db/migrate/20140107000028_create_jobs.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class CreateJobs < ActiveRecord::Migration[4.2]
3 | def change
4 | create_table :jobs do |t|
5 | t.text :command, null: false
6 | t.integer :user_id, null: false
7 | t.integer :project_id, null: false
8 | t.string :status, default: "pending"
9 | t.text :output
10 |
11 | t.timestamps
12 | end
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/db/migrate/20140107000258_create_deploys.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class CreateDeploys < ActiveRecord::Migration[4.2]
3 | def change
4 | create_table :deploys do |t|
5 | t.integer :stage_id, null: false
6 | t.integer :job_id, null: false
7 | t.string :commit, null: false
8 |
9 | t.timestamps
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/db/migrate/20140108010302_add_token_to_projects.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddTokenToProjects < ActiveRecord::Migration[4.2]
3 | def change
4 | change_table :projects do |t|
5 | t.string :token
6 | t.index :token, length: 191
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20140108043655_add_notify_email_address_to_stages.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddNotifyEmailAddressToStages < ActiveRecord::Migration[4.2]
3 | def change
4 | change_table :stages do |t|
5 | t.string :notify_email_address
6 | end
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/db/migrate/20140109041859_add_order_to_stage.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddOrderToStage < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :stages, :order, :integer
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20140109053431_job_text_upgrade.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class JobTextUpgrade < ActiveRecord::Migration[4.2]
3 | def change
4 | change_column :jobs, :output, :text, limit: (1.gigabyte / 4) - 1
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20140109073634_create_commands.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class CreateCommands < ActiveRecord::Migration[4.2]
3 | def change
4 | create_table :commands do |t|
5 | t.text :command, limit: 10.megabytes / 4
6 | t.belongs_to :user
7 | t.timestamps
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/db/migrate/20140109074325_remove_command_from_stage.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class RemoveCommandFromStage < ActiveRecord::Migration[4.2]
3 | def change
4 | remove_column :stages, :command
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20140110000439_create_stage_commands.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class CreateStageCommands < ActiveRecord::Migration[4.2]
3 | def change
4 | create_table :stage_commands do |t|
5 | t.belongs_to :stage
6 | t.belongs_to :command
7 | t.integer :position, default: 0, null: false
8 | t.timestamps
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/db/migrate/20140113083726_add_project_and_global_to_commands.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddProjectAndGlobalToCommands < ActiveRecord::Migration[4.2]
3 | def change
4 | change_table :commands do |t|
5 | t.remove :user_id
6 | t.belongs_to :project
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20140114004419_add_deletion_time_to_stages.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddDeletionTimeToStages < ActiveRecord::Migration[4.2]
3 | def change
4 | change_table :stages do |t|
5 | t.datetime :deleted_at
6 | end
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/db/migrate/20140114051012_add_reference_to_jobs.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddReferenceToJobs < ActiveRecord::Migration[4.2]
3 | def change
4 | change_table :jobs do |t|
5 | t.string :commit
6 | end
7 |
8 | change_table :deploys do |t|
9 | t.rename :commit, :reference
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/db/migrate/20140115063327_add_index_to_deploy.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddIndexToDeploy < ActiveRecord::Migration[4.2]
3 | def change
4 | add_index :deploys, :created_at
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20140115222724_add_stage_confirmation.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddStageConfirmation < ActiveRecord::Migration[4.2]
3 | def change
4 | change_table :stages do |t|
5 | t.boolean :confirm
6 | end
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/db/migrate/20140116001521_add_soft_deletion_to_users.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddSoftDeletionToUsers < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :users, :deleted_at, :datetime
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20140116041043_create_stars.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class CreateStars < ActiveRecord::Migration[4.2]
3 | def change
4 | create_table :stars do |t|
5 | t.integer :user_id, null: false
6 | t.integer :project_id, null: false
7 |
8 | t.timestamps
9 |
10 | t.index [:user_id, :project_id], unique: true
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/db/migrate/20140116050403_create_locks.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class CreateLocks < ActiveRecord::Migration[4.2]
3 | def change
4 | create_table :locks do |t|
5 | t.belongs_to :stage
6 | t.belongs_to :user
7 |
8 | t.timestamps
9 | t.datetime :deleted_at
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/db/migrate/20140227211403_make_confirm_default_to_true.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class MakeConfirmDefaultToTrue < ActiveRecord::Migration[4.2]
3 | def up
4 | change_column :stages, :confirm, :boolean, default: true
5 | end
6 |
7 | def down
8 | change_column :stages, :confirm, :boolean, default: nil
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/db/migrate/20140331094429_add_release_branch_to_projects.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddReleaseBranchToProjects < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :projects, :release_branch, :string
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20140331121039_add_deploy_on_release_to_stages.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddDeployOnReleaseToStages < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :stages, :deploy_on_release, :boolean, default: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20140414123939_rename_user_current_token.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class RenameUserCurrentToken < ActiveRecord::Migration[4.2]
3 | def change
4 | change_table :users do |t|
5 | t.rename :current_token, :token
6 | end
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/db/migrate/20140415011020_add_user_external_id.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddUserExternalId < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :users, :external_id, :string
5 | add_index :users, :external_id, unique: true, length: 191
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20140416194907_add_deploy_and_job_indexes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddDeployAndJobIndexes < ActiveRecord::Migration[4.2]
3 | def change
4 | add_index :deploys, :job_id
5 | add_index :jobs, :project_id
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20140520043144_add_description_to_lock.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddDescriptionToLock < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :locks, :description, :string
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20140625070348_add_buddy_to_deploy.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddBuddyToDeploy < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :deploys, :buddy_id, :integer
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20140707225625_add_started_at_to_deploys.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddStartedAtToDeploys < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :deploys, :started_at, :datetime
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20140717013754_add_production_to_stages.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddProductionToStages < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :stages, :production, :boolean, default: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20140804204455_add_soft_deletion_to_deploys.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddSoftDeletionToDeploys < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :deploys, :deleted_at, :datetime
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20140902105205_add_indices.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddIndices < ActiveRecord::Migration[4.2]
3 | def change
4 | add_index :deploys, :stage_id
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20140910113325_add_desktop_notify_to_users.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddDesktopNotifyToUsers < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :users, :desktop_notify, :boolean, default: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20141002162529_add_github_deployment_api_flag_to_stages.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddGithubDeploymentApiFlagToStages < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :stages, :use_github_deployment_api, :boolean
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20141014165353_add_deleted_at_column_to_webhooks.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddDeletedAtColumnToWebhooks < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :webhooks, :deleted_at, :datetime
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20141021202831_fix_invalid_permalinks.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class FixInvalidPermalinks < ActiveRecord::Migration[4.2]
3 | def change
4 | [Stage, Project].each do |klass|
5 | klass.with_deleted do
6 | klass.find_each do |object|
7 | object.permalink = object.permalink.parameterize
8 | object.save if object.permalink_changed?
9 | end
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/db/migrate/20141124214629_remove_unique_index_from_webhooks.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class RemoveUniqueIndexFromWebhooks < ActiveRecord::Migration[4.2]
3 | def change
4 | remove_index :webhooks, :stage_id_and_branch
5 | add_index :webhooks, [:stage_id, :branch], length: {branch: 191}
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20141211003651_jobs_index_on_status.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class JobsIndexOnStatus < ActiveRecord::Migration[4.2]
3 | def change
4 | add_index :jobs, :status, length: 191
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20141211005552_stages_index_deleted_at.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class StagesIndexDeletedAt < ActiveRecord::Migration[4.2]
3 | def change
4 | add_index :stages, [:project_id, :permalink, :deleted_at], length: {permalink: 191}
5 | remove_index :stages, column: [:project_id, :permalink]
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20141211005600_projects_index_deleted_at.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class ProjectsIndexDeletedAt < ActiveRecord::Migration[4.2]
3 | def change
4 | add_index :projects, [:permalink, :deleted_at], length: {permalink: 191}
5 | add_index :projects, [:token, :deleted_at], length: {token: 191}
6 |
7 | remove_index :projects, column: :permalink
8 | remove_index :projects, column: :token
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/db/migrate/20141211010750_locks_index_deleted_at.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class LocksIndexDeletedAt < ActiveRecord::Migration[4.2]
3 | def change
4 | add_index :locks, [:stage_id, :deleted_at, :user_id]
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20141211010825_users_index_deleted_at.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class UsersIndexDeletedAt < ActiveRecord::Migration[4.2]
3 | def change
4 | add_index :users, [:external_id, :deleted_at], length: {external_id: 191}
5 | remove_index :users, column: :external_id
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20150109005441_add_description_to_projects.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddDescriptionToProjects < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :projects, :description, :text, limit: 65535
5 | add_column :projects, :owner, :string, limit: 255
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20150220193142_add_dashboard_to_stages.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddDashboardToStages < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :stages, :dashboard, :text, limit: 65535
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20150228003920_add_warning_to_locks.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddWarningToLocks < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :locks, :warning, :boolean, default: false, null: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20150302060555_enforce_lock_user_id.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class EnforceLockUserId < ActiveRecord::Migration[4.2]
3 | def change
4 | Lock.where(user_id: nil).update_all(user_id: User.where(role_id: 3).first.id) if User.where(role_id: 3).first
5 | change_column_null :locks, :user_id, false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20150317205551_jobs_add_tag.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class JobsAddTag < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :jobs, :tag, :string
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20150416231106_add_source_to_webhook.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddSourceToWebhook < ActiveRecord::Migration[4.2]
3 | def up
4 | add_column :webhooks, :source, :string, null: false, default: 'any_ci'
5 | change_column_default :webhooks, :source, nil
6 | end
7 |
8 | def down
9 | change_table :webhooks do |t|
10 | t.remove :source
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/db/migrate/20150508142111_add_build_references.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddBuildReferences < ActiveRecord::Migration[4.2]
3 | def change
4 | change_table :deploys do |t|
5 | t.belongs_to :build, index: true
6 | end
7 |
8 | change_table :releases do |t|
9 | t.belongs_to :build, index: true
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/db/migrate/20150605194346_rename_build_columns.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class RenameBuildColumns < ActiveRecord::Migration[4.2]
3 | def change
4 | change_table :builds do |t|
5 | t.rename :container_sha, :docker_sha
6 | t.rename :container_ref, :docker_ref
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20150611013506_rename_docker_digest_columns.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class RenameDockerDigestColumns < ActiveRecord::Migration[4.2]
3 | def change
4 | change_table :builds do |t|
5 | t.remove_index column: :docker_sha
6 | t.rename :docker_sha, :docker_image_id
7 | t.rename :docker_image_url, :docker_repo_digest
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/db/migrate/20150618182108_add_env_value_to_deploy_group.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddEnvValueToDeployGroup < ActiveRecord::Migration[4.2]
3 | class DeployGroup < ActiveRecord::Base
4 | end
5 |
6 | def change
7 | add_column :deploy_groups, :env_value, :string
8 | DeployGroup.update_all('env_value = name')
9 | change_column_null :deploy_groups, :env_value, false
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/db/migrate/20150619170905_projects_add_deploy_with_docker.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class ProjectsAddDeployWithDocker < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :projects, :deploy_with_docker, :boolean, default: false, null: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20150720121725_add_auto_build_docker_image_to_projects.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddAutoBuildDockerImageToProjects < ActiveRecord::Migration[4.2]
3 | def change
4 | change_table :projects do |t|
5 | t.boolean :auto_release_docker_image, default: false, null: false
6 | end
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/db/migrate/20150903201829_add_number_to_builds.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddNumberToBuilds < ActiveRecord::Migration[4.2]
3 | def change
4 | change_table :builds do |t|
5 | t.integer :number, after: :project_id
6 | end
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/db/migrate/20150924082915_create_user_project_roles.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class CreateUserProjectRoles < ActiveRecord::Migration[4.2]
3 | create_table :user_project_roles, id: :integer do |t|
4 | t.belongs_to :project, null: false, index: true, type: :integer
5 | t.belongs_to :user, null: false, index: true, type: :integer
6 | t.integer :role_id, null: false
7 | t.timestamps null: false
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20151001140703_add_access_request_pending_to_users.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddAccessRequestPendingToUsers < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :users, :access_request_pending, :boolean, default: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20151211031950_add_delete_at_to_lock.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddDeleteAtToLock < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :locks, :delete_at, :datetime
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20160205015635_add_bypass_buddy_check_to_stages.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddBypassBuddyCheckToStages < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :stages, :bypass_buddy_check, :boolean, default: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20160218161746_add_csv_export.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddCsvExport < ActiveRecord::Migration[4.2]
3 | def change
4 | create_table :csv_exports do |t|
5 | t.integer :user_id, null: false
6 | t.timestamps null: false
7 | t.string :filters, null: false, default: "{}"
8 | t.string :status, null: false, default: "pending"
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/db/migrate/20160317212902_add_release_flag_to_deploys.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddReleaseFlagToDeploys < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :deploys, :release, :boolean, default: true, null: false
5 | change_column_default :deploys, :release, false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20160317215713_rename_bypass_buddy_check.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class RenameBypassBuddyCheck < ActiveRecord::Migration[4.2]
3 | def change
4 | rename_column :stages, :bypass_buddy_check, :no_code_deployed
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20160328221058_add_time_format_to_user.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddTimeFormatToUser < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :users, :time_format, :string, default: 'relative', null: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20160408193842_remove_user_from_macro.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class RemoveUserFromMacro < ActiveRecord::Migration[4.2]
3 | def change
4 | remove_column :macros, :user_id, :integer
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20160508055458_rename_is_production.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class RenameIsProduction < ActiveRecord::Migration[4.2]
3 | def change
4 | rename_column :environments, :is_production, :production
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20160726210144_add_vault_instance_to_deploy_groups.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddVaultInstanceToDeployGroups < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :deploy_groups, :vault_instance, :string, null: true
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20160818194622_add_visibility_to_secrets.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddVisibilityToSecrets < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :secrets, :visible, :boolean, default: false, null: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20160818210955_add_comment_to_secrets.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddCommentToSecrets < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :secrets, :comment, :string
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20160827172550_add_deploy_to_new_pods_to_projects.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddDeployToNewPodsToProjects < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :projects, :include_new_deploy_groups, :boolean, default: false, null: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20160831151133_add_is_template_to_stage.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddIsTemplateToStage < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :stages, :is_template, :boolean, default: false, null: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20160927223306_save_source_template_to_clone_stage.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class SaveSourceTemplateToCloneStage < ActiveRecord::Migration[5.0]
3 | def change
4 | add_column :stages, :template_stage_id, :integer
5 | add_index :stages, :template_stage_id
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20161012161509_add_user_id_index_to_jobs.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddUserIdIndexToJobs < ActiveRecord::Migration[5.0]
3 | def change
4 | add_index :jobs, :user_id
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20161019034559_add_jenkins_email_committers_to_stage.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddJenkinsEmailCommittersToStage < ActiveRecord::Migration[5.0]
3 | def change
4 | add_column :stages, :jenkins_email_committers, :boolean, default: false, null: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20161028173926_add_last_login_at_to_users.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddLastLoginAtToUsers < ActiveRecord::Migration[5.0]
3 | def change
4 | add_column :users, :last_login_at, :datetime
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20161028211415_track_last_seen_at.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class TrackLastSeenAt < ActiveRecord::Migration[5.0]
3 | def change
4 | add_column :users, :last_seen_at, :datetime
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20161102201243_add_metadata_to_access_tokens.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddMetadataToAccessTokens < ActiveRecord::Migration[5.0]
3 | def change
4 | add_column :oauth_access_tokens, :description, :string
5 | add_column :oauth_access_tokens, :last_used_at, :datetime
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20161103205530_add_run_in_parallel_to_stages.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddRunInParallelToStages < ActiveRecord::Migration[5.0]
3 | def change
4 | add_column :stages, :run_in_parallel, :boolean, default: false, null: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20161103221846_remove_invalid_users.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class RemoveInvalidUsers < ActiveRecord::Migration[5.0]
3 | class User < ActiveRecord::Base
4 | end
5 |
6 | def change
7 | User.where(deleted_at: nil, external_id: nil, integration: false).update_all(deleted_at: Time.at(1478211603))
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20161114194705_releases_number_to_string.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class ReleasesNumberToString < ActiveRecord::Migration[5.0]
3 | def change
4 | change_column :releases, :number, :string, limit: 20, default: "1", null: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20161116022637_add_jenkins_auto_config_build_params_to_stage.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddJenkinsAutoConfigBuildParamsToStage < ActiveRecord::Migration[5.0]
3 | def change
4 | add_column :stages, :jenkins_build_params, :boolean, default: false, null: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20161208170829_bump_lock_description.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class BumpLockDescription < ActiveRecord::Migration[5.0]
3 | def change
4 | change_column :locks, :description, :string, limit: 1024
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20161213182356_add_flag_to_skip_kubernetes_rollback.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddFlagToSkipKubernetesRollback < ActiveRecord::Migration[5.0]
3 | def change
4 | add_column :deploys, :kubernetes_rollback, :boolean, default: true, null: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20161216202909_add_release_sources.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddReleaseSources < ActiveRecord::Migration[5.0]
4 | def change
5 | add_column :projects, :release_source, :string, null: false, default: "any"
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20161228210729_rename_docker_ref_to_tag.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class RenameDockerRefToTag < ActiveRecord::Migration[5.0]
3 | def change
4 | rename_column :builds, :docker_ref, :docker_tag
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20170118172040_add_finished_at_to_builds.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddFinishedAtToBuilds < ActiveRecord::Migration[5.0]
3 | def change
4 | add_column :builds, :started_at, :datetime
5 | add_column :builds, :finished_at, :datetime
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20170130235020_add_cancel_queued_deploys_to_stages.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddCancelQueuedDeploysToStages < ActiveRecord::Migration[5.0]
3 | def change
4 | add_column :stages, :cancel_queued_deploys, :boolean, default: false, null: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20170208195102_add_source_url_to_builds.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddSourceUrlToBuilds < ActiveRecord::Migration[5.0]
3 | def change
4 | add_column :builds, :source_url, :string
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20170208221802_enforce_ordering.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class EnforceOrdering < ActiveRecord::Migration[5.0]
3 | class Stage < ActiveRecord::Base
4 | end
5 |
6 | def up
7 | Stage.where(order: nil).update_all(order: 0)
8 | change_column_null :stages, :order, false
9 | end
10 |
11 | def down
12 | change_column_null :stages, :order, true
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/db/migrate/20170317001258_add_dashboard_to_projects.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddDashboardToProjects < ActiveRecord::Migration[5.0]
3 | def change
4 | add_column :projects, :dashboard, :text
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20170402035231_add_macro_to_stages.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddMacroToStages < ActiveRecord::Migration[5.0]
3 | def change
4 | add_column :stages, :no_reference_selection, :boolean, default: false, null: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20170407001330_add_canceller_to_jobs.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddCancellerToJobs < ActiveRecord::Migration[5.0]
3 | def change
4 | add_column :jobs, :canceller_id, :integer
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20170502160403_remove_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class RemoveForeignKey < ActiveRecord::Migration[5.0]
3 | def up
4 | remove_foreign_key "deploy_groups", "environments" if foreign_key_exists?("deploy_groups", "environments")
5 | end
6 |
7 | def down
8 | add_foreign_key "deploy_groups", "environments"
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/db/migrate/20170513222253_remove_macros.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class RemoveMacros < ActiveRecord::Migration[5.1]
3 | def up
4 | drop_table :macros
5 | drop_table :macro_commands
6 | end
7 |
8 | def down
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/db/migrate/20170718083150_cleanup_bad_roles.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class CleanupBadRoles < ActiveRecord::Migration[5.1]
3 | class User < ActiveRecord::Base
4 | end
5 |
6 | class UserProjectRole < ActiveRecord::Base
7 | end
8 |
9 | def up
10 | existing_users = User.where(deleted_at: nil).pluck(:id)
11 | UserProjectRole.where.not(user_id: existing_users).delete_all
12 | end
13 |
14 | def down
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/db/migrate/20170727181942_add_deprecated_at_to_secret.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddDeprecatedAtToSecret < ActiveRecord::Migration[5.1]
3 | def change
4 | add_column :secrets, :deprecated_at, :timestamp
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20170817213634_bump_audit_size_for_big_envs.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class BumpAuditSizeForBigEnvs < ActiveRecord::Migration[5.1]
3 | def up
4 | change_column :audits, :audited_changes, :text, limit: (1.gigabyte / 4) - 1
5 | end
6 |
7 | def down
8 | change_column :audits, :audited_changes, :text
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/db/migrate/20170821222130_add_docker_builds_disabled_flag_to_projects.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddDockerBuildsDisabledFlagToProjects < ActiveRecord::Migration[5.1]
3 | def change
4 | add_column :projects, :docker_image_building_disabled, :boolean, default: false, null: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20170824174718_remove_build_from_releases.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class RemoveBuildFromReleases < ActiveRecord::Migration[5.1]
3 | def up
4 | remove_column :releases, :build_id
5 | end
6 |
7 | def down
8 | add_column :releases, :build_id, :string
9 | add_index :releases, :build_id
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/db/migrate/20170825225929_rename_build_label.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class RenameBuildLabel < ActiveRecord::Migration[5.1]
3 | def change
4 | rename_column :builds, :label, :name
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20170929181901_add_external_build_attributes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddExternalBuildAttributes < ActiveRecord::Migration[5.1]
3 | def change
4 | add_column :builds, :external_id, :string
5 | add_index :builds, :external_id, unique: true, length: {external_id: 40}
6 | add_column :builds, :external_status, :string
7 | rename_column :builds, :source_url, :external_url
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20171012004814_make_build_dockerfile_universal.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class MakeBuildDockerfileUniversal < ActiveRecord::Migration[5.1]
3 | def change
4 | change_column_null :builds, :dockerfile, true
5 | add_column :builds, :image_name, :string
6 | add_index :builds, [:git_sha, :image_name], unique: true, length: {git_sha: 80, image_name: 80}
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/db/migrate/20171020184047_increase_build_external_id_index_size.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class IncreaseBuildExternalIdIndexSize < ActiveRecord::Migration[5.1]
3 | def change
4 | remove_index :builds, :external_id
5 | add_index :builds, :external_id, unique: true, length: {external_id: 191}
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20171031110801_remove_noreply.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class RemoveNoreply < ActiveRecord::Migration[5.1]
3 | class User < ActiveRecord::Base
4 | end
5 |
6 | def up
7 | User.where(User.arel_table[:email].matches("noreply%")).where(integration: true).update(email: nil)
8 | end
9 |
10 | def down
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/db/migrate/20171215234357_add_builds_in_environment_flag.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddBuildsInEnvironmentFlag < ActiveRecord::Migration[5.1]
3 | def change
4 | add_column :stages, :builds_in_environment, :boolean, default: false, null: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20171221213213_drop_docker_image_id.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class DropDockerImageId < ActiveRecord::Migration[5.1]
3 | def change
4 | remove_column :builds, :docker_image_id, :string
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20180126004937_remove_build_external_id.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class RemoveBuildExternalId < ActiveRecord::Migration[5.1]
3 | def change
4 | remove_column :builds, :external_id, :string
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20180601222241_remove_user_token.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class RemoveUserToken < ActiveRecord::Migration[5.2]
3 | def change
4 | remove_column :users, :token, :string
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20180719171414_add_confidential_to_doorkeeper_application.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddConfidentialToDoorkeeperApplication < ActiveRecord::Migration[5.2]
4 | def change
5 | add_column(
6 | :oauth_applications,
7 | :confidential,
8 | :boolean,
9 | null: false,
10 | default: true # maintaining backwards compatibility: require secrets
11 | )
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/db/migrate/20180921170100_add_default_reference_to_stages.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddDefaultReferenceToStages < ActiveRecord::Migration[5.2]
4 | def change
5 | add_column :stages, :default_reference, :string
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20181009022203_add_full_checkout_to_stages.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddFullCheckoutToStages < ActiveRecord::Migration[5.2]
3 | def change
4 | add_column :stages, :full_checkout, :boolean, default: false, null: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20181127191406_add_redeploy_previous_when_failed.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddRedeployPreviousWhenFailed < ActiveRecord::Migration[5.2]
4 | def change
5 | add_column :stages, :allow_redeploy_previous_when_failed, :boolean, default: false, null: false
6 | add_column :deploys, :redeploy_previous_when_failed, :boolean, default: false, null: false
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/db/migrate/20181201004640_add_versioned_kv_to_vault_server.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddVersionedKvToVaultServer < ActiveRecord::Migration[5.2]
4 | def change
5 | add_column :vault_servers, :versioned_kv, :boolean, null: false, default: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20190206191721_add_preferred_vault_server.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddPreferredVaultServer < ActiveRecord::Migration[5.2]
4 | def change
5 | add_column :vault_servers, :preferred_reader, :boolean, default: false, null: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20190326183413_de_poly_release_author.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class DePolyReleaseAuthor < ActiveRecord::Migration[5.2]
3 | def change
4 | remove_column :releases, :author_type
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20190527160620_add_github_username_to_users.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddGithubUsernameToUsers < ActiveRecord::Migration[5.2]
4 | def change
5 | add_column :users, :github_username, :string
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20191029174730_remove_deploy_build_id.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class RemoveDeployBuildId < ActiveRecord::Migration[5.2]
3 | def change
4 | remove_column :deploys, :build_id
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20191029181037_add_deploy_builds.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddDeployBuilds < ActiveRecord::Migration[5.2]
3 | def change
4 | create_table :deploy_builds do |t|
5 | t.references :build, index: true, null: false
6 | t.references :deploy, index: true, null: false
7 | t.timestamps
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/db/migrate/20191101221308_add_pending_checks_ignore_to_project.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddPendingChecksIgnoreToProject < ActiveRecord::Migration[5.2]
3 | def change
4 | add_column :projects, :ignore_pending_checks, :string
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20191108223054_add_before_deploy_to_outbound_webhooks.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddBeforeDeployToOutboundWebhooks < ActiveRecord::Migration[5.2]
3 | def change
4 | add_column :outbound_webhooks, :before_deploy, :boolean, default: false, null: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20191108232023_add_status_path_to_outbound_webhook.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddStatusPathToOutboundWebhook < ActiveRecord::Migration[5.2]
3 | def change
4 | add_column :outbound_webhooks, :status_path, :string
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20191203072937_add_disabled_to_webhooks.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddDisabledToWebhooks < ActiveRecord::Migration[5.2]
3 | def change
4 | add_column :webhooks, :disabled, :boolean, default: false, null: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20191203085811_add_disabled_to_outbound_webhooks.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddDisabledToOutboundWebhooks < ActiveRecord::Migration[5.2]
3 | def change
4 | add_column :outbound_webhooks, :disabled, :boolean, default: false, null: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20200923223936_change_csv_export_filter_to_text.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ChangeCsvExportFilterToText < ActiveRecord::Migration[6.0]
4 | def change
5 | change_column :csv_exports, :filters, :text, default: nil, null: true
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/docker-compose.yml:
--------------------------------------------------------------------------------
1 | version: "2"
2 | services:
3 | samson:
4 | image: zendesk/samson:latest # replace with `build: .` to use Dockerfile (--build to rebuild it)
5 | ports:
6 | - "3000:9080"
7 | volumes:
8 | - .:/app/
9 | environment:
10 | DATABASE_URL: "sqlite3:///app/db/development.sqlite3"
11 | RAILS_LOG_TO_STDOUT: 1
12 | command: ["./script/docker_dev_server"]
13 |
--------------------------------------------------------------------------------
/docs/images/datadog.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/samson/db8bad2b146c24de29c73dfddc48bec1c527549a/docs/images/datadog.png
--------------------------------------------------------------------------------
/docs/images/deploy_group_admin.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/samson/db8bad2b146c24de29c73dfddc48bec1c527549a/docs/images/deploy_group_admin.png
--------------------------------------------------------------------------------
/docs/images/deploy_group_admin2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/samson/db8bad2b146c24de29c73dfddc48bec1c527549a/docs/images/deploy_group_admin2.png
--------------------------------------------------------------------------------
/docs/images/deploy_group_dash1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/samson/db8bad2b146c24de29c73dfddc48bec1c527549a/docs/images/deploy_group_dash1.png
--------------------------------------------------------------------------------
/docs/images/deploy_group_dash2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/samson/db8bad2b146c24de29c73dfddc48bec1c527549a/docs/images/deploy_group_dash2.png
--------------------------------------------------------------------------------
/docs/images/request_access_page.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/samson/db8bad2b146c24de29c73dfddc48bec1c527549a/docs/images/request_access_page.png
--------------------------------------------------------------------------------
/docs/images/request_access_popup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/samson/db8bad2b146c24de29c73dfddc48bec1c527549a/docs/images/request_access_popup.png
--------------------------------------------------------------------------------
/docs/images/request_access_profile.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/samson/db8bad2b146c24de29c73dfddc48bec1c527549a/docs/images/request_access_profile.png
--------------------------------------------------------------------------------
/lib/generators/plugin/templates/samson_plugin.gemspec.erb:
--------------------------------------------------------------------------------
1 | Gem::Specification.new 'samson_<%= file_name %>', '0.0.0' do |s|
2 | s.summary = 'Samson <%= name %> plugin'
3 | s.authors = ['<%= username %>']
4 | s.email = ['<%= email %>']
5 | s.files = Dir['{app,config,db,lib}/**/*']
6 | end
7 |
--------------------------------------------------------------------------------
/lib/generators/plugin/templates/test_helper.rb.erb:
--------------------------------------------------------------------------------
1 | require_relative '../../../test/test_helper'
2 |
--------------------------------------------------------------------------------
/lib/samson/bump_touch.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | module Samson
3 | module BumpTouch
4 | def bump_touch
5 | new = Time.now
6 | new += 1 if new.to_i == updated_at.to_i
7 | update_column(:updated_at, new)
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/lib/samson/diff.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require 'diffy'
4 |
5 | module Samson
6 | module Diff
7 | # see https://github.com/samg/diffy
8 | def self.text_diff(a, b)
9 | Diffy::Diff.new(a, b).to_s(:html).html_safe
10 | end
11 |
12 | def self.style_tag
13 | "".html_safe
14 | end
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/lib/samson/env_check.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | module Samson
3 | module EnvCheck
4 | FALSE = Set.new(['0', 'false', nil, ''])
5 |
6 | def self.set?(k)
7 | !FALSE.include?(ENV[k])
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/lib/samson/integration.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | module Samson
3 | class Integration
4 | SOURCES = Rails.root.join('app', 'controllers', 'integrations').children(false).map do |controller_path|
5 | # keep in sync with app/controllers/integrations/base_controller.rb#service_name
6 | controller_path.to_s[/\A(?!base)(\w+)_controller.rb\z/, 1]
7 | end.compact.freeze
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/lib/samson/output_utils.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Samson
4 | module OutputUtils
5 | def self.timestamp
6 | "[#{Time.now.utc.strftime("%T")}]"
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/lib/samson/secrets.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | module Samson
3 | module Secrets
4 | # making url generation from models work by changing
5 | # samson_secrets_vault_server_path -> vault_server_path
6 | def self.use_relative_model_naming?
7 | true
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/lib/tasks/dump.rake:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | # normalize schema after dumping to avoid diff
3 | # tested via test/integration/tasks_test.rb
4 | task "db:schema:dump" do
5 | next unless ActiveRecord::Base.connection.adapter_name.match?(/mysql/i)
6 | file = "db/schema.rb"
7 | schema = File.read(file)
8 | schema.gsub!(/, charset: "utf8mb4".* do/, " do")
9 | File.write(file, schema)
10 | end
11 |
--------------------------------------------------------------------------------
/log/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/samson/db8bad2b146c24de29c73dfddc48bec1c527549a/log/.keep
--------------------------------------------------------------------------------
/plugins/airbrake/README.md:
--------------------------------------------------------------------------------
1 | # Airbrake Plugin
2 |
3 | Plugin that notifies Airbrake of errors
4 |
--------------------------------------------------------------------------------
/plugins/airbrake/samson_airbrake.gemspec:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | Gem::Specification.new 'samson_airbrake', '0.0.0' do |s|
4 | s.summary = 'Samson Airbrake plugin'
5 | s.authors = ['Ryan Gurney']
6 | s.email = ['rygurney@zendesk.com']
7 | s.files = Dir['{app,config,db,lib}/**/*']
8 |
9 | s.add_runtime_dependency 'airbrake'
10 | end
11 |
--------------------------------------------------------------------------------
/plugins/airbrake/test/test_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require_relative '../../../test/test_helper'
4 |
--------------------------------------------------------------------------------
/plugins/airbrake_hook/README.md:
--------------------------------------------------------------------------------
1 | Notify airbrake after deploys if, to resolve all old errors if:
2 | - deploy groups are used
3 | - deploy was a success
4 | - stage has notify_airbrake enabled
5 | - environment name is simple / looks like a rail env (staging/production)
6 | - `airbrake_api_key` is set as secret for the given project/deploy-group
7 |
--------------------------------------------------------------------------------
/plugins/airbrake_hook/db/migrate/20160915042046_add_airbrake_to_project.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddAirbrakeToProject < ActiveRecord::Migration[5.0]
3 | def change
4 | add_column :stages, :notify_airbrake, :boolean, default: false, null: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/airbrake_hook/samson_airbrake_hook.gemspec:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Gem::Specification.new 'samson_airbrake_hook', '0.0.0' do |s|
3 | s.summary = 'Samson airbrake plugin'
4 | s.authors = ['Michael Grosser']
5 | s.email = ['michael@grosser.it']
6 | s.files = Dir['{app,config,db,lib}/**/*']
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/airbrake_hook/test/test_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative '../../../test/test_helper'
3 |
--------------------------------------------------------------------------------
/plugins/assertible/README.md:
--------------------------------------------------------------------------------
1 | Notify Assertible after succeeded deploys.
2 |
3 | Following environment variables must be set:
4 | - `ASSERTIBLE_DEPLOY_TOKEN`
5 | - `ASSERTIBLE_SERVICE_KEY`
6 |
7 | They can be found in Assertible by going to the `Deployments` tab from a
8 | service's dashboard.
9 |
--------------------------------------------------------------------------------
/plugins/assertible/app/views/samson_assertible/_stage_form_checkbox.html.erb:
--------------------------------------------------------------------------------
1 | <%= form.input :notify_assertible, label: 'Notify Assertible of deploys', as: :check_box %>
2 |
--------------------------------------------------------------------------------
/plugins/assertible/db/migrate/20180209012126_add_notify_assertible_to_stages.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddNotifyAssertibleToStages < ActiveRecord::Migration[5.1]
4 | def change
5 | add_column :stages, :notify_assertible, :boolean, default: false, null: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/assertible/samson_assertible.gemspec:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | Gem::Specification.new 'samson_assertible', '0.0.0' do |s|
4 | s.summary = 'Samson Assertible plugin'
5 | s.authors = ['Zachary Wright']
6 | s.email = ['zacharygwright@gmail.com']
7 | s.files = Dir['{app,config,db,lib}/**/*']
8 | end
9 |
--------------------------------------------------------------------------------
/plugins/assertible/test/test_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require_relative '../../../test/test_helper'
4 |
--------------------------------------------------------------------------------
/plugins/aws_ecr/samson_aws_ecr.gemspec:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Gem::Specification.new "samson_aws_ecr", "0.0.0" do |s|
3 | s.summary = "Add Support for AWS ECR Docker registry"
4 | s.authors = [""]
5 | s.email = ""
6 | s.add_runtime_dependency "aws-sdk-ecr"
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/aws_ecr/test/test_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative '../../../test/test_helper'
3 |
--------------------------------------------------------------------------------
/plugins/aws_sts/db/migrate/20181001083613_add_aws_sts_arn_to_stages.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddAwsStsArnToStages < ActiveRecord::Migration[5.2]
4 | def change
5 | add_column :stages, :aws_sts_iam_role_arn, :string
6 | add_column :stages, :aws_sts_iam_role_session_duration, :integer
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/plugins/aws_sts/samson_aws_sts.gemspec:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | Gem::Specification.new 'samson_aws_sts', '0.0.0' do |s|
4 | s.summary = 'Samson AwsSts plugin'
5 | s.authors = ['Gerard Cahill']
6 | s.email = ['gcahill@zendesk.com']
7 | s.files = Dir['{app,config,db,lib}/**/*']
8 | s.add_runtime_dependency "aws-sdk-core"
9 | end
10 |
--------------------------------------------------------------------------------
/plugins/aws_sts/test/test_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require_relative '../../../test/test_helper'
4 |
--------------------------------------------------------------------------------
/plugins/datadog/README.md:
--------------------------------------------------------------------------------
1 | - Datadog monitoring on stage page + fail/redeploy when monitor goes bad during deployment
2 | - Configurable per project or stage with customizable deploy-group-to-datadog-tag matching
3 | - Before/after-deploy events
4 |
5 | Env vars to set:
6 | ```
7 | DATADOG_API_KEY
8 | DATADOG_APPLICATION_KEY
9 | DATADOG_SUBDOMAIN # optional
10 | DATADOG_URL # optional
11 | ```
12 |
--------------------------------------------------------------------------------
/plugins/datadog/app/controllers/datadog/monitors_controller.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class Datadog::MonitorsController < ApplicationController
4 | def index
5 | @project = Project.find_by_param!(params.require(:project_id))
6 | if stage_permalink = params[:stage_id]
7 | @stage = @project.stages.find_by_param!(stage_permalink)
8 | end
9 |
10 | render "samson_datadog/_monitor_list", layout: false
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/plugins/datadog/app/views/samson_datadog/_monitor_list.html.erb:
--------------------------------------------------------------------------------
1 | <% deploy_groups = @stage&.deploy_groups || [] %>
2 | <% (@stage || @project).datadog_monitors.each do |monitor| %>
3 | <% label = {"OK" => "success", "Alert" => "danger", "Warn" => "warning"}[monitor.state(deploy_groups)] || "info" %>
4 | <%= link_to monitor.name, monitor.url(deploy_groups), class: "label label-#{label}" %>
5 | <% end %>
6 |
--------------------------------------------------------------------------------
/plugins/datadog/app/views/samson_datadog/_project_dashboard.html.erb:
--------------------------------------------------------------------------------
1 | <% if @project.datadog_monitors? %>
2 | Datadog Monitors
3 | <%# show monitors without blocking the page, leaving room for 1 row of monitors to pop in %>
4 |
5 |
6 | <% end %>
7 |
--------------------------------------------------------------------------------
/plugins/datadog/app/views/samson_datadog/_project_form.html.erb:
--------------------------------------------------------------------------------
1 |
2 | Datadog
3 |
4 | <%= render "samson_datadog/datadog_monitor_queries_fields", form: form %>
5 |
6 |
7 |
--------------------------------------------------------------------------------
/plugins/datadog/app/views/samson_datadog/_stage_show.html.erb:
--------------------------------------------------------------------------------
1 | <% if @stage.datadog_monitors? %>
2 | Datadog Monitors
3 | <%# show monitors without blocking the page, leaving room for 1 row of monitors to pop in %>
4 |
5 |
6 | <% end %>
7 |
--------------------------------------------------------------------------------
/plugins/datadog/config/routes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | Samson::Application.routes.draw do
4 | namespace :datadog do
5 | get "/monitors", to: "monitors#index", as: :monitors
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/datadog/db/migrate/20140203155241_add_datadog_tag_to_stages.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddDatadogTagToStages < ActiveRecord::Migration[4.2]
3 | def change
4 | change_table :stages do |t|
5 | t.string :datadog_tags
6 | end
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/plugins/datadog/db/migrate/20150309212516_add_datadog_monitor_id_to_stage.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddDatadogMonitorIdToStage < ActiveRecord::Migration[4.2]
3 | def change
4 | change_table :stages do |t|
5 | t.string :datadog_monitor_ids, limit: 255
6 | end
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/plugins/datadog/db/migrate/20190621145446_remove_old_datadog_ids_column.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class RemoveOldDatadogIdsColumn < ActiveRecord::Migration[5.2]
3 | def change
4 | remove_column :stages, :datadog_monitor_ids
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/datadog/db/migrate/20190621175829_add_rollback_to_datadog_monitors.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddRollbackToDatadogMonitors < ActiveRecord::Migration[5.2]
3 | def change
4 | add_column :datadog_monitor_queries, :rollback_on_alert, :boolean, null: false, default: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/datadog/db/migrate/20190626012607_rename_rollback_on_failure.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class RenameRollbackOnFailure < ActiveRecord::Migration[5.2]
3 | def change
4 | rename_column :datadog_monitor_queries, :rollback_on_alert, :fail_deploy_on_alert
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/datadog/db/migrate/20190626163916_add_scoping_to_datadog_monitors.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddScopingToDatadogMonitors < ActiveRecord::Migration[5.2]
3 | def change
4 | add_column :datadog_monitor_queries, :match_target, :string
5 | add_column :datadog_monitor_queries, :match_source, :string
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/datadog/db/migrate/20190627154835_add_failure_options_to_datadog.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddFailureOptionsToDatadog < ActiveRecord::Migration[5.2]
3 | def change
4 | remove_column :datadog_monitor_queries, :fail_deploy_on_alert
5 | add_column :datadog_monitor_queries, :failure_behavior, :string
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/datadog/db/migrate/20190627175546_add_datadog_check_duration_min.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddDatadogCheckDurationMin < ActiveRecord::Migration[5.2]
3 | def change
4 | add_column :datadog_monitor_queries, :check_duration, :integer
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/datadog/db/migrate/20190627211709_remove_deprecated_monitor_stage_id.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class RemoveDeprecatedMonitorStageId < ActiveRecord::Migration[5.2]
3 | def change
4 | remove_column :datadog_monitor_queries, :stage_id
5 | add_index :datadog_monitor_queries, [:scope_id, :scope_type], length: {scope_type: 100}
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/datadog/decorators/deploy_decorator.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Deploy.class_eval do
3 | attr_accessor :datadog_monitors_for_validation
4 | end
5 |
--------------------------------------------------------------------------------
/plugins/datadog/decorators/project_decorator.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Project.class_eval do
3 | include AcceptsDatadogMonitorQueries
4 | alias_method :all_datadog_monitor_queries, :datadog_monitor_queries
5 | end
6 |
--------------------------------------------------------------------------------
/plugins/datadog/decorators/stage_decorator.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Stage.class_eval do
3 | include AcceptsDatadogMonitorQueries
4 |
5 | def datadog_tags_as_array
6 | datadog_tags.to_s.split(";").each(&:strip!)
7 | end
8 |
9 | private
10 |
11 | def all_datadog_monitor_queries
12 | project.datadog_monitor_queries + datadog_monitor_queries
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/plugins/datadog/samson_datadog.gemspec:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Gem::Specification.new "samson_datadog", "0.0.0" do |s|
3 | s.summary = "Samson Datadog integration"
4 | s.authors = ["Michael Grosser"]
5 | s.email = "mgrosser@zendesk.com"
6 | s.add_runtime_dependency 'faraday'
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/datadog/test/decorators/deploy_decorator_test.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative '../test_helper'
3 |
4 | SingleCov.covered!
5 |
6 | describe Deploy do
7 | let(:deploy) { Deploy.new }
8 |
9 | it "can assign datadog_monitors_for_rollback" do
10 | deploy.datadog_monitors_for_validation = 1
11 | deploy.datadog_monitors_for_validation.must_equal 1
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/plugins/datadog/test/decorators/project_decorator_test.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative '../test_helper'
3 |
4 | SingleCov.covered!
5 |
6 | describe Project do
7 | it "has datadog_monitor_queries" do
8 | Project.new.datadog_monitor_queries
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/plugins/datadog/test/test_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative '../../../test/test_helper'
3 |
--------------------------------------------------------------------------------
/plugins/datadog_tracer/README.md:
--------------------------------------------------------------------------------
1 | # Datadog Plugin
2 |
3 | Plugin that trace requests and notify to Datadog APM
4 |
--------------------------------------------------------------------------------
/plugins/datadog_tracer/samson_datadog_tracer.gemspec:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Gem::Specification.new 'samson_datadog_tracer', '0.0.1' do |s|
3 | s.summary = 'Samson Datadog tracer plugin'
4 | s.authors = ['Sathish Subramanian']
5 | s.email = ['ssubramanian@zendesk.com']
6 | s.files = Dir['{config,lib}/**/*']
7 |
8 | s.add_runtime_dependency 'datadog', '~> 2'
9 | end
10 |
--------------------------------------------------------------------------------
/plugins/datadog_tracer/test/test_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative '../../../test/test_helper'
3 |
--------------------------------------------------------------------------------
/plugins/env/app/assets/stylesheets/env/application.css:
--------------------------------------------------------------------------------
1 | .external-env-group-links {
2 | padding: 7px 0px 7px 7px;
3 | width: 5.3%;
4 | }
5 |
--------------------------------------------------------------------------------
/plugins/env/app/models/concerns/scopes_environment_variables.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | module ScopesEnvironmentVariables
3 | def self.included(base)
4 | base.class_eval do
5 | has_many :scoped_environment_variables, as: :scope, dependent: :destroy, class_name: 'EnvironmentVariable'
6 | end
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/plugins/env/app/models/project_environment_variable_group.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class ProjectEnvironmentVariableGroup < ActiveRecord::Base
3 | belongs_to :project, inverse_of: :project_environment_variable_groups
4 | belongs_to :environment_variable_group, inverse_of: :project_environment_variable_groups
5 | end
6 |
--------------------------------------------------------------------------------
/plugins/env/app/views/samson_env/_deploy_changeset_tab_body.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <% if diff = deploy_environment_variable_diff %>
3 | <%= Samson::Diff.text_diff(*diff) %>
4 | <%= Samson::Diff.style_tag %>
5 | <% else %>
6 | No changes.
7 | <% end %>
8 |
9 |
--------------------------------------------------------------------------------
/plugins/env/app/views/samson_env/_deploy_changeset_tab_nav.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 | Environment variables
4 | <% if deploy_environment_variable_diff %>
5 | !
6 | <% end %>
7 |
8 |
9 |
--------------------------------------------------------------------------------
/plugins/env/app/views/samson_env/_deploy_form.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 | Extra Environment Variables for this deploy <%= additional_info SamsonEnv::HELP_TEXT %>
4 |
5 |
6 | <%= render "samson_env/environment_variables_fields",
7 | form: form, environment_variables: @deploy.environment_variables %>
8 |
9 |
--------------------------------------------------------------------------------
/plugins/env/app/views/samson_env/_environment_variables.html.erb:
--------------------------------------------------------------------------------
1 | <% scopes = Environment.env_deploy_group_array %>
2 | <% sorted_env_vars = EnvironmentVariable.sort_by_scopes(form.object.environment_variables, scopes) %>
3 | <%= render "samson_env/environment_variables_fields",
4 | form: form, environment_variables: sorted_env_vars, scopes: scopes %>
5 |
6 |
7 |
--------------------------------------------------------------------------------
/plugins/env/app/views/samson_env/_manage_menu.html.erb:
--------------------------------------------------------------------------------
1 | <%= link_to "Environment variables", environment_variable_groups_path %>
2 |
--------------------------------------------------------------------------------
/plugins/env/app/views/samson_env/_stage_form.html.erb:
--------------------------------------------------------------------------------
1 |
2 |
3 | Extra Environment Variables for this stage <%= additional_info SamsonEnv::HELP_TEXT %>
4 |
5 |
6 | <%= render "samson_env/environment_variables_fields",
7 | form: form, environment_variables: @stage.environment_variables %>
8 |
9 |
--------------------------------------------------------------------------------
/plugins/env/db/migrate/20170922174850_expand_env_vars.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class ExpandEnvVars < ActiveRecord::Migration[5.1]
3 | def up
4 | change_column :environment_variables, :value, :string, limit: 2048
5 | end
6 |
7 | def down
8 | change_column :environment_variables, :value, :string, limit: 255
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/plugins/env/db/migrate/20180329204838_add_env_state_to_deploy.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddEnvStateToDeploy < ActiveRecord::Migration[5.1]
4 | def change
5 | add_column :deploys, :env_state, :text
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/env/db/migrate/20180528222146_delete_deploy_env_vars.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class DeleteDeployEnvVars < ActiveRecord::Migration[5.2]
3 | class Audit < ActiveRecord::Base
4 | end
5 |
6 | def change
7 | deploy_vars = EnvironmentVariable.where(parent_type: "Deploy").pluck(:id)
8 | Audit.where(auditable_type: "EnvironmentVariable", auditable_id: deploy_vars).delete_all
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/plugins/env/db/migrate/20180802182824_bump_env_state_size.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class BumpEnvStateSize < ActiveRecord::Migration[5.2]
4 | def change
5 | change_column :deploys, :env_state, :text, limit: 16777215
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/env/db/migrate/20181023212711_add_use_env_repo_to_project.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddUseEnvRepoToProject < ActiveRecord::Migration[5.2]
4 | def change
5 | add_column :projects, :use_env_repo, :boolean, default: false, null: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/env/db/migrate/20190513171548_add_config_service_to_project.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddConfigServiceToProject < ActiveRecord::Migration[5.2]
3 | def change
4 | add_column :projects, :config_service, :boolean, default: false, null: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/env/db/migrate/20191113043345_add_owners_to_env_groups.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddOwnersToEnvGroups < ActiveRecord::Migration[5.2]
3 | def change
4 | add_column :environment_variable_groups, :owners, :string
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/env/db/migrate/20200109202014_remove_config_service_from_projects.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class RemoveConfigServiceFromProjects < ActiveRecord::Migration[6.0]
3 | def change
4 | remove_column :projects, :config_service
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/env/db/migrate/20200402190202_add_external_url_to_env_groups.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddExternalUrlToEnvGroups < ActiveRecord::Migration[6.0]
3 | def change
4 | add_column :environment_variable_groups, :external_url, :string
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/env/db/migrate/20200402195119_remove_env_repo.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class RemoveEnvRepo < ActiveRecord::Migration[6.0]
3 | def change
4 | remove_column :projects, :use_env_repo
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/env/decorators/deploy_group_decorator.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | DeployGroup.include ScopesEnvironmentVariables
3 |
--------------------------------------------------------------------------------
/plugins/env/decorators/environment_decorator.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Environment.include ScopesEnvironmentVariables
3 |
--------------------------------------------------------------------------------
/plugins/env/decorators/stage_decorator.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Stage.class_eval do
3 | include AcceptsEnvironmentVariables
4 | end
5 |
--------------------------------------------------------------------------------
/plugins/env/test/decorators/deploy_group_decorator_test.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative '../test_helper'
3 |
4 | SingleCov.covered!
5 |
6 | describe DeployGroup do
7 | it "has scoped_environment_variables" do
8 | deploy_groups(:pod100).scoped_environment_variables.must_equal []
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/plugins/env/test/decorators/environment_decorator_test.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative '../test_helper'
3 |
4 | SingleCov.covered!
5 |
6 | describe Environment do
7 | it "has scoped_environment_variables" do
8 | environments(:production).scoped_environment_variables.must_equal []
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/plugins/env/test/decorators/stage_decorator_test.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require_relative '../test_helper'
4 |
5 | SingleCov.covered!
6 |
7 | describe Stage do
8 | it "accepts environment_variables" do
9 | stage = Stage.new(environment_variables_attributes: {0 => {name: "Foo", value: "bar"}})
10 | stage.environment_variables.map(&:name).must_equal ["Foo"]
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/plugins/env/test/models/project_environment_variable_group_test.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative "../test_helper"
3 |
4 | SingleCov.covered!
5 |
6 | describe ProjectEnvironmentVariableGroup do
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/env/test/test_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative '../../../test/test_helper'
3 |
--------------------------------------------------------------------------------
/plugins/flowdock/README.md:
--------------------------------------------------------------------------------
1 | Flowdock notification.
2 |
--------------------------------------------------------------------------------
/plugins/flowdock/app/controllers/flowdock_controller.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require 'flowdock'
3 |
4 | class FlowdockController < ApplicationController
5 | def notify
6 | @deploy = Deploy.find(params.require(:deploy_id))
7 | FlowdockNotification.new(@deploy).buddy_request(params.require(:message))
8 | head :ok
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/plugins/flowdock/app/models/flowdock_flow.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class FlowdockFlow < ActiveRecord::Base
3 | belongs_to :stage, inverse_of: :flowdock_flows
4 | end
5 |
--------------------------------------------------------------------------------
/plugins/flowdock/config/routes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Samson::Application.routes.draw do
3 | post '/flowdock/notify', to: 'flowdock#notify'
4 | end
5 |
--------------------------------------------------------------------------------
/plugins/flowdock/db/migrate/20140113010124_create_flowdock_flows.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class CreateFlowdockFlows < ActiveRecord::Migration[4.2]
3 | def change
4 | create_table :flowdock_flows do |t|
5 | t.string :name, null: false
6 | t.string :token, null: false
7 | t.integer :stage_id, null: false
8 |
9 | t.timestamps
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/plugins/flowdock/db/migrate/20150302060556_engine_migration.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class EngineMigration < ActiveRecord::Migration[4.2]
3 | def change
4 | # does nothing but we will see it execute
5 | change_column_null :users, :name, false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/flowdock/db/migrate/20150327144239_add_flowdock_checkbox_to_flowdock_flows.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddFlowdockCheckboxToFlowdockFlows < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :flowdock_flows, :enabled, :boolean, default: true
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/flowdock/db/migrate/20160929164311_remove_3_state_booleans_p2.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class Remove3StateBooleansP2 < ActiveRecord::Migration[5.0]
3 | def change
4 | change_column_null :flowdock_flows, :enabled, false, false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/flowdock/samson_flowdock.gemspec:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Gem::Specification.new 'samson_flowdock', '0.0.0' do |s|
3 | s.summary = 'Samson flowdock integration'
4 | s.authors = ['Michael Grosser', 'Fabio Neves']
5 | s.email = ['michael@grosser.it', 'fneves@zendesk.com']
6 | s.add_runtime_dependency 'flowdock'
7 | s.files = Dir['{app,config,db,lib}/**/*']
8 | end
9 |
--------------------------------------------------------------------------------
/plugins/flowdock/test/models/flowdock_flow_test.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative '../test_helper'
3 |
4 | SingleCov.covered!
5 |
6 | describe FlowdockFlow do
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/flowdock/test/test_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative '../../../test/test_helper'
3 |
--------------------------------------------------------------------------------
/plugins/gcloud/app/models/gke_cluster.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class GkeCluster
4 | include ActiveModel::Model
5 |
6 | attr_accessor(
7 | :gcp_project,
8 | :cluster_name,
9 | :zone
10 | )
11 |
12 | validates :gcp_project, presence: true
13 | validates :cluster_name, presence: true
14 | validates :zone, presence: true
15 | end
16 |
--------------------------------------------------------------------------------
/plugins/gcloud/app/views/samson_gcloud/_build_button.html.erb:
--------------------------------------------------------------------------------
1 | <% if !@build.docker_repo_digest && @build.gcr_id %>
2 | <%= link_to "Sync with GCB", sync_build_gcloud_path(@build), data: {method: :post}, class: "btn btn-default" %>
3 | <% end %>
4 |
--------------------------------------------------------------------------------
/plugins/gcloud/config/routes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Samson::Application.routes.draw do
3 | resources :gcloud, only: [] do
4 | member do
5 | post :sync_build
6 | end
7 | end
8 | resources :gke_clusters, only: [:new, :create]
9 | end
10 |
--------------------------------------------------------------------------------
/plugins/gcloud/db/migrate/20171110221726_add_build_with_gcb_to_project.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddBuildWithGcbToProject < ActiveRecord::Migration[5.1]
3 | def change
4 | add_column :projects, :build_with_gcb, :boolean, default: false, null: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/gcloud/db/migrate/20190111195416_remove_scan_result_cache_col.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class RemoveScanResultCacheCol < ActiveRecord::Migration[5.2]
4 | def change
5 | remove_column :builds, :gcr_vulnerabilities_status_id, :integer, default: 0, null: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/gcloud/decorators/build_decorator.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Build.class_eval do
3 | def gcr_id
4 | external_url.to_s[%r{/gcr/builds/([a-f\d-]+)}, 1]
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/gcloud/decorators/project_decorator.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Project.class_eval do
3 | validate :validate_not_using_gcb_and_external
4 |
5 | private
6 |
7 | def validate_not_using_gcb_and_external
8 | return unless build_with_gcb && docker_image_building_disabled
9 | errors.add(:build_with_gcb, "cannot be enabled when Docker images are built externally")
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/plugins/gcloud/gcloud.gemspec:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Gem::Specification.new "gcloud_image_tagger", "0.0.0" do |s|
3 | s.summary = "Tags gcloud images with the stage permalink on deploy"
4 | s.authors = [""]
5 | s.email = ""
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/gcloud/test/test_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative '../../../test/test_helper'
3 |
--------------------------------------------------------------------------------
/plugins/github/README.md:
--------------------------------------------------------------------------------
1 | Github integration.
2 |
3 | - comments on PRs when they are deployed
4 | - adds deployment for each commit that is deployed via Github deployment api
5 |
--------------------------------------------------------------------------------
/plugins/github/db/migrate/20140319001623_add_github_confirmation_to_stages.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddGithubConfirmationToStages < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :stages, :update_github_pull_requests, :boolean
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/github/db/migrate/20190403185409_add_git_hub_pull_request_comment_to_stages.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddGitHubPullRequestCommentToStages < ActiveRecord::Migration[5.2]
3 | def change
4 | add_column :stages, :github_pull_request_comment, :string
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/github/samson_github.gemspec:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Gem::Specification.new "samson_github", "0.0.0" do |s|
3 | s.summary = "Samson Github integration"
4 | s.authors = ["Michael Grosser"]
5 | s.email = "mgrosser@zendesk.com"
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/github/test/test_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative '../../../test/test_helper'
3 |
--------------------------------------------------------------------------------
/plugins/gitlab/samson_gitlab.gemspec:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Gem::Specification.new 'samson_gitlab', '0.0.0' do |s|
3 | s.summary = 'Samson gitlab plugin'
4 | s.authors = ['Igor Sharshun']
5 | s.email = ['igorsharshun@gmail.com']
6 | s.files = Dir['{app,config,db,lib}/**/*']
7 |
8 | s.add_runtime_dependency 'git_diff_parser'
9 | s.add_runtime_dependency 'gitlab'
10 | end
11 |
--------------------------------------------------------------------------------
/plugins/gitlab/test/test_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative '../../../test/test_helper'
3 |
--------------------------------------------------------------------------------
/plugins/jenkins/README.md:
--------------------------------------------------------------------------------
1 | Start and track jenkins jobs after deploys.
2 |
--------------------------------------------------------------------------------
/plugins/jenkins/app/models/jenkins_job.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class JenkinsJob < ActiveRecord::Base
3 | belongs_to :deploy, inverse_of: :jenkins_jobs
4 | end
5 |
--------------------------------------------------------------------------------
/plugins/jenkins/db/migrate/20150318215604_add_jenkins_jobs_to_stage.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddJenkinsJobsToStage < ActiveRecord::Migration[4.2]
3 | def change
4 | change_table :stages do |t|
5 | t.string :jenkins_job_names
6 | end
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/plugins/jenkins/db/migrate/20150519000042_add_url_to_jenkins_jobs.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddUrlToJenkinsJobs < ActiveRecord::Migration[4.2]
3 | def change
4 | change_table :jenkins_jobs do |t|
5 | t.string :url
6 | end
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/plugins/jenkins/db/migrate/20150529162928_make_jenkins_job_id_allow_null.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class MakeJenkinsJobIdAllowNull < ActiveRecord::Migration[4.2]
3 | def change
4 | change_column_null :jenkins_jobs, :jenkins_job_id, true
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/jenkins/db/migrate/20170616174952_delete_jenkins_versions.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class DeleteJenkinsVersions < ActiveRecord::Migration[5.1]
3 | class Version < ActiveRecord::Base
4 | self.table_name = 'versions'
5 | end
6 |
7 | def change
8 | Version.where(item_type: 'JenkinsJob').delete_all
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/plugins/jenkins/decorators/deploy_decorator.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Deploy.class_eval do
3 | has_many :jenkins_jobs, dependent: nil
4 | end
5 |
--------------------------------------------------------------------------------
/plugins/jenkins/samson_jenkins.gemspec:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Gem::Specification.new "samson_jenkins", "0.0.0" do |s|
3 | s.summary = "Samson jenkins integration"
4 | s.authors = ["Rupinder Dhanoa "]
5 | s.email = "rdhanoa@zendesk.com"
6 | s.add_runtime_dependency "jenkins_api_client", "~> 2.0"
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/jenkins/test/decorators/deploy_decorator_test.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative '../test_helper'
3 |
4 | SingleCov.covered!
5 |
6 | describe Deploy do
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/jenkins/test/models/jenkins_job_test.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative '../test_helper'
3 |
4 | SingleCov.covered!
5 |
6 | describe JenkinsJob do
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/jenkins/test/test_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative '../../../test/test_helper'
3 |
--------------------------------------------------------------------------------
/plugins/jenkins_status_checker/app/views/samson_jenkins_status_checker/_project_form_checkbox.html.erb:
--------------------------------------------------------------------------------
1 | <% if ENV['JENKINS_STATUS_CHECKER'] %>
2 | <%= form.input :jenkins_status_checker, label: 'Show Jenkins Status on new deploy page', as: :check_box %>
3 | <% end %>
4 |
--------------------------------------------------------------------------------
/plugins/jenkins_status_checker/db/migrate/20180327005536_add_jenkins_status_checker.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddJenkinsStatusChecker < ActiveRecord::Migration[5.1]
3 | def change
4 | add_column :projects, :jenkins_status_checker, :boolean, default: false, null: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/jenkins_status_checker/samson_jenkins_status_checker.gemspec:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Gem::Specification.new 'samson_jenkins_status_checker', '0.0.0' do |s|
3 | s.summary = 'Samson Jenkins Status Checker plugin'
4 | s.authors = ['Yi Fei Wu']
5 | s.email = ['ywu@zendesk.com']
6 | s.files = Dir['{app,config,db,lib}/**/*']
7 | s.add_runtime_dependency "jenkins_api_client", "~> 2.0"
8 | end
9 |
--------------------------------------------------------------------------------
/plugins/jenkins_status_checker/test/test_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative '../../../test/test_helper'
3 |
--------------------------------------------------------------------------------
/plugins/jira/app/views/samson_jira/_project_form.html.erb:
--------------------------------------------------------------------------------
1 | <% if ENV["JIRA_USER"] %>
2 |
3 |
4 | JIRA
5 |
6 |
7 | <%= form.input :jira_issue_prefix, label: "JIRA Issue Prefix", help: "Issue prefix to transition on deploy, (i.e. FOO-123 -> FOO)" %>
8 |
9 | <% end %>
10 |
--------------------------------------------------------------------------------
/plugins/jira/app/views/samson_jira/_stage_form.html.erb:
--------------------------------------------------------------------------------
1 | <% if @project.jira_issue_prefix? %>
2 |
3 |
4 | JIRA
5 |
6 |
7 | <%= form.input :jira_transition_id, label: "JIRA Transition ID", help: "Transition to perform on deployed jira issues (list of transitions #{SamsonJira.jira_base_url}/rest/api/3/issue//transitions)" %>
8 |
9 | <% end %>
10 |
--------------------------------------------------------------------------------
/plugins/jira/db/migrate/20190731123954_add_jira_fields.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddJiraFields < ActiveRecord::Migration[5.2]
3 | def change
4 | add_column :projects, :jira_issue_prefix, :string
5 | add_column :stages, :jira_transition_id, :string
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/jira/samson_jira.gemspec:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Gem::Specification.new "samson_jira", "0.0.0" do |s|
3 | s.summary = "Samson jira integration"
4 | s.authors = ["Michael Grosser"]
5 | s.email = "michael@grosser.it"
6 | s.add_runtime_dependency "faraday"
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/jira/test/test_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative '../../../test/test_helper'
3 |
--------------------------------------------------------------------------------
/plugins/kubernetes/app/assets/images/kubernetes/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/samson/db8bad2b146c24de29c73dfddc48bec1c527549a/plugins/kubernetes/app/assets/images/kubernetes/icon.png
--------------------------------------------------------------------------------
/plugins/kubernetes/app/assets/stylesheets/kubernetes/application.scss:
--------------------------------------------------------------------------------
1 | /*
2 | Kubernetes screen
3 | */
4 |
5 | .kubernetes-section {
6 | margin-top: 0 !important;
7 | padding: 0 !important;
8 | .nav-tabs {
9 | border-bottom: 1px solid #f5f5f5;
10 | padding: 0 10px 0 15px;
11 | background-color: #fcfcfc;
12 | }
13 | }
14 |
15 |
16 |
--------------------------------------------------------------------------------
/plugins/kubernetes/app/models/kubernetes/stage_role.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Kubernetes
4 | class StageRole < ActiveRecord::Base
5 | self.table_name = 'kubernetes_stage_roles'
6 |
7 | belongs_to :kubernetes_role, class_name: 'Kubernetes::Role', inverse_of: :stage_roles
8 | belongs_to :stage, inverse_of: :kubernetes_stage_roles
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/plugins/kubernetes/app/views/kubernetes/clusters/_deploy_group_list.html.erb:
--------------------------------------------------------------------------------
1 | <% deploy_groups.each do |dg| %>
2 | <%= link_to dg.name, dg %>
3 | (ns: <%= dg.kubernetes_namespace %>)
4 |
5 | <% end %>
6 |
--------------------------------------------------------------------------------
/plugins/kubernetes/app/views/kubernetes/clusters/edit.html.erb:
--------------------------------------------------------------------------------
1 | <%= page_title "Edit Kubernetes Cluster" %>
2 | <%= render 'form' %>
3 |
--------------------------------------------------------------------------------
/plugins/kubernetes/app/views/kubernetes/clusters/new.html.erb:
--------------------------------------------------------------------------------
1 | <%= page_title "New Kubernetes Cluster" %>
2 | <%= render 'form' %>
3 |
--------------------------------------------------------------------------------
/plugins/kubernetes/app/views/kubernetes/deploy_group_roles/edit.html.erb:
--------------------------------------------------------------------------------
1 | <%= render template: "kubernetes/deploy_group_roles/show" %>
2 |
--------------------------------------------------------------------------------
/plugins/kubernetes/app/views/kubernetes/deploy_group_roles/new.html.erb:
--------------------------------------------------------------------------------
1 | <%= render template: "kubernetes/deploy_group_roles/show" %>
2 |
--------------------------------------------------------------------------------
/plugins/kubernetes/app/views/kubernetes/namespaces/new.html.erb:
--------------------------------------------------------------------------------
1 | <%= page_title "New Kubernetes Namespace" %>
2 | <%= breadcrumb Kubernetes::Namespace, "New" %>
3 | <%= render 'form' %>
4 |
--------------------------------------------------------------------------------
/plugins/kubernetes/app/views/kubernetes/namespaces/show.html.erb:
--------------------------------------------------------------------------------
1 | <%= page_title "Edit Kubernetes Namespace" %>
2 | <%= breadcrumb Kubernetes::Namespace, @kubernetes_namespace %>
3 | <%= render 'form' %>
4 |
--------------------------------------------------------------------------------
/plugins/kubernetes/app/views/kubernetes/roles/edit.html.erb:
--------------------------------------------------------------------------------
1 | <%= render template: "kubernetes/roles/show" %>
2 |
--------------------------------------------------------------------------------
/plugins/kubernetes/app/views/kubernetes/roles/new.html.erb:
--------------------------------------------------------------------------------
1 | <%= render template: "kubernetes/roles/show" %>
2 |
--------------------------------------------------------------------------------
/plugins/kubernetes/app/views/kubernetes/roles/show.html.erb:
--------------------------------------------------------------------------------
1 | <%= render 'projects/header', project: @project, tab: 'kubernetes' %>
2 |
3 |
4 | <%= render 'samson_kubernetes/role_navigation' %>
5 |
6 | <% title = (@kubernetes_role.new_record? ? "New Kubernetes Role" : "Kubernetes Role #{@kubernetes_role.name}") %>
7 | <%= page_title title, in_tab: true %>
8 | <%= render 'form' %>
9 |
10 |
--------------------------------------------------------------------------------
/plugins/kubernetes/app/views/kubernetes/usage_limits/edit.html.erb:
--------------------------------------------------------------------------------
1 | <%= render template: "kubernetes/usage_limits/show" %>
2 |
--------------------------------------------------------------------------------
/plugins/kubernetes/app/views/kubernetes/usage_limits/new.html.erb:
--------------------------------------------------------------------------------
1 | <%= render template: "kubernetes/usage_limits/show" %>
2 |
--------------------------------------------------------------------------------
/plugins/kubernetes/app/views/samson_kubernetes/_deploy_changeset_tab_nav.html.erb:
--------------------------------------------------------------------------------
1 | <% if @deploy&.persisted? ? @deploy.kubernetes? : @stage&.kubernetes? %>
2 | Manifests
3 | <% end %>
4 |
--------------------------------------------------------------------------------
/plugins/kubernetes/app/views/samson_kubernetes/_deploy_group_table_cell.html.erb:
--------------------------------------------------------------------------------
1 | <%= link_to(deploy_group.kubernetes_cluster.name, kubernetes_cluster_path(deploy_group.kubernetes_cluster)) if deploy_group.kubernetes_cluster %>
2 |
--------------------------------------------------------------------------------
/plugins/kubernetes/app/views/samson_kubernetes/_deploy_group_table_header.html.erb:
--------------------------------------------------------------------------------
1 | Kubernetes Cluster
2 |
--------------------------------------------------------------------------------
/plugins/kubernetes/app/views/samson_kubernetes/_manage_menu.html.erb:
--------------------------------------------------------------------------------
1 | <%= link_to "Kubernetes Clusters", kubernetes_clusters_path %>
2 | <%= link_to "Kubernetes Resources", kubernetes_deploy_group_roles_path %>
3 | <%= link_to "Kubernetes Limits", kubernetes_usage_limits_path %>
4 | <%= link_to "Kubernetes Namespaces", kubernetes_namespaces_path %>
5 |
--------------------------------------------------------------------------------
/plugins/kubernetes/app/views/samson_kubernetes/_project_tabs_view.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= link_to project_kubernetes_roles_path(project), style: 'padding-top: 10px; padding-bottom: 10px' do %>
3 | <%= image_tag('kubernetes/icon.png', height: '30px') %>
4 | <% end %>
5 |
6 |
--------------------------------------------------------------------------------
/plugins/kubernetes/db/migrate/20150827181056_create_kubernetes_cluster.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class CreateKubernetesCluster < ActiveRecord::Migration[4.2]
3 | def change
4 | create_table :kubernetes_clusters do |t|
5 | t.string :name
6 | t.string :description
7 | t.string :config_filepath
8 | t.string :config_context
9 | t.timestamps
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/plugins/kubernetes/db/migrate/20150902221719_create_kubernetes_release_groups.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class CreateKubernetesReleaseGroups < ActiveRecord::Migration[4.2]
3 | def change
4 | create_table :kubernetes_release_groups do |t|
5 | t.references :build, null: false, index: true
6 | t.references :user
7 | t.text :comment
8 | t.timestamps
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/plugins/kubernetes/db/migrate/20151014202234_add_live_replicas_to_kuber_release_doc.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddLiveReplicasToKuberReleaseDoc < ActiveRecord::Migration[4.2]
3 | def change
4 | change_table :kubernetes_release_docs do |t|
5 | t.rename :replica_count, :replica_target
6 | t.integer :replicas_live, after: :replica_target, null: false, default: 0
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/plugins/kubernetes/db/migrate/20151014205641_set_kuber_release_default_status.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class SetKuberReleaseDefaultStatus < ActiveRecord::Migration[4.2]
3 | def change
4 | change_column :kubernetes_releases, :status, :string, default: 'created'
5 | change_column :kubernetes_release_docs, :status, :string, default: 'created'
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/kubernetes/db/migrate/20151116174240_add_soft_delete_to_kubernetes_role.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddSoftDeleteToKubernetesRole < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :kubernetes_roles, :deleted_at, :datetime
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/kubernetes/db/migrate/20160426223230_add_kuberetes_to_stage.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddKuberetesToStage < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :deploys, :kubernetes, :boolean, default: false, null: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/kubernetes/db/migrate/20160503162523_really_add_kubernetes_to_staging.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class ReallyAddKubernetesToStaging < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :stages, :kubernetes, :boolean, default: false, null: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/kubernetes/db/migrate/20160509225637_make_kubernetes_services_unique.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class MakeKubernetesServicesUnique < ActiveRecord::Migration[4.2]
3 | def change
4 | add_index :kubernetes_roles, [:service_name, :deleted_at], unique: true, length: {service_name: 191}
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/kubernetes/db/migrate/20160512204809_add_deploy_to_kubernetes_release.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddDeployToKubernetesRelease < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :kubernetes_releases, :deploy_id, :integer
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/kubernetes/db/migrate/20160627191312_nilify_service_names.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class NilifyServiceNames < ActiveRecord::Migration[4.2]
3 | class KubernetesRole < ActiveRecord::Base
4 | end
5 |
6 | def up
7 | KubernetesRole.where(service_name: "").update_all(service_name: nil)
8 | end
9 |
10 | def down
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/plugins/kubernetes/db/migrate/20160627212913_remove_deploy_strategy.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class RemoveDeployStrategy < ActiveRecord::Migration[4.2]
3 | def change
4 | remove_column :kubernetes_roles, :deploy_strategy, :string, null: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/kubernetes/db/migrate/20160629232753_add_generated_template_to_release_docs.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddGeneratedTemplateToReleaseDocs < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :kubernetes_release_docs, :resource_template, :text
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/kubernetes/db/migrate/20160715165508_add_kubernetes_build_column.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddKubernetesBuildColumn < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :builds, :kubernetes_job, :boolean, default: false, null: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/kubernetes/db/migrate/20161007231901_add_ip_prefix_to_kubernetes_cluster.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddIpPrefixToKubernetesCluster < ActiveRecord::Migration[5.0]
3 | def change
4 | add_column :kubernetes_clusters, :ip_prefix, :string
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/kubernetes/db/migrate/20170102212707_add_flat_to_allow_build_reuse.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddFlatToAllowBuildReuse < ActiveRecord::Migration[5.0]
3 | def change
4 | add_column :deploys, :kubernetes_reuse_build, :boolean, default: false, null: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/kubernetes/db/migrate/20171101121933_remove_kubernetes_job.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class RemoveKubernetesJob < ActiveRecord::Migration[5.1]
3 | def change
4 | remove_column :builds, :kubernetes_job, :boolean, default: false, null: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/kubernetes/db/migrate/20171215200538_add_comments_to_limits.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddCommentsToLimits < ActiveRecord::Migration[5.1]
3 | def change
4 | add_column :kubernetes_usage_limits, :comment, :string, limit: 512
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/kubernetes/db/migrate/20171226184349_add_autoscaled_to_kubernetes_deploy_group_roles.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddAutoscaledToKubernetesDeployGroupRoles < ActiveRecord::Migration[5.1]
3 | def change
4 | add_column :kubernetes_roles, :autoscaled, :boolean, null: false, default: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/kubernetes/db/migrate/20180112113400_add_blue_green.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddBlueGreen < ActiveRecord::Migration[5.1]
3 | def change
4 | add_column :kubernetes_roles, :blue_green, :boolean, default: false, null: false
5 | add_column :kubernetes_releases, :blue_green_color, :string
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/kubernetes/db/migrate/20180125203849_add_delete_resource_to_deploy_group_roles.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddDeleteResourceToDeployGroupRoles < ActiveRecord::Migration[5.1]
3 | def change
4 | add_column :kubernetes_deploy_group_roles, :delete_resource, :boolean, default: false, null: false
5 | add_column :kubernetes_release_docs, :delete_resource, :boolean, default: false, null: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/kubernetes/db/migrate/20180626154722_add_no_limit_to_deploy_group_roles.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddNoLimitToDeployGroupRoles < ActiveRecord::Migration[5.2]
3 | def change
4 | add_column :kubernetes_deploy_group_roles, :no_cpu_limit, :boolean, default: false, null: false
5 | add_column :kubernetes_release_docs, :no_cpu_limit, :boolean, default: false, null: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/kubernetes/db/migrate/20190109161216_add_kubernetes_stage_roles.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddKubernetesStageRoles < ActiveRecord::Migration[5.2]
4 | def change
5 | create_table :kubernetes_stage_roles do |t|
6 | t.column :stage_id, :integer, null: false
7 | t.column :kubernetes_role_id, :integer, null: false
8 | t.column :ignored, :boolean, null: false, default: false
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/plugins/kubernetes/db/migrate/20190124171921_bump_limit.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class BumpLimit < ActiveRecord::Migration[5.2]
4 | def change
5 | change_column :kubernetes_release_docs, :resource_template, :text, limit: 1073741823 # 1G, max size with 4 byte
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/kubernetes/db/migrate/20190508231523_add_rollout_timeout_to_projects.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddRolloutTimeoutToProjects < ActiveRecord::Migration[5.2]
3 | def change
4 | add_column :projects, :kubernetes_rollout_timeout, :integer
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/kubernetes/db/migrate/20190514231932_allow_nil_kubernetes_roles_resource_name.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AllowNilKubernetesRolesResourceName < ActiveRecord::Migration[5.2]
3 | def change
4 | change_column_null :kubernetes_roles, :resource_name, true
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/kubernetes/db/migrate/20190528173915_add_kritis_breakglass.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddKritisBreakglass < ActiveRecord::Migration[5.2]
3 | def change
4 | add_column :kubernetes_clusters, :kritis_breakglass, :boolean, default: false, null: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/kubernetes/db/migrate/20190714235744_add_sample_logs_to_stages.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddSampleLogsToStages < ActiveRecord::Migration[5.2]
3 | def change
4 | add_column :stages, :kubernetes_sample_logs_on_success, :boolean, default: false, null: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/kubernetes/db/migrate/20190822232319_add_kubernetes_hide_logs_flag.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddKubernetesHideLogsFlag < ActiveRecord::Migration[5.2]
3 | def change
4 | add_column :stages, :kubernetes_hide_error_logs, :boolean, default: false, null: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/kubernetes/db/migrate/20190919212707_add_kubernetes_ignore_vulnerabilities_to_deploys.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddKubernetesIgnoreVulnerabilitiesToDeploys < ActiveRecord::Migration[5.2]
3 | def change
4 | add_column :deploys, :kubernetes_ignore_kritis_vulnerabilities, :boolean, default: false, null: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/kubernetes/db/migrate/20191022023140_add_istio_inject_column.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddIstioInjectColumn < ActiveRecord::Migration[5.2]
3 | def change
4 | add_column :kubernetes_deploy_group_roles, :inject_istio_annotation, :boolean, default: false, null: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/kubernetes/db/migrate/20191030151254_add_template_to_kubernetes_namespaces.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddTemplateToKubernetesNamespaces < ActiveRecord::Migration[5.2]
3 | def change
4 | add_column :kubernetes_namespaces, :template, :text
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/kubernetes/db/migrate/20200827172257_remove_kubernetes_ip_prefix.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class RemoveKubernetesIpPrefix < ActiveRecord::Migration[6.0]
3 | def change
4 | remove_column :kubernetes_clusters, :ip_prefix, :string
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/kubernetes/decorators/deploy_decorator.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Deploy.class_eval do
3 | has_one :kubernetes_release, class_name: 'Kubernetes::Release', dependent: nil
4 |
5 | before_create :copy_kubernetes_from_stage
6 |
7 | private
8 |
9 | def copy_kubernetes_from_stage
10 | self.kubernetes = stage&.kubernetes
11 | nil
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/plugins/kubernetes/samson_kubernetes.gemspec:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Gem::Specification.new 'samson_kubernetes', '0.0.1' do |s|
3 | s.description = s.summary = 'Allow deploying projects using Kubernetes'
4 | s.authors = ['Jon Moter', 'Maciek Sufa', 'Sergio Nunes', 'Shane Hender']
5 | s.email = 'jmoter@zendesk.com'
6 | s.add_runtime_dependency 'kubeclient'
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/kubernetes/test/cluster_config.yml:
--------------------------------------------------------------------------------
1 | users: []
2 | clusters:
3 | - name: test-cluster
4 | cluster:
5 | server: http://foobar.server
6 |
7 | apiVersion: 'v1'
8 | current-context: test
9 | contexts:
10 | - name: test
11 | context:
12 | cluster: test-cluster
13 |
--------------------------------------------------------------------------------
/plugins/kubernetes/test/decorators/deploy_groups_controller_decorator_test.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative '../test_helper'
3 |
4 | SingleCov.covered! uncovered: 4
5 |
6 | describe DeployGroupsController do
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/kubernetes/test/fixtures/kubernetes/cluster_deploy_groups.yml:
--------------------------------------------------------------------------------
1 | pod1:
2 | deploy_group: pod1
3 | cluster: test_cluster
4 | namespace: pod1
5 |
6 | pod2:
7 | deploy_group: pod2
8 | cluster: test_cluster
9 | namespace: pod2
10 |
--------------------------------------------------------------------------------
/plugins/kubernetes/test/fixtures/kubernetes/clusters.yml:
--------------------------------------------------------------------------------
1 | test_cluster:
2 | name: test
3 | description: test cluster
4 | config_filepath: plugins/kubernetes/test/cluster_config.yml
5 | config_context: test
6 |
--------------------------------------------------------------------------------
/plugins/kubernetes/test/fixtures/kubernetes/namespaces.yml:
--------------------------------------------------------------------------------
1 | test:
2 | name: test
3 | comment: test cluster
4 | template: "metadata:\n labels:\n team: foo"
5 |
--------------------------------------------------------------------------------
/plugins/kubernetes/test/fixtures/kubernetes/release_docs.yml:
--------------------------------------------------------------------------------
1 | test_release_pod_1:
2 | kubernetes_role: app_server
3 | kubernetes_release: test_release
4 | deploy_group: pod1
5 | replica_target: 2
6 | resource_template: '{"kind":"Deployment", "metadata":{"name":"app-server", "namespace":"pod1"}}'
7 |
--------------------------------------------------------------------------------
/plugins/kubernetes/test/fixtures/kubernetes/releases.yml:
--------------------------------------------------------------------------------
1 | test_release:
2 | user: deployer
3 | project: test
4 | git_sha: 1a6f551a2ffa6d88e15eef5461384da0bfb1c194
5 | git_ref: master
6 | deploy: succeeded_test
7 |
--------------------------------------------------------------------------------
/plugins/kubernetes/test/fixtures/kubernetes/roles.yml:
--------------------------------------------------------------------------------
1 | app_server:
2 | project: test
3 | name: app-server
4 | config_file: 'kubernetes/app_server.yml'
5 | resource_name: test-app-server
6 |
7 | resque_worker:
8 | project: test
9 | name: resque-worker
10 | config_file: 'kubernetes/resque_worker.yml'
11 | resource_name: test-resque-worker
12 |
--------------------------------------------------------------------------------
/plugins/kubernetes/test/models/kubernetes/stage_role_test.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative "../../test_helper"
3 |
4 | SingleCov.covered!
5 |
6 | describe Kubernetes::StageRole do
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/kubernetes/test/samples/kubernetes_invalid_role_config_file.yml:
--------------------------------------------------------------------------------
1 | ---
2 | apiVersion: v1
3 | kind: Service
4 | metadata:
5 | name: some-project
6 | labels:
7 | project: some-project
8 | spec:
9 | ports:
10 | - port: 80
11 | targetPort: some-role-port
12 | selector:
13 | project: some-project
14 | role: some-role
15 | type: LoadBalancer
16 |
--------------------------------------------------------------------------------
/plugins/ledger/README.md:
--------------------------------------------------------------------------------
1 | # Ledger Plugin
2 |
3 | Plugin that allows samson to post events to ledger (an internal Zendesk system)
4 |
5 | Requires 2 ENV vars to be set in order to work
6 | LEDGER_BASE_URL="https://ledger.mydomain.com" # base url of the ledger api host (http or https)
7 | LEDGER_TOKEN="thisismytoken" # api access token for that system
8 |
--------------------------------------------------------------------------------
/plugins/ledger/lib/samson_ledger/samson_plugin.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | module SamsonLedger
3 | class SamsonPlugin < Rails::Engine
4 | end
5 | end
6 |
7 | callback = ->(deploy, _) do
8 | SamsonLedger::Client.post_deployment(deploy)
9 | end
10 | Samson::Hooks.callback :before_deploy, &callback
11 | Samson::Hooks.callback :after_deploy, &callback
12 |
--------------------------------------------------------------------------------
/plugins/ledger/samson_ledger.gemspec:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Gem::Specification.new 'samson_ledger', '0.0.1' do |s|
3 | s.summary = 'client to allow posting events to ledger (internal zendesk system)'
4 | s.description = s.summary
5 | s.authors = ['ian Waters']
6 | s.email = 'iwaters@zendesk.com'
7 | s.add_runtime_dependency 'faraday'
8 | end
9 |
--------------------------------------------------------------------------------
/plugins/ledger/test/test_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative '../../../test/test_helper'
3 |
--------------------------------------------------------------------------------
/plugins/new_relic/README.md:
--------------------------------------------------------------------------------
1 | - Display newrelic graphs during/after deploy, with `NEW_RELIC_API_KEY`
2 | - Add Newrelic instrumentation, with `NEW_RELIC_LICENSE_KEY`
3 |
--------------------------------------------------------------------------------
/plugins/new_relic/app/helpers/new_relic_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | module NewRelicHelper
3 | def newrelic_enabled_for_deploy?
4 | SamsonNewRelic.enabled? && @deploy.persisted? && @deploy.stage.new_relic_applications.any?
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/new_relic/app/models/new_relic_application.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class NewRelicApplication < ActiveRecord::Base
3 | belongs_to :stage, inverse_of: :new_relic_applications
4 | end
5 |
--------------------------------------------------------------------------------
/plugins/new_relic/app/views/samson_new_relic/_deploy_changeset_tab_body.html.erb:
--------------------------------------------------------------------------------
1 | <% if newrelic_enabled_for_deploy? %>
2 |
3 |
4 |
Response Time
5 |
6 |
7 |
8 |
12 |
13 | <% end %>
14 |
--------------------------------------------------------------------------------
/plugins/new_relic/app/views/samson_new_relic/_deploy_changeset_tab_nav.html.erb:
--------------------------------------------------------------------------------
1 | <% if newrelic_enabled_for_deploy? %>
2 |
3 |
7 | New Relic
8 |
9 |
10 | <% end %>
11 |
--------------------------------------------------------------------------------
/plugins/new_relic/config/routes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Samson::Application.routes.draw do
3 | resources :projects, only: [] do
4 | resources :stages do
5 | get :new_relic, to: 'new_relic#show'
6 | end
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/plugins/new_relic/db/migrate/20140131005054_add_stage_new_relic_applications.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddStageNewRelicApplications < ActiveRecord::Migration[4.2]
3 | def change
4 | create_table :new_relic_applications do |t|
5 | t.string :name
6 | t.belongs_to :stage
7 | t.index [:stage_id, :name], unique: true, length: {name: 191}
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/plugins/new_relic/decorators/stage_decorator.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Stage.class_eval do
3 | has_many :new_relic_applications, dependent: :destroy
4 | accepts_nested_attributes_for :new_relic_applications, allow_destroy: true, reject_if: :no_newrelic_name?
5 |
6 | private
7 |
8 | def no_newrelic_name?(newrelic_attrs)
9 | newrelic_attrs['name'].blank?
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/plugins/new_relic/samson_new_relic.gemspec:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Gem::Specification.new "samson_new_relic", "0.0.0" do |s|
3 | s.summary = "Samson NewRelic integration"
4 | s.authors = ["Michael Grosser"]
5 | s.email = "mgrosser@zendesk.com"
6 | s.add_runtime_dependency "newrelic_rpm"
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/new_relic/test/fixtures/new_relic_applications.yml:
--------------------------------------------------------------------------------
1 | production:
2 | name: RS Production
3 | stage: test_staging
4 |
--------------------------------------------------------------------------------
/plugins/new_relic/test/models/new_relic_application_test.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative '../test_helper'
3 |
4 | SingleCov.covered!
5 |
6 | describe NewRelicApplication do
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/pipelines/README.md:
--------------------------------------------------------------------------------
1 | Pipeline deploys: a succeeded deploy kicks off the next deploy.
2 |
--------------------------------------------------------------------------------
/plugins/pipelines/app/views/samson_pipelines/_stage_form.html.erb:
--------------------------------------------------------------------------------
1 |
2 | Pipelining
3 | Set the stages that will get automatically deployed after this one.
4 | <%= render_collection_check_boxes :stage, :next_stage_ids, @project.stages - [@stage] %>
5 |
6 |
--------------------------------------------------------------------------------
/plugins/pipelines/db/migrate/20150602113621_add_next_stage_to_stages.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddNextStageToStages < ActiveRecord::Migration[4.2]
3 | def change
4 | change_table :stages do |t|
5 | t.string :next_stage_ids
6 | end
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/plugins/pipelines/db/migrate/20180510172630_add_pipelined_to_deploys.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddPipelinedToDeploys < ActiveRecord::Migration[5.1]
4 | def change
5 | add_reference :deploys, :triggering_deploy, foreign_key: {to_table: :deploys}, type: :integer
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/pipelines/decorators/deploy_decorator.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | Deploy.class_eval do
4 | belongs_to :triggering_deploy, class_name: 'Deploy', optional: true, inverse_of: false
5 | end
6 |
--------------------------------------------------------------------------------
/plugins/pipelines/samson_pipelines.gemspec:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Gem::Specification.new 'samson_pipelines', '0.0.0' do |s|
3 | s.summary = 'Samson Pipelines plugin'
4 | s.authors = ['Shane Hender']
5 | s.email = ['shender@zendesk.com']
6 | s.files = Dir['{app,config,db,lib}/**/*']
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/pipelines/test/test_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative '../../../test/test_helper'
3 |
--------------------------------------------------------------------------------
/plugins/prerequisite_stages/README.md:
--------------------------------------------------------------------------------
1 | # Prerequisite Stages
2 |
3 | Allows users to enforce that a reference has been deployed to a stage's prerequisite stages before it is allowed to be deployed.
4 |
--------------------------------------------------------------------------------
/plugins/prerequisite_stages/app/views/samson_prerequisite_stages/_stage_form.html.erb:
--------------------------------------------------------------------------------
1 |
2 | Prerequisite Stages
3 | Set the stages that must be deployed before this one for a particular reference.
4 | <%= render_collection_check_boxes :stage, :prerequisite_stage_ids, @project.stages - [@stage] %>
5 |
6 |
--------------------------------------------------------------------------------
/plugins/prerequisite_stages/db/migrate/20180723163626_add_prerequisite_stage_ids_to_stages.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddPrerequisiteStageIdsToStages < ActiveRecord::Migration[5.2]
4 | def change
5 | add_column :stages, :prerequisite_stage_ids, :string
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/prerequisite_stages/samson_prerequisite_stages.gemspec:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | Gem::Specification.new 'samson_prerequisite_stages', '0.0.0' do |s|
4 | s.summary = 'Samson PrerequisiteStages plugin'
5 | s.authors = ['Ryan Gurney']
6 | s.email = ['rygurney@zendesk.com']
7 | s.files = Dir['{app,config,db,lib}/**/*']
8 | end
9 |
--------------------------------------------------------------------------------
/plugins/prerequisite_stages/test/test_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require_relative '../../../test/test_helper'
4 |
--------------------------------------------------------------------------------
/plugins/rollbar/README.md:
--------------------------------------------------------------------------------
1 | # Rollbar Plugin
2 |
3 | Plugin that notifies Rollbar of errors
4 |
--------------------------------------------------------------------------------
/plugins/rollbar/samson_rollbar.gemspec:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | Gem::Specification.new 'samson_rollbar', '0.0.0' do |s|
4 | s.summary = 'Samson Rollbar plugin'
5 | s.authors = ['Ryan Gurney']
6 | s.email = ['rygurney@zendesk.com']
7 | s.files = Dir['{app,config,db,lib}/**/*']
8 |
9 | s.add_runtime_dependency 'rollbar'
10 | s.add_runtime_dependency 'rollbar-user_informer'
11 | end
12 |
--------------------------------------------------------------------------------
/plugins/rollbar/test/test_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require_relative '../../../test/test_helper'
4 |
--------------------------------------------------------------------------------
/plugins/rollbar_dashboards/README.md:
--------------------------------------------------------------------------------
1 | # Rollbar Dashboards Plugin
2 |
3 | A plugin which displays the top Rollbar items for projects and deploys.
4 |
--------------------------------------------------------------------------------
/plugins/rollbar_dashboards/app/assets/images/rollbar_dashboards/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/samson/db8bad2b146c24de29c73dfddc48bec1c527549a/plugins/rollbar_dashboards/app/assets/images/rollbar_dashboards/icon.png
--------------------------------------------------------------------------------
/plugins/rollbar_dashboards/app/assets/stylesheets/rollbar_dashboards/application.css:
--------------------------------------------------------------------------------
1 | .dashboard-container {
2 | margin-bottom: 20px;
3 | }
4 |
5 | .rollbar-table {
6 | table-layout: fixed;
7 | width: 100%;
8 | }
9 |
10 | .rollbar-table__count {
11 | width: 10%;
12 | }
13 |
14 | .rollbar-table__title {
15 | text-overflow: ellipsis;
16 | white-space: nowrap;
17 | overflow: hidden;
18 | width: 90%;
19 | max-width: 90%;
20 | }
21 |
--------------------------------------------------------------------------------
/plugins/rollbar_dashboards/app/views/rollbar_dashboards/_item.html.erb:
--------------------------------------------------------------------------------
1 |
2 | <%= item[:occurrences] %> x
3 | <%= rollbar_item_link(item[:title], item[:counter], dashboard_setting) %>
4 |
5 |
--------------------------------------------------------------------------------
/plugins/rollbar_dashboards/app/views/samson_rollbar_dashboards/_deploy_show_view.html.erb:
--------------------------------------------------------------------------------
1 | <% if deploy.succeeded? && (settings = deploy.project.rollbar_dashboards_settings.presence) %>
2 | <%# replaced by responsive_load.js.erb %>
3 | <%= rollbar_lazy_load_dashboard_container deploy_dashboard_deploy_rollbar_dashboards_dashboards_path(deploy), settings %>
4 | <% end %>
5 |
--------------------------------------------------------------------------------
/plugins/rollbar_dashboards/app/views/samson_rollbar_dashboards/_project_dashboard.html.erb:
--------------------------------------------------------------------------------
1 | <% if settings = @project.rollbar_dashboards_settings.presence %>
2 | <%= rollbar_lazy_load_dashboard_container project_dashboard_project_rollbar_dashboards_dashboards_path(@project), settings %>
3 | <% end %>
4 |
--------------------------------------------------------------------------------
/plugins/rollbar_dashboards/db/migrate/20180607172824_add_account_and_project_name_to_rollbar_dashboards_settings.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddAccountAndProjectNameToRollbarDashboardsSettings < ActiveRecord::Migration[5.2]
4 | def change
5 | add_column :rollbar_dashboards_settings, :account_and_project_name, :string
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/rollbar_dashboards/decorators/project_decorator.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | Project.class_eval do
4 | has_many :rollbar_dashboards_settings, class_name: 'RollbarDashboards::Setting', dependent: :destroy
5 |
6 | accepts_nested_attributes_for :rollbar_dashboards_settings, allow_destroy: true, reject_if: ->(a) do
7 | a.fetch(:base_url).blank? && a.fetch(:read_token).blank?
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/plugins/rollbar_dashboards/samson_rollbar_dashboards.gemspec:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | Gem::Specification.new 'samson_rollbar_dashboards', '0.0.0' do |s|
4 | s.summary = 'Samson RollbarDashboards plugin'
5 | s.authors = ['Ryan Gurney']
6 | s.email = ['rygurney@zendesk.com']
7 | s.files = Dir['{app,config,db,lib}/**/*']
8 | end
9 |
--------------------------------------------------------------------------------
/plugins/rollbar_dashboards/test/test_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require_relative '../../../test/test_helper'
4 |
--------------------------------------------------------------------------------
/plugins/rollbar_hook/decorators/stage_decorator.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Stage.class_eval do
3 | has_many :rollbar_webhooks, dependent: :destroy
4 | accepts_nested_attributes_for :rollbar_webhooks, allow_destroy: true, reject_if: ->(a) {
5 | a.fetch(:webhook_url).blank?
6 | }
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/rollbar_hook/samson_rollbar_hook.gemspec:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Gem::Specification.new 'samson_rollbar_hook', '0.0.0' do |s|
3 | s.summary = 'Samson Rollbar Hook plugin'
4 | s.authors = ['Henrik Jorgensen']
5 | s.email = ['hjorgensen@zendesk.com']
6 | s.files = Dir['{app,config,db,lib}/**/*']
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/rollbar_hook/test/test_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative '../../../test/test_helper'
3 |
--------------------------------------------------------------------------------
/plugins/sentry/samson_sentry.gemspec:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Gem::Specification.new 'samson_sentry', '0.0.0' do |s|
3 | s.summary = 'Samson Sentry plugin'
4 | s.authors = ['zendesk-mattlefevre']
5 | s.email = ['matthew.lefevre@zendesk.com']
6 | s.files = Dir['{app,config,db,lib}/**/*']
7 |
8 | s.add_runtime_dependency 'sentry-rails'
9 | s.add_runtime_dependency 'sentry-user_informer'
10 | end
11 |
--------------------------------------------------------------------------------
/plugins/sentry/test/test_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require_relative '../../../test/test_helper'
4 |
--------------------------------------------------------------------------------
/plugins/slack_app/app/models/samson_slack_app/deploy_response_url.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | module SamsonSlackApp
3 | class DeployResponseUrl < ActiveRecord::Base
4 | belongs_to :deploy, inverse_of: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/slack_app/app/models/samson_slack_app/slack_identifier.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | module SamsonSlackApp
3 | class SlackIdentifier < ActiveRecord::Base
4 | belongs_to :user, optional: true, inverse_of: false
5 |
6 | def self.app_token
7 | SlackIdentifier.find_by_user_id(nil)&.identifier
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/plugins/slack_app/config/routes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Samson::Application.routes.draw do
3 | get '/slack_app/oauth', to: 'slack_app#oauth'
4 | post '/slack_app/command', to: 'slack_app#command'
5 | post '/slack_app/interact', to: 'slack_app#interact'
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/slack_app/db/migrate/20160709001231_create_slack_app_table.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class CreateSlackAppTable < ActiveRecord::Migration[4.2]
3 | def change
4 | create_table :slack_identifiers do |t|
5 | t.integer :user_id
6 | t.text :identifier, null: false
7 |
8 | t.timestamps null: false
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/plugins/slack_app/db/migrate/20160711222417_create_deploy_response_url_table.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class CreateDeployResponseUrlTable < ActiveRecord::Migration[4.2]
3 | def change
4 | create_table :deploy_response_urls do |t|
5 | t.integer :deploy_id, null: false
6 | t.string :response_url, null: false
7 |
8 | t.timestamps null: false
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/plugins/slack_app/db/migrate/20160717144254_add_samson_app_indices.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddSamsonAppIndices < ActiveRecord::Migration[4.2]
3 | def change
4 | add_index :slack_identifiers, :user_id, unique: true
5 | add_index :slack_identifiers, :identifier, length: 12
6 | add_index :deploy_response_urls, :deploy_id, unique: true
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/plugins/slack_app/lib/samson_slack_app/samson_plugin.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | module SamsonSlackApp
3 | class SamsonPlugin < Rails::Engine
4 | end
5 | end
6 |
7 | callback = ->(deploy, _) { SamsonSlackApp::SlackMessage.new(deploy).deliver }
8 |
9 | Samson::Hooks.callback :before_deploy, &callback
10 | Samson::Hooks.callback :after_deploy, &callback
11 |
--------------------------------------------------------------------------------
/plugins/slack_app/samson_slack_app.gemspec:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Gem::Specification.new 'samson_slack_app', '0.0.0' do |s|
3 | s.summary = 'Samson Slack-app plugin'
4 | s.authors = ['Ben Straub']
5 | s.email = ['bstraub@zendesk.com']
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/slack_app/test/models/samson_slack_app/deploy_response_url_test.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative '../../test_helper'
3 |
4 | SingleCov.covered!
5 |
6 | describe SamsonSlackApp::DeployResponseUrl do
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/slack_app/test/models/samson_slack_app/slack_identifier_test.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative '../../test_helper'
3 |
4 | SingleCov.covered! uncovered: 1
5 |
6 | describe SamsonSlackApp::SlackIdentifier do
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/slack_app/test/test_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative '../../../test/test_helper'
3 |
--------------------------------------------------------------------------------
/plugins/slack_webhooks/README.md:
--------------------------------------------------------------------------------
1 | Notify slack channels before/after deploy/on buddy request.
2 |
3 | Additionally allows all requests to be sent to a single channel with `SLACK_GLOBAL_BUDDY_REQUEST`, see `.env.example`.
4 |
--------------------------------------------------------------------------------
/plugins/slack_webhooks/config/routes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Samson::Application.routes.draw do
3 | post '/slack_webhooks/notify/:deploy_id', to: 'slack_webhooks#buddy_request', as: :slack_webhooks_notify
4 | end
5 |
--------------------------------------------------------------------------------
/plugins/slack_webhooks/db/migrate/20151123184501_create_slack_webhooks.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class CreateSlackWebhooks < ActiveRecord::Migration[4.2]
3 | def change
4 | create_table :slack_webhooks do |t|
5 | t.text :webhook_url, null: false
6 | t.string :channel
7 | t.integer :stage_id, null: false
8 |
9 | t.timestamps
10 | end
11 |
12 | add_index :slack_webhooks, :stage_id
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/plugins/slack_webhooks/db/migrate/20161013175858_add_only_on_failure_to_slack_webhooks.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddOnlyOnFailureToSlackWebhooks < ActiveRecord::Migration[5.0]
3 | def change
4 | add_column :slack_webhooks, :only_on_failure, :boolean, default: false, null: false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/slack_webhooks/db/migrate/20170310020151_make_checkboxes_off_by_default.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class MakeCheckboxesOffByDefault < ActiveRecord::Migration[5.0]
3 | def change
4 | change_column_default :slack_webhooks, :after_deploy, false
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/slack_webhooks/db/migrate/20170418183047_reorganize_slack_buddy.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class ReorganizeSlackBuddy < ActiveRecord::Migration[5.0]
3 | def change
4 | rename_column :slack_webhooks, :for_buddy, :buddy_box
5 | add_column :slack_webhooks, :buddy_request, :boolean, default: false, null: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/slack_webhooks/decorators/stage_decorator.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Stage.class_eval do
3 | has_many :slack_webhooks, dependent: :destroy
4 | accepts_nested_attributes_for :slack_webhooks, allow_destroy: true, reject_if: ->(a) { a.fetch(:webhook_url).blank? }
5 | end
6 |
--------------------------------------------------------------------------------
/plugins/slack_webhooks/samson_slack_webhooks.gemspec:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Gem::Specification.new "samson_slack_webhooks", "0.0.0" do |s|
3 | s.summary = "Samson slack integration"
4 | s.authors = ['Akash Manohar']
5 | s.email = 'akash@akash.im'
6 | s.add_runtime_dependency 'faraday'
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/slack_webhooks/test/test_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative '../../../test/test_helper'
3 |
--------------------------------------------------------------------------------
/plugins/zendesk/README.md:
--------------------------------------------------------------------------------
1 | Update a zendesk ticket after deploy.
2 |
--------------------------------------------------------------------------------
/plugins/zendesk/app/views/samson_zendesk/_stage_form.html.erb:
--------------------------------------------------------------------------------
1 |
2 | Zendesk
3 | <%= form.input :comment_on_zendesk_tickets, as: :check_box, label: "Add comment on a Zendesk ticket after deployment" %>
4 |
5 |
--------------------------------------------------------------------------------
/plugins/zendesk/app/views/samson_zendesk/notification.erb:
--------------------------------------------------------------------------------
1 | A fix to <%= deploy.project.name %> for this issue has been deployed to <%= deploy.stage.name %>. Deploy details: [<%= deploy.short_reference %>] (<%= url %>)
2 |
3 | **Related Commits:**
4 |
5 | <% commits.each do |commit| %>
6 | <% if commit.summary.match(/ZD#?#{ticket_id}/i) %>
7 | * [<%= commit.summary %>] (<%= commit.url %>) (<%= commit.author_name %>)
8 | <% end %>
9 | <% end %>
10 |
11 |
--------------------------------------------------------------------------------
/plugins/zendesk/db/migrate/20140410213058_add_zendesk_confirmation_to_stages.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | class AddZendeskConfirmationToStages < ActiveRecord::Migration[4.2]
3 | def change
4 | add_column :stages, :comment_on_zendesk_tickets, :boolean
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/plugins/zendesk/samson_zendesk.gemspec:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | Gem::Specification.new "samson_zendesk", "0.0.0" do |s|
3 | s.summary = "Samson zendesk integration"
4 | s.authors = ["Michael Grosser"]
5 | s.email = "michael@grosser.it"
6 | s.add_runtime_dependency "zendesk_api"
7 | end
8 |
--------------------------------------------------------------------------------
/plugins/zendesk/test/test_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative '../../../test/test_helper'
3 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/zendesk/samson/db8bad2b146c24de29c73dfddc48bec1c527549a/public/favicon.ico
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
2 | #
3 | # To ban all spiders from the entire site uncomment the next two lines:
4 | # User-agent: *
5 | # Disallow: /
6 |
--------------------------------------------------------------------------------
/test/fixtures/commands.yml:
--------------------------------------------------------------------------------
1 | echo:
2 | command: echo hello
3 | project: test
4 |
5 | global:
6 | command: echo global
7 |
--------------------------------------------------------------------------------
/test/fixtures/csv_exports.yml:
--------------------------------------------------------------------------------
1 | pending:
2 | user: viewer
3 | status: pending
4 | filters: '{}'
5 |
--------------------------------------------------------------------------------
/test/fixtures/deploy_groups.yml:
--------------------------------------------------------------------------------
1 | pod1:
2 | name: Pod1
3 | name_sortable: Pod00001
4 | env_value: pod1
5 | environment: production
6 | permalink: pod1
7 |
8 | pod2:
9 | name: Pod2
10 | name_sortable: Pod00002
11 | env_value: pod2
12 | environment: production
13 | permalink: pod2
14 |
15 | pod100:
16 | name: Pod 100
17 | name_sortable: Pod00100
18 | env_value: pod100
19 | environment: staging
20 | permalink: pod100
21 |
--------------------------------------------------------------------------------
/test/fixtures/environments.yml:
--------------------------------------------------------------------------------
1 | production:
2 | name: Production
3 | production: true
4 | permalink: production
5 |
6 | staging:
7 | name: Staging
8 | production: false
9 | permalink: staging
10 |
--------------------------------------------------------------------------------
/test/fixtures/projects.yml:
--------------------------------------------------------------------------------
1 | test:
2 | name: Foo
3 | repository_url: ssh://git@github.com:bar/foo.git
4 | token: kanyewest
5 | permalink: foo
6 | include_new_deploy_groups: true
7 |
8 | other:
9 | name: Bar
10 | repository_url: ssh://git@github.com:bar/bar.git
11 | token: othertoken
12 | permalink: bar
13 |
--------------------------------------------------------------------------------
/test/fixtures/releases.yml:
--------------------------------------------------------------------------------
1 | test:
2 | project: test
3 | commit: abcdabcdabcdabcdabcdabcdabcdabcdabcdabcd
4 | number: "123"
5 | author: deployer
6 |
--------------------------------------------------------------------------------
/test/fixtures/stage_commands.yml:
--------------------------------------------------------------------------------
1 | test_staging_echo:
2 | stage: test_staging
3 | command: echo
4 |
5 | test_production_echo:
6 | stage: test_production
7 | command: echo
8 |
--------------------------------------------------------------------------------
/test/fixtures/user_project_roles.yml:
--------------------------------------------------------------------------------
1 | project_admin:
2 | user: project_admin
3 | project: test
4 | role_id: <%= Role::ADMIN.id %>
5 |
6 | project_deployer:
7 | user: project_deployer
8 | project: test
9 | role_id: <%= Role::DEPLOYER.id %>
10 |
--------------------------------------------------------------------------------
/test/helpers/jobs_helper_test.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative '../test_helper'
3 |
4 | SingleCov.covered!
5 |
6 | describe JobsHelper do
7 | include StatusHelper
8 |
9 | describe '#job_page_title' do
10 | it "renders" do
11 | @project = projects(:test)
12 | @job = jobs(:succeeded_test)
13 | job_page_title.must_equal "Foo deploy (succeeded)"
14 | end
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/test/lib/samson/integration_test.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative '../../test_helper'
3 |
4 | SingleCov.covered!
5 |
6 | describe Samson::Integration do
7 | end
8 |
--------------------------------------------------------------------------------
/test/lib/samson/output_utils_test.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require_relative '../../test_helper'
4 |
5 | SingleCov.covered!
6 |
7 | describe Samson::OutputUtils do
8 | describe '.timestamp' do
9 | it 'returns a formatted timestamp' do
10 | freeze_time
11 | Samson::OutputUtils.timestamp.must_equal '[04:05:06]'
12 | end
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/test/lib/samson/secrets_test.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative '../../test_helper'
3 |
4 | SingleCov.covered!
5 |
6 | describe Samson::Secrets do
7 | it "uses relative_model_naming" do
8 | assert Samson::Secrets.use_relative_model_naming?
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/test/mailers/application_mailer_test.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative '../test_helper'
3 |
4 | SingleCov.covered!
5 |
6 | describe ApplicationMailer do
7 | end
8 |
--------------------------------------------------------------------------------
/test/models/concerns/searchable_test.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative '../../test_helper'
3 |
4 | SingleCov.covered! uncovered: 5
5 |
6 | describe Searchable do
7 | end
8 |
--------------------------------------------------------------------------------
/test/models/deploy_build_test.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative '../test_helper'
3 |
4 | SingleCov.covered!
5 |
6 | describe DeployBuild do
7 | # uncovered
8 | end
9 |
--------------------------------------------------------------------------------
/test/models/role_test.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | require_relative '../test_helper'
3 |
4 | SingleCov.covered!
5 |
6 | describe Role do
7 | describe "#display_name" do
8 | it "looks nice" do
9 | Role::ADMIN.display_name.must_equal "Admin"
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/test/support/must_equal_nil.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 | # https://github.com/seattlerb/minitest/issues/666
3 | Object.prepend(
4 | Module.new do
5 | def must_equal(*args)
6 | if args.first.nil?
7 | must_be_nil(*args[1..])
8 | else
9 | super
10 | end
11 | end
12 | end
13 | )
14 |
--------------------------------------------------------------------------------