Skip to content

Latest commit

 

History

History
55 lines (55 loc) · 1.06 KB

hooks.md

File metadata and controls

55 lines (55 loc) · 1.06 KB
[
  {
    "id": "deploy-mywebsite",
    "execute-command": "/usr/share/hooks/mywebsite/deploy.sh",
    "command-working-directory": "/var/www/mywebsite/app/",
    "pass-arguments-to-command":
    [
      {
        "source": "payload",
        "name": "head_commit.id"
      },
      {
        "source": "payload",
        "name": "mywebsite"
      },
      {
        "source": "payload",
        "name": "[email protected]"
      }
    ],
    "response-message": "Déploiement…",
    "trigger-rule":
    {
      "and":
      [
        {
          "match":
          {
            "type": "payload-hash-sha1",
            "secret": "SECRET_PHRASE",
            "parameter":
            {
              "source": "header",
              "name": "X-Hub-Signature"
            }
          }
        },
        {
          "match":
          {
            "type": "value",
            "value": "refs/heads/main",
            "parameter":
            {
              "source": "payload",
              "name": "ref"
            }
          }
        }
      ]
    }
  }
]