Merge branch 'temp-merge-branch'
This commit is contained in:
commit
a095c95be0
4 changed files with 14 additions and 5 deletions
|
|
@ -66,12 +66,13 @@ func (app *AppState) RunJsonDeployment() []PipelineStep {
|
||||||
|
|
||||||
jsonFile := app.Config.DeploymentFile
|
jsonFile := app.Config.DeploymentFile
|
||||||
if jsonFile == "" {
|
if jsonFile == "" {
|
||||||
log.Fatal("no config specified with --deployment-file=<path_to_config_file>")
|
log.Fatal("no config specified with [-f|--deployment-file]=<path_to_config_file>")
|
||||||
}
|
}
|
||||||
|
|
||||||
file, err := os.Open(jsonFile)
|
file, err := os.Open(jsonFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
slog.Error(fmt.Sprintf("Failed to open JSON file: %s", err))
|
slog.Error(fmt.Sprintf("Failed to open JSON file: %s", err))
|
||||||
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
defer file.Close()
|
defer file.Close()
|
||||||
|
|
@ -212,8 +213,6 @@ func (app *AppState) CreatePipeline() error {
|
||||||
slog.Info(fmt.Sprintln("Project name added:", app.Customer.Project))
|
slog.Info(fmt.Sprintln("Project name added:", app.Customer.Project))
|
||||||
fmt.Printf("Port number assigned: %d\n", port)
|
fmt.Printf("Port number assigned: %d\n", port)
|
||||||
app.Config.Port = port
|
app.Config.Port = port
|
||||||
} else {
|
|
||||||
slog.Info(fmt.Sprintln("Project name already exists:", app.Customer.Project))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
err = app.SetUpNewCustomer()
|
err = app.SetUpNewCustomer()
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,7 @@ func RunCommand(command string) error {
|
||||||
for scanner.Scan() {
|
for scanner.Scan() {
|
||||||
line := scanner.Text()
|
line := scanner.Text()
|
||||||
stderr.WriteString(line + "\n")
|
stderr.WriteString(line + "\n")
|
||||||
slog.Error(line)
|
slog.Info(line)
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@ import (
|
||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const Version = "v0.0.4"
|
||||||
|
|
||||||
type BaseConfig struct {
|
type BaseConfig struct {
|
||||||
ProjectsDirectory string `json:"projects_directory"`
|
ProjectsDirectory string `json:"projects_directory"`
|
||||||
Env string `json:"env"`
|
Env string `json:"env"`
|
||||||
|
|
@ -38,6 +40,8 @@ func ReadBaseConfig(path string) (BaseConfig, error) {
|
||||||
deploymentFileShorthand := flag.String("f", "", "shorthand for -deployment-file")
|
deploymentFileShorthand := flag.String("f", "", "shorthand for -deployment-file")
|
||||||
|
|
||||||
helpFlag := flag.Bool("help", false, "show help")
|
helpFlag := flag.Bool("help", false, "show help")
|
||||||
|
versionFlag := flag.Bool("version", false, "show version")
|
||||||
|
vFlag := flag.Bool("v", false, "show version (shorthand)")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
if *helpFlag {
|
if *helpFlag {
|
||||||
|
|
@ -46,6 +50,12 @@ func ReadBaseConfig(path string) (BaseConfig, error) {
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Handle version flags
|
||||||
|
if *versionFlag || *vFlag {
|
||||||
|
fmt.Println("infctl-cli version:", Version)
|
||||||
|
os.Exit(0)
|
||||||
|
}
|
||||||
|
|
||||||
var config BaseConfig
|
var config BaseConfig
|
||||||
if *deploymentFileShorthand != "" {
|
if *deploymentFileShorthand != "" {
|
||||||
config.DeploymentFile = *deploymentFileShorthand
|
config.DeploymentFile = *deploymentFileShorthand
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
sudo apt-get update
|
sudo apt-get update
|
||||||
sudo apt-get install -y software-properties-common git vim python3.10-venv
|
sudo apt-get install -y software-properties-common git vim python3.10-venv jq
|
||||||
|
|
||||||
# Set up ansible environment for vagrant user
|
# Set up ansible environment for vagrant user
|
||||||
sudo -u vagrant mkdir -p /home/vagrant/.ansible
|
sudo -u vagrant mkdir -p /home/vagrant/.ansible
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue