Skip to content

Commit 9da2e21

Browse files
author
Shlomi Noach
authored
Merge branch 'master' into add-tls-support
2 parents 1543098 + b12ac78 commit 9da2e21

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

doc/hooks.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ The following variables are available on all hooks:
6969
- `GH_OST_INSPECTED_HOST`
7070
- `GH_OST_EXECUTING_HOST`
7171
- `GH_OST_HOOKS_HINT` - copy of `--hooks-hint` value
72+
- `GH_OST_HOOKS_HINT_OWNER` - copy of `--hooks-hint-owner` value
73+
- `GH_OST_HOOKS_HINT_TOKEN` - copy of `--hooks-hint-token` value
7274
- `GH_OST_DRY_RUN` - whether or not the `gh-ost` run is a dry run
7375

7476
The following variable are available on particular hooks:

go/base/context.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ type MigrationContext struct {
129129
PanicFlagFile string
130130
HooksPath string
131131
HooksHintMessage string
132+
HooksHintOwner string
133+
HooksHintToken string
132134

133135
DropServeSocket bool
134136
ServeSocketFile string

go/cmd/gh-ost/main.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ func main() {
114114

115115
flag.StringVar(&migrationContext.HooksPath, "hooks-path", "", "directory where hook files are found (default: empty, ie. hooks disabled). Hook files found on this path, and conforming to hook naming conventions will be executed")
116116
flag.StringVar(&migrationContext.HooksHintMessage, "hooks-hint", "", "arbitrary message to be injected to hooks via GH_OST_HOOKS_HINT, for your convenience")
117+
flag.StringVar(&migrationContext.HooksHintOwner, "hooks-hint-owner", "", "arbitrary name of owner to be injected to hooks via GH_OST_HOOKS_HINT_OWNER, for your convenience")
118+
flag.StringVar(&migrationContext.HooksHintToken, "hooks-hint-token", "", "arbitrary token to be injected to hooks via GH_OST_HOOKS_HINT_TOKEN, for your convenience")
117119

118120
flag.UintVar(&migrationContext.ReplicaServerId, "replica-server-id", 99999, "server id used by gh-ost process. Default: 99999")
119121

go/logic/hooks.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ func (this *HooksExecutor) applyEnvironmentVariables(extraVariables ...string) [
6464
env = append(env, fmt.Sprintf("GH_OST_INSPECTED_HOST=%s", this.migrationContext.GetInspectorHostname()))
6565
env = append(env, fmt.Sprintf("GH_OST_EXECUTING_HOST=%s", this.migrationContext.Hostname))
6666
env = append(env, fmt.Sprintf("GH_OST_HOOKS_HINT=%s", this.migrationContext.HooksHintMessage))
67+
env = append(env, fmt.Sprintf("GH_OST_HOOKS_HINT_OWNER=%s", this.migrationContext.HooksHintOwner))
68+
env = append(env, fmt.Sprintf("GH_OST_HOOKS_HINT_TOKEN=%s", this.migrationContext.HooksHintToken))
6769
env = append(env, fmt.Sprintf("GH_OST_DRY_RUN=%t", this.migrationContext.Noop))
6870

6971
for _, variable := range extraVariables {

0 commit comments

Comments
 (0)