diff --git a/docker-compose.yml b/docker-compose.yml index ea7f3b87..6d83ff23 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -81,7 +81,7 @@ services: volumes: - colonies_etcd:/var/colonies/etcd ports: - - "${COLONIES_SERVER_PORT}:${COLONIES_SERVER_PORT}" + - "0.0.0.0:${COLONIES_SERVER_PORT}:${COLONIES_SERVER_PORT}" command: sh -c "colonies server start --initdb --port ${COLONIES_SERVER_PORT} --relayport 25100 --etcdname server1 --etcdhost colonies-server --etcdclientport 23100 --etcdpeerport 24100 --initial-cluster server1=colonies-server:24100:25100:${COLONIES_SERVER_PORT} --etcddatadir /var/colonies/etcd --insecure" colonies-setup: diff --git a/internal/cli/function.go b/internal/cli/function.go index 07b45532..3c7415a8 100644 --- a/internal/cli/function.go +++ b/internal/cli/function.go @@ -34,6 +34,7 @@ func init() { submitFuncSpecCmd.MarkFlagRequired("spec") submitFuncSpecCmd.Flags().BoolVarP(&PrintOutput, "out", "", false, "Print process output, wait flag must be set") submitFuncSpecCmd.Flags().BoolVarP(&Follow, "follow", "", false, "Follow process, wait flag cannot be set") + submitFuncSpecCmd.Flags().BoolVarP(&Snapshot, "snapshot", "", false, "Automatically create snapshot") submitFuncSpecCmd.Flags().StringVarP(&Label, "label", "", "", "Add a label") execFuncCmd.Flags().StringVarP(&PrvKey, "prvkey", "", "", "Private key") @@ -51,6 +52,7 @@ func init() { execFuncCmd.Flags().BoolVarP(&PrintOutput, "out", "", false, "Print process output, wait flag must be set") execFuncCmd.Flags().BoolVarP(&Follow, "follow", "", false, "Follow process, wait flag cannot be set") execFuncCmd.Flags().StringVarP(&Label, "label", "", "", "Add a label") + execFuncCmd.Flags().BoolVarP(&Snapshot, "snapshot", "", false, "Automatically create snapshot") removeFuncCmd.Flags().StringVarP(&FunctionID, "functionid", "", "", "FunctionID") removeFuncCmd.MarkFlagRequired("functionid") @@ -235,7 +237,9 @@ var submitFuncSpecCmd = &cobra.Command{ funcSpec.Conditions.ColonyName = ColonyName } - createSnapshot(funcSpec, client) + if Snapshot { + createSnapshot(funcSpec, client) + } if Label != "" { funcSpec.Label = Label @@ -331,7 +335,9 @@ var execFuncCmd = &cobra.Command{ Conditions: conditions, Env: env} - createSnapshot(&funcSpec, client) + if Snapshot { + createSnapshot(&funcSpec, client) + } if Label != "" { funcSpec.Label = Label diff --git a/internal/cli/root.go b/internal/cli/root.go index 2ac04ed5..ed0ac7b0 100644 --- a/internal/cli/root.go +++ b/internal/cli/root.go @@ -137,6 +137,7 @@ var Days int var ASCII bool var Print bool var SecondsBack int +var Snapshot bool func init() { rootCmd.PersistentFlags().BoolVarP(&Verbose, "verbose", "v", false, "Verbose (debugging)")