Skip to content

Commit

Permalink
Merge pull request #131 from zooniverse/static-deploy
Browse files Browse the repository at this point in the history
Apply ingresses via chatops
  • Loading branch information
zwolf authored Jun 2, 2022
2 parents ab7dba7 + 3a1eb71 commit ccc431e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion handlers/deployment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class Deployment < Handler
command: true,
help: { 'rebuild subject-set-search API' => 'Rebuild subject-set-search API with new data' }
)
route(/^apply ingresses/, :apply_ingresses, command: true, help: {"apply ingresses" => "Applies the ingress templates in the static repo"})

# New K8s deployment template
# updates the production release tag on the supplied repo (\s*.(*))
Expand All @@ -34,7 +35,7 @@ class Deployment < Handler
# and in use for all K8s deployed services
route(/^(deploy)\s*(.*)/, :tag_deploy, command: true, help: {"deploy REPO" => "Updates the production-release tag on zooniverse/REPO"})
route(/^(migrate)\s*(.*)/, :tag_migrate, command: true, help: {"migrate REPO" => "Updates the production-migrate tag on zooniverse/REPO"})
route(/^(status\s*all)/, :status_all, command: true, help: {'staus all' => 'Returns the deployment status for all previously deployed $REPO_NAMES.'})
route(/^(status\s*all)/, :status_all, command: true, help: {'status all' => 'Returns the deployment status for all previously deployed $REPO_NAMES.'})
route(/^(status|version)\s+(?!all)(.+)/, :status, command: true, help: {'status REPO_NAME' => 'Returns the state of commits not deployed for the $REPO_NAME.'})
route(/^(history)\s(.+)/, :commit_history, command: true, help: {'history REPO_NAME' => 'Returns the last deployed commit history (max 10) .'})

Expand Down Expand Up @@ -69,6 +70,11 @@ def tag_migrate(response)
response.reply("Deployment tag '#{tag}' was successfully updated for #{repo_name}.")
end

def apply_ingresses(response)
config.github.update_production_ingresses_tag
response.reply("Ingress tag was successfully updated for static.")
end

def status(response)
repo_name = repo_name_without_whitespace(response.matches[0][1])
response.reply(status_response(repo_name))
Expand Down
4 changes: 4 additions & 0 deletions lib/zooniverse_github.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ def update_production_migrate_tag(repo_name)
update_tag(full_repo_name, deploy_ref)
end

def update_production_ingresses_tag
update_tag('zooniverse/static', 'tags/production-ingresses')
end

def get_dependabot_issues(last_repo_listed)
query = last_repo_listed ? query_with_after(last_repo_listed) : query_without_after

Expand Down

0 comments on commit ccc431e

Please sign in to comment.