<commit_before>package code

import (
	"encoding/json"

	"github.com/nanobox-io/nanobox-boxfile"
	"github.com/nanobox-io/nanobox/models"
)

type (
	deploy struct {
		LogvacHost    string         `json:"logvac_host"`
		Platform      string         `json:"platform"`
		Member        map[string]int `json:"member"`
		Component     component      `json:"component"`
		BeforeLive    interface{}    `json:"before_live,omitempty"`
		BeforeLiveAll interface{}    `json:"before_live_all,omitempty"`
		AfterLive     interface{}    `json:"after_live,omitempty"`
		AfterLiveAll  interface{}    `json:"after_live_all,omitempty"`
	}
)

// hookPayload ...
func DeployPayload(appModel *models.App, componentModel *models.Component) string {
	boxfile := boxfile.New([]byte(appModel.DeployedBoxfile))
	// build the payload
	pload := deploy{
		LogvacHost: appModel.LocalIPs["logvac"],
		Platform:   "local",
		Member:     map[string]int{"uid": 1},
		Component: component{
			Name: componentModel.Name,
			UID:  componentModel.Name,
			ID:   componentModel.ID,
		},
		BeforeLive:    boxfile.Node("deploy.config").Node("before_live").Value(componentModel.Name),
		BeforeLiveAll: boxfile.Node("deploy.config").Node("before_live_all").Value(componentModel.Name),
		AfterLive:     boxfile.Node("deploy.config").Node("after_live").Value(componentModel.Name),
		AfterLiveAll:  boxfile.Node("deploy.config").Node("after_live_all").Value(componentModel.Name),
	}

	// turn it into json
	j, err := json.Marshal(pload)
	if err != nil {
		return "{}"
	}
<commit_msg>add deploy_hook_timeout to the deploy hook payload<commit_after>package code

import (
	"encoding/json"

	"github.com/nanobox-io/nanobox-boxfile"
	"github.com/nanobox-io/nanobox/models"
)

type (
	deploy struct {
		LogvacHost         string         `json:"logvac_host"`
		Platform           string         `json:"platform"`
		Member             map[string]int `json:"member"`
		Component          component      `json:"component"`
		BeforeLive         interface{}    `json:"before_live,omitempty"`
		BeforeLiveAll      interface{}    `json:"before_live_all,omitempty"`
		AfterLive          interface{}    `json:"after_live,omitempty"`
		AfterLiveAll       interface{}    `json:"after_live_all,omitempty"`
		DeployHookTimeout  int            `json:"deploy_hook_timeout,omitempty"`
	}
)

// hookPayload ...
func DeployPayload(appModel *models.App, componentModel *models.Component) string {
	boxfile := boxfile.New([]byte(appModel.DeployedBoxfile))
	// build the payload
	pload := deploy{
		LogvacHost: appModel.LocalIPs["logvac"],
		Platform:   "local",
		Member:     map[string]int{"uid": 1},
		Component: component{
			Name: componentModel.Name,
			UID:  componentModel.Name,
			ID:   componentModel.ID,
		},
		BeforeLive:        boxfile.Node("deploy.config").Node("before_live").Value(componentModel.Name),
		BeforeLiveAll:     boxfile.Node("deploy.config").Node("before_live_all").Value(componentModel.Name),
		AfterLive:         boxfile.Node("deploy.config").Node("after_live").Value(componentModel.Name),
		AfterLiveAll:      boxfile.Node("deploy.config").Node("after_live_all").Value(componentModel.Name),
		DeployHookTimeout: boxfile.Node("deploy.config").Node("deploy_hook_timeout"),
	}

	// turn it into json
	j, err := json.Marshal(pload)
	if err != nil {
		return "{}"
	}

{'fraction_non_alphanumeric': 0.14195298372513562, 'fraction_numerical': 0.0006027727546714888, 'mean_word_length': 3.9760119940029983, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4204599', 'n_tokens_mistral': 1122, 'n_tokens_neox': 1036, 'n_words': 173}