Skip to content

Commit

Permalink
Keep old CI socket path options for change to occur without breaking …
Browse files Browse the repository at this point in the history
…pipelines
  • Loading branch information
clarsonneur committed Nov 12, 2018
1 parent 5f5dbc1 commit 8796fa9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ func (a *Forj) init() {
opts_repotmpl := cli.Opts().Envar("REPOTEMPLATES_REPO").Default(defaultRepoTemplate)
a.w.SetDefault("repotemplate-repo-path", defaultRepoTemplate)
optsDirsPath := cli.Opts().Envar("PLUGINS_SOCKET_DIR_NAME")
obsoleteOptsDirsPath := cli.Opts().Envar("PLUGINS_SOCKET_DIRS_PATH") // TODO: Obsolete setup to remove
opts_infra_repo := cli.Opts().Short('I').Default("<organization>-infra")
opts_creds_file := cli.Opts().Short('C')
opts_orga_name := cli.Opts().Short('O')
Expand Down Expand Up @@ -296,6 +297,7 @@ func (a *Forj) init() {
AddField(cli.String, "flows-repo", flows_repo_help, "#w", opts_flows_repo).
AddField(cli.String, "repotemplates-repo", repotemplates_repo_help, "#w", opts_repotmpl).
AddField(cli.String, forjfile.PluginsSocketDirField, socketDirsPathHelp, "#w", optsDirsPath).
AddField(cli.String, "plugins-sockets-dirs-path", obsoleteSocketPathHelp, "#w", obsoleteOptsDirsPath). // TODO: Obsolete. To remove.
AddField(cli.String, orga_f, forjj_orga_name_help, "#w", nil).
DefineActions(chg_act, rem_act).OnActions().
AddFlag(infra_path_f, nil).
Expand All @@ -304,6 +306,7 @@ func (a *Forj) init() {
AddFlag("flows-repo", nil).
AddFlag("repotemplates-repo", nil).
AddFlag(forjfile.PluginsSocketDirField, nil).
AddFlag("plugins-sockets-dirs-path", nil). // TODO: Obsolete. To remove.
AddFlag(orga_f, opts_orga_name) == nil {
log.Printf("Workspace : %s", a.cli.GetObject(workspace).Error())
}
Expand Down
8 changes: 8 additions & 0 deletions cli_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,14 @@ func (a *Forj) setWorkspace() error {
// It must match the cli name to retrieve the cli data as defined in app.go#291
// TODO: Fix cli/workspaceData match
value, _, _, _ = a.cli.GetStringValue("workspace", "", field)

// Obsolete code to remove when transition is completed. (in one month)
if value == "" && field == forjfile.PluginsSocketDirField {
value, _, _, _ = a.cli.GetStringValue("workspace", "", "plugins-sockets-dirs-path")
if value != "" {
gotrace.Warning("--plugins-sockets-dirs-path or PLUGINS_SOCKET_DIRS_PATH are obsolete and will be removed in January 2019. Use --%s or PLUGINS_SOCKET_DIR_NAME instead.", forjfile.PluginsSocketDirField)
}
}
return
}, infra_path_f)

Expand Down
3 changes: 2 additions & 1 deletion help.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ But FORJJ is not DevOps if you do not help your teams to do DevOps (DevOps Cultu
contribs_repo_help = "Set a local forjj-contribs directory like or a github like url for FORJJ plugins. You can set CONTRIBS_REPO as env."
flows_repo_help = "Set a local forjj-flows directory like or a github like url for FORJJ flows. You can set FLOWS_REPO as env"
repotemplates_repo_help = "Set a local forjj-repotemplates directory like or a github like url for FORJJ Repository templates. You can set REPOTEMPLATES_REPO as env."
socketDirsPathHelp = "Set forjj Plugins sockets parent directory. default: /tmp/forjj. Note that forjj creates a random dir in this path. When forjj is started from a pipeline managed by a Docker DooD CI, the plugins sockets parent directory is mounted from the host . Keeping /tmp imply that the Host can be cleaned it up and breaks the CI docker mount point. To avoid this, the CI must use this flag to use another path, more persistent. Setting PLUGINS_SOCKETS_PARENT_PATH do the same."
socketDirsPathHelp = "Set forjj Plugins sockets parent directory. default: /tmp/forjj. Note that forjj creates a random dir in this path. When forjj is started from a pipeline managed by a Docker DooD CI, the plugins sockets parent directory is mounted from the host . Keeping /tmp imply that the Host can be cleaned it up and breaks the CI docker mount point. To avoid this, the CI must use this flag to use another path, more persistent. Setting PLUGINS_SOCKET_DIR_NAME do the same."
obsoleteSocketPathHelp = "Obsolete. Use --plugins-socket-dir-name instead or PLUGINS_SOCKET_DIR_NAME instead of PLUGINS_SOCKET_DIRS_PATH. This option is kept to avoid breaking pipelines. It will be removed in January 2019. Please update your scripts/pipelines"

update_action_help = `Update the infra. Used to create/update/remove projects and infrastructure migration
(for example from local jenkins to a mesos jenkins solution)
Expand Down

0 comments on commit 8796fa9

Please sign in to comment.