Permalink
Browse files

Merge pull request #733 from amazeeio/45-skip-deploy

skip deploy take 2
  • Loading branch information...
Schnitzel committed Nov 10, 2018
2 parents e427ea7 + 26fd016 commit c68519ba1dfb7b0851e0feea8134216556e504da
@@ -3,6 +3,7 @@
const { logger } = require('@lagoon/commons/src/local-logging');
const { sendToLagoonLogs } = require('@lagoon/commons/src/logs');
const { createDeployTask } = require('@lagoon/commons/src/tasks');
const R = require('ramda');
import type { WebhookRequestData, deployData, ChannelWrapper, Project } from '../types';
@@ -19,7 +20,7 @@ async function githubPush(webhook: WebhookRequestData, project: Project) {
const branchName = body.ref.toLowerCase().replace('refs/heads/','')
const sha = body.after
const skip_deploy = body.commits[0].message.match(/\[skip deploy\]|\[deploy skip\]/i)
const skip_deploy = R.pathOr('',['head_commit','message'], body).match(/\[skip deploy\]|\[deploy skip\]/i)
const meta = {
branch: branchName,
@@ -3,6 +3,7 @@
const { logger } = require('@lagoon/commons/src/local-logging');
const { sendToLagoonLogs } = require('@lagoon/commons/src/logs');
const { createDeployTask } = require('@lagoon/commons/src/tasks');
const R = require('ramda');
import type { WebhookRequestData, deployData, ChannelWrapper, Project } from '../types';
@@ -19,7 +20,7 @@ async function gitlabPush(webhook: WebhookRequestData, project: Project) {
const branchName = body.ref.toLowerCase().replace('refs/heads/','')
const sha = body.after
const skip_deploy = body.commits[0].message.match(/\[skip deploy\]|\[deploy skip\]/i)
const skip_deploy = R.pathOr('',['commits',0,'message'], body).match(/\[skip deploy\]|\[deploy skip\]/i)
const meta = {
branch: branchName,
@@ -9,4 +9,4 @@
method: POST
follow_redirects: yes
body_format: json
body: '{"ref":"refs/heads/{{ branch }}","before":"d8072aa41afa0e91b89cad0bf68963c56658a66f","after":"{{ git_hash_push }}","created":false,"deleted":false,"forced":false,"base_ref":null,"compare":"https://github.com/AmazeeLabs/amazee_io/compare/d8072aa41afa...05ba8a7269b6","commits":[{"id":"05ba8a7269b626e4f121cc395733cd4498219193","tree_id":"33e62fad073ea78bd2f2f516ae7634bd976587a7","distinct":true,"message":" message is [skip deploy]","timestamp":"2016-12-12T09:01:38-06:00","url":"https://github.com/AmazeeLabs/amazee_io/commit/05ba8a7269b626e4f121cc395733cd4498219193","author":{"name":"Michael Schmid","email":"michael@amazeelabs.com","username":"Schnitzel"},"committer":{"name":"Michael Schmid","email":"michael@amazeelabs.com","username":"Schnitzel"},"added":[],"removed":[],"modified":["themes/beaker/templates/page.html.twig"]}],"head_commit":{"id":"05ba8a7269b626e4f121cc395733cd4498219193","tree_id":"33e62fad073ea78bd2f2f516ae7634bd976587a7","distinct":true,"message":"Revert \"hello worl:d\"\n\nThis reverts commit d8072aa41afa0e91b89cad0bf68963c56658a66f.","timestamp":"2016-12-12T09:01:38-06:00","url":"https://github.com/AmazeeLabs/amazee_io/commit/05ba8a7269b626e4f121cc395733cd4498219193","author":{"name":"Michael Schmid","email":"michael@amazeelabs.com","username":"Schnitzel"},"committer":{"name":"Michael Schmid","email":"michael@amazeelabs.com","username":"Schnitzel"},"added":[],"removed":[],"modified":["themes/beaker/templates/page.html.twig"]},"repository":{"id":57102603,"name":"amazee_io","full_name":"AmazeeLabs/amazee_io","owner":{"name":"AmazeeLabs","email":""},"private":true,"html_url":"https://github.com/AmazeeLabs/amazee_io","description":null,"fork":false,"url":"https://github.com/AmazeeLabs/amazee_io","forks_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/forks","keys_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/teams","hooks_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/hooks","issue_events_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/issues/events{/number}","events_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/events","assignees_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/assignees{/user}","branches_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/branches{/branch}","tags_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/tags","blobs_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/git/refs{/sha}","trees_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/statuses/{sha}","languages_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/languages","stargazers_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/stargazers","contributors_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/contributors","subscribers_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/subscribers","subscription_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/subscription","commits_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/commits{/sha}","git_commits_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/git/commits{/sha}","comments_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/comments{/number}","issue_comment_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/issues/comments{/number}","contents_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/contents/{+path}","compare_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/merges","archive_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/downloads","issues_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/issues{/number}","pulls_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/pulls{/number}","milestones_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/milestones{/number}","notifications_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/labels{/name}","releases_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/releases{/id}","deployments_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/deployments","created_at":1461650975,"updated_at":"2016-04-26T06:10:35Z","pushed_at":1481554905,"git_url":"git://github.com/AmazeeLabs/amazee_io.git","ssh_url":"{{ git_repo_ssh_url }}","clone_url":"https://github.com/AmazeeLabs/amazee_io.git","svn_url":"https://github.com/AmazeeLabs/amazee_io","homepage":null,"size":107137,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"prod","stargazers":0,"master_branch":"prod","organization":"AmazeeLabs"},"pusher":{"name":"Schnitzel","email":"michael@amazeelabs.com"},"organization":{"login":"AmazeeLabs","id":5390584,"url":"https://api.github.com/orgs/AmazeeLabs","repos_url":"https://api.github.com/orgs/AmazeeLabs/repos","events_url":"https://api.github.com/orgs/AmazeeLabs/events","hooks_url":"https://api.github.com/orgs/AmazeeLabs/hooks","issues_url":"https://api.github.com/orgs/AmazeeLabs/issues","members_url":"https://api.github.com/orgs/AmazeeLabs/members{/member}","public_members_url":"https://api.github.com/orgs/AmazeeLabs/public_members{/member}","avatar_url":"https://avatars.githubusercontent.com/u/5390584?v=3","description":""},"sender":{"login":"Schnitzel","id":750999,"avatar_url":"https://avatars.githubusercontent.com/u/750999?v=3","gravatar_id":"","url":"https://api.github.com/users/Schnitzel","html_url":"https://github.com/Schnitzel","followers_url":"https://api.github.com/users/Schnitzel/followers","following_url":"https://api.github.com/users/Schnitzel/following{/other_user}","gists_url":"https://api.github.com/users/Schnitzel/gists{/gist_id}","starred_url":"https://api.github.com/users/Schnitzel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Schnitzel/subscriptions","organizations_url":"https://api.github.com/users/Schnitzel/orgs","repos_url":"https://api.github.com/users/Schnitzel/repos","events_url":"https://api.github.com/users/Schnitzel/events{/privacy}","received_events_url":"https://api.github.com/users/Schnitzel/received_events","type":"User","site_admin":false}}'
body: '{"ref":"refs/heads/{{ branch }}","before":"d8072aa41afa0e91b89cad0bf68963c56658a66f","after":"{{ git_hash_push }}","created":false,"deleted":false,"forced":false,"base_ref":null,"compare":"https://github.com/AmazeeLabs/amazee_io/compare/d8072aa41afa...05ba8a7269b6","commits":[{"id":"05ba8a7269b626e4f121cc395733cd4498219193","tree_id":"33e62fad073ea78bd2f2f516ae7634bd976587a7","distinct":true,"message":" message is [skip deploy]","timestamp":"2016-12-12T09:01:38-06:00","url":"https://github.com/AmazeeLabs/amazee_io/commit/05ba8a7269b626e4f121cc395733cd4498219193","author":{"name":"Michael Schmid","email":"michael@amazeelabs.com","username":"Schnitzel"},"committer":{"name":"Michael Schmid","email":"michael@amazeelabs.com","username":"Schnitzel"},"added":[],"removed":[],"modified":["themes/beaker/templates/page.html.twig"]}],"head_commit":{"id":"05ba8a7269b626e4f121cc395733cd4498219193","tree_id":"33e62fad073ea78bd2f2f516ae7634bd976587a7","distinct":true,"message":" message is [skip deploy].","timestamp":"2016-12-12T09:01:38-06:00","url":"https://github.com/AmazeeLabs/amazee_io/commit/05ba8a7269b626e4f121cc395733cd4498219193","author":{"name":"Michael Schmid","email":"michael@amazeelabs.com","username":"Schnitzel"},"committer":{"name":"Michael Schmid","email":"michael@amazeelabs.com","username":"Schnitzel"},"added":[],"removed":[],"modified":["themes/beaker/templates/page.html.twig"]},"repository":{"id":57102603,"name":"amazee_io","full_name":"AmazeeLabs/amazee_io","owner":{"name":"AmazeeLabs","email":""},"private":true,"html_url":"https://github.com/AmazeeLabs/amazee_io","description":null,"fork":false,"url":"https://github.com/AmazeeLabs/amazee_io","forks_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/forks","keys_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/teams","hooks_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/hooks","issue_events_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/issues/events{/number}","events_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/events","assignees_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/assignees{/user}","branches_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/branches{/branch}","tags_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/tags","blobs_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/git/refs{/sha}","trees_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/statuses/{sha}","languages_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/languages","stargazers_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/stargazers","contributors_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/contributors","subscribers_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/subscribers","subscription_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/subscription","commits_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/commits{/sha}","git_commits_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/git/commits{/sha}","comments_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/comments{/number}","issue_comment_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/issues/comments{/number}","contents_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/contents/{+path}","compare_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/merges","archive_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/downloads","issues_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/issues{/number}","pulls_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/pulls{/number}","milestones_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/milestones{/number}","notifications_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/labels{/name}","releases_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/releases{/id}","deployments_url":"https://api.github.com/repos/AmazeeLabs/amazee_io/deployments","created_at":1461650975,"updated_at":"2016-04-26T06:10:35Z","pushed_at":1481554905,"git_url":"git://github.com/AmazeeLabs/amazee_io.git","ssh_url":"{{ git_repo_ssh_url }}","clone_url":"https://github.com/AmazeeLabs/amazee_io.git","svn_url":"https://github.com/AmazeeLabs/amazee_io","homepage":null,"size":107137,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"prod","stargazers":0,"master_branch":"prod","organization":"AmazeeLabs"},"pusher":{"name":"Schnitzel","email":"michael@amazeelabs.com"},"organization":{"login":"AmazeeLabs","id":5390584,"url":"https://api.github.com/orgs/AmazeeLabs","repos_url":"https://api.github.com/orgs/AmazeeLabs/repos","events_url":"https://api.github.com/orgs/AmazeeLabs/events","hooks_url":"https://api.github.com/orgs/AmazeeLabs/hooks","issues_url":"https://api.github.com/orgs/AmazeeLabs/issues","members_url":"https://api.github.com/orgs/AmazeeLabs/members{/member}","public_members_url":"https://api.github.com/orgs/AmazeeLabs/public_members{/member}","avatar_url":"https://avatars.githubusercontent.com/u/5390584?v=3","description":""},"sender":{"login":"Schnitzel","id":750999,"avatar_url":"https://avatars.githubusercontent.com/u/750999?v=3","gravatar_id":"","url":"https://api.github.com/users/Schnitzel","html_url":"https://github.com/Schnitzel","followers_url":"https://api.github.com/users/Schnitzel/followers","following_url":"https://api.github.com/users/Schnitzel/following{/other_user}","gists_url":"https://api.github.com/users/Schnitzel/gists{/gist_id}","starred_url":"https://api.github.com/users/Schnitzel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Schnitzel/subscriptions","organizations_url":"https://api.github.com/users/Schnitzel/orgs","repos_url":"https://api.github.com/users/Schnitzel/repos","events_url":"https://api.github.com/users/Schnitzel/events{/privacy}","received_events_url":"https://api.github.com/users/Schnitzel/received_events","type":"User","site_admin":false}}'

0 comments on commit c68519b

Please sign in to comment.