vercel.py 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. SIGNATURE = "74b587857986545361e8a4253b74cd6224d34869"
  2. SIGNATURE_NEW = "cecad6333f8652af7d4e9c7b6ad87f1c922a76d3"
  3. SECRET = "AiK52QASLJXmCXX3X9gO2Zyh"
  4. # Old Vercel response
  5. EXAMPLE_DEPLOYMENT_WEBHOOK_RESPONSE_OLD = """
  6. {
  7. "id": "uev_ZfbZKA3Ts2aEa2Cic6t6wSZx",
  8. "ownerId": "cstd1xKmLGVMed0z0f3SHlD2",
  9. "type": "deployment",
  10. "createdAt": 1592335604941,
  11. "payload": {
  12. "deploymentId": "dpl_2p92SueSKLagubfcRtheS3CvmcjK",
  13. "name": "nextjsblog-demo",
  14. "project": "nextjsblog-demo",
  15. "url": "nextjsblog-demo-gogovbsz1.vercel.app",
  16. "projectId": "QmQPfU4xn5APjEsSje4ccPcSJCmVAByA8CDKfZRhYyVPAg",
  17. "plan": "hobby",
  18. "regions": ["sfo1"],
  19. "target": "production",
  20. "alias": ["nextjsblog-demo.now.sh","nextjsblog-demo.meredithanya.vercel.app","nextjsblog-demo-git-master.meredithanya.vercel.app","nextjsblog-demo.meredithanya.now.sh","nextjsblog-demo-git-master.meredithanya.now.sh"],
  21. "type": "LAMBDAS",
  22. "deployment": {
  23. "id": "dpl_2p92SueSKLagubfcRtheS3CvmcjK",
  24. "name": "nextjsblog-demo",
  25. "url": "nextjsblog-demo-gogovbsz1.vercel.app",
  26. "meta": {
  27. "githubDeployment": "1",
  28. "githubOrg": "MeredithAnya",
  29. "githubRepo": "nextjsblog-demo",
  30. "githubCommitOrg": "MeredithAnya",
  31. "githubCommitRepo": "nextjsblog-demo",
  32. "githubCommitRef": "master",
  33. "githubCommitSha": "7488658dfcf24d9b735e015992b316e2a8340d9d",
  34. "githubCommitMessage": "update index.js",
  35. "githubCommitAuthorName": "MeredithAnya",
  36. "githubCommitAuthorLogin": "MeredithAnya"
  37. }
  38. }
  39. },
  40. "region": "now-sfo",
  41. "teamId": null,
  42. "userId": "cstd1xKmLGVMed0z0f3SHlD2"
  43. }
  44. """
  45. # New Vercel response
  46. EXAMPLE_DEPLOYMENT_WEBHOOK_RESPONSE_NEW = """
  47. {
  48. "id": "uev_ZfbZKA3Ts2aEa2Cic6t6wSZ3",
  49. "type": "deployment.created",
  50. "createdAt": 1592335604941,
  51. "payload": {
  52. "project": {
  53. "id": "QmQPfU4xn5APjEsSje4ccPcSJCmVAByA8CDKfZRhYyVPAg"
  54. },
  55. "url": "nextjsblog-demo-new-gogovbsz1.vercel.app",
  56. "plan": "hobby",
  57. "target": "production",
  58. "links": {
  59. "deployment": "https://vercel.com/nextjsblog-demo-new/dpl_2p92SueSKLagubfcRtheS3Cvmcj3",
  60. "project": "https://vercel.com/nextjsblog-demo-new"
  61. },
  62. "alias": ["nextjsblog-demo-new.now.sh","nextjsblog-demo-new.meredithanya.vercel.app","nextjsblog-demo-new-git-master.meredithanya.vercel.app","nextjsblog-demo-new.meredithanya.now.sh","nextjsblog-demo-new-git-master.meredithanya.now.sh"],
  63. "type": "LAMBDAS",
  64. "regions": ["now-sfo"],
  65. "deployment": {
  66. "id": "dpl_2p92SueSKLagubfcRtheS3Cvmcj3",
  67. "name": "nextjsblog-demo-new",
  68. "url": "nextjsblog-demo-new-gogovbsz1.vercel.app",
  69. "meta": {
  70. "githubDeployment": "2",
  71. "githubOrg": "MeredithAnya",
  72. "githubRepo": "nextjsblog-demo-new",
  73. "githubCommitOrg": "MeredithAnya",
  74. "githubCommitRepo": "nextjsblog-demo-new",
  75. "githubCommitRef": "master",
  76. "githubCommitSha": "7488658dfcf24d9b735e015992b316e2a8340d93",
  77. "githubCommitMessage": "update index.js",
  78. "githubCommitAuthorName": "MeredithAnya",
  79. "githubCommitAuthorLogin": "MeredithAnya"
  80. }
  81. },
  82. "user": {
  83. "id": "cstd1xKmLGVMed0z0f3SHlD2"
  84. },
  85. "team": null
  86. }
  87. }
  88. """
  89. DEPLOYMENT_WEBHOOK_NO_COMMITS = """
  90. {
  91. "id": "uev_ZfbZKA3Ts2aEa2Cic6t6wSZx",
  92. "ownerId": "cstd1xKmLGVMed0z0f3SHlD2",
  93. "type": "deployment",
  94. "createdAt": 1592335604941,
  95. "payload": {
  96. "deploymentId": "dpl_2p92SueSKLagubfcRtheS3CvmcjK",
  97. "name": "nextjsblog-demo",
  98. "project": "nextjsblog-demo",
  99. "url": "nextjsblog-demo-gogovbsz1.vercel.app",
  100. "projectId": "QmQPfU4xn5APjEsSje4ccPcSJCmVAByA8CDKfZRhYyVPAg",
  101. "plan": "hobby",
  102. "regions": ["sfo1"],
  103. "target": "production",
  104. "alias": ["nextjsblog-demo.now.sh","nextjsblog-demo.meredithanya.vercel.app","nextjsblog-demo-git-master.meredithanya.vercel.app","nextjsblog-demo.meredithanya.now.sh","nextjsblog-demo-git-master.meredithanya.now.sh"],
  105. "type": "LAMBDAS",
  106. "deployment": {
  107. "id": "dpl_2p92SueSKLagubfcRtheS3CvmcjK",
  108. "name": "nextjsblog-demo",
  109. "url": "nextjsblog-demo-gogovbsz1.vercel.app",
  110. "meta": {}
  111. }
  112. },
  113. "region": "now-sfo",
  114. "teamId": null,
  115. "userId": "cstd1xKmLGVMed0z0f3SHlD2"
  116. }
  117. """
  118. MINIMAL_WEBHOOK = """
  119. {
  120. "type": "deployment",
  121. "payload": {
  122. "project": "nextjsblog-demo",
  123. "url": "nextjsblog-demo-gogovbsz1.vercel.app",
  124. "projectId": "QmQPfU4xn5APjEsSje4ccPcSJCmVAByA8CDKfZRhYyVPAg",
  125. "target": "production",
  126. "deployment": {
  127. "meta": {
  128. "githubCommitSha": "7488658dfcf24d9b735e015992b316e2a8340d9d"
  129. }
  130. }
  131. },
  132. "userId": "cstd1xKmLGVMed0z0f3SHlD2"
  133. }
  134. """