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

Feature/check-git-go-version #52

Merged
merged 5 commits into from
Oct 31, 2021
Merged

Feature/check-git-go-version #52

merged 5 commits into from
Oct 31, 2021

Conversation

brumhard
Copy link
Contributor

Fixes #39

Signed-off-by: Tobias Brumhard tobias.brumhard@mail.schwarz

Signed-off-by: Tobias Brumhard <tobias.brumhard@mail.schwarz>
Signed-off-by: Tobias Brumhard <tobias.brumhard@mail.schwarz>
Signed-off-by: Tobias Brumhard <tobias.brumhard@mail.schwarz>
Signed-off-by: Tobias Brumhard <tobias.brumhard@mail.schwarz>
Signed-off-by: Tobias Brumhard <tobias.brumhard@mail.schwarz>
@brumhard
Copy link
Contributor Author

@linuxluigi I improved the error output for the executed commands on repo initialization. Also I changed the effect of a failing command from an error to a warning since technically the created repo is valid and just doesn't have git and go initialized which could be done manually by the user after he fixes the issues. (If we keep the error, the created folder is deleted automatically by the defered cleanup)
What do you think of that approach?

@brumhard
Copy link
Contributor Author

Btw I decided to pick the minGoVersion 1.15 by running the following:

#! /bin/bash

SCRIPT="curl -fsSL https://github.com/SchwarzIT/go-template/releases/download/v0.2.0/gt-linux-amd64 -o gt-linux
chmod +x gt-linux
./gt-linux new -c /src/test-values.yml"

GOOS=linux GOARCH=amd64 go build -ldflags="-w -s" -o /tmp/gt_linux cmd/gt/*.go
for version in 1.12 1.13 1.14 1.15 1.16 1.17; do
  echo testing version $version
  docker run -it \
    -e GO111MODULE=on \
    -v $(pwd)/pkg/gotemplate/testdata/values.yml:/src/test-values.yml \
    golang:$version \
    /bin/bash -c "$SCRIPT"
done

So basically 1.15 was the first version that didn't fail right away when running gt new.

@linuxluigi
Copy link
Collaborator

Awesome, you also fix the problem. That when you run gt without internet connection that it will still works.
Just by accident I run in the problem direkt before I read your PR 🤩

@brumhard brumhard merged commit 79c5cf9 into main Oct 31, 2021
@brumhard brumhard deleted the feature/check-git-go-version branch November 2, 2021 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add documentation for dependency on git and go
2 participants