Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rework version checking #604

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ COPY assets /px-deploy/assets
COPY scripts /px-deploy/scripts
COPY templates /px-deploy/templates
COPY infra /px-deploy/infra
COPY defaults.yml /px-deploy/versions.yml
COPY VERSION /
COPY --from=build /px-deploy/terraform/aws /px-deploy/terraform/aws
COPY --from=build /px-deploy/terraform/azure /px-deploy/terraform/azure
Expand Down
4 changes: 2 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ done

# existing defaults.yml found. Dont replace, but ask for updating versions
if [ -e $HOME/.px-deploy/defaults.yml ]; then
echo -e "${YELLOW}Existing defaults.yml found. Please consider updating k8s_version and px_version to release settings (check $HOME/px-deploy/defaults.yml.$ver)."
echo -e "${YELLOW}Existing defaults.yml found. Please consider updating k8s_version and px_version to release settings (check $HOME/px-deploy/versions.yml)."
else
cp defaults.yml $HOME/.px-deploy/defaults.yml
fi
cp defaults.yml $HOME/.px-deploy/defaults.yml.$ver
cp defaults.yml $HOME/.px-deploy/versions.yml

echo
echo -e ${YELLOW}If you are using zsh, append this to your .zshrc:
Expand Down
10 changes: 5 additions & 5 deletions px-deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -2048,11 +2048,11 @@ func get_version_latest() string {

func check_for_recommended_settings(config *Config) {
// check for "recommended" version in default.yaml.[version_current]
if _, err := os.Stat("defaults.yml." + get_version_current()); os.IsNotExist(err) {
fmt.Printf("%sdefaults.yml.%s not found. No recommended versions available to be shown%s \n", Yellow, get_version_current(), Reset)
if _, err := os.Stat("versions.yml"); os.IsNotExist(err) {
fmt.Printf("%sversions.yml not found. No recommended versions available to be shown%s \n", Yellow, Reset)
} else {
fmt.Printf("checking your defaults.yml for recommended version settings (from defaults.yml.%s) \n", get_version_current())
recommended_versions := parse_yaml(fmt.Sprintf("defaults.yml.%s", get_version_current()))
fmt.Printf("checking your defaults.yml for recommended version settings (from versions.yml) \n")
recommended_versions := parse_yaml("versions.yml")
recVers := reflect.ValueOf(recommended_versions)
curDef := reflect.ValueOf(config)
typeOfS := recVers.Type()
Expand Down Expand Up @@ -2090,7 +2090,7 @@ func check_for_recommended_settings(config *Config) {

func sync_repository() {
fmt.Printf("syncing container repo to local dir\n")
cmd := exec.Command("rsync", "-a", "/px-deploy/assets", "/px-deploy/scripts", "/px-deploy/templates", "/px-deploy/infra", "/px-deploy/.px-deploy/")
cmd := exec.Command("rsync", "-a", "/px-deploy/assets", "/px-deploy/scripts", "/px-deploy/templates", "/px-deploy/infra", "/px-deploy/versions.yml", "/px-deploy/.px-deploy/")
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
errapply := cmd.Run()
Expand Down
Loading