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

Introduce makefile to run build/release commands #17

Merged
merged 2 commits into from
Mar 1, 2022

Conversation

cpanato
Copy link
Member

@cpanato cpanato commented Feb 25, 2022

  • Introduce makefile to run build/release commands like the build/test and release, also inject the ldflags and fix the version command
$ ./apko version
     _      ____    _  __   ___
    / \    |  _ \  | |/ /  / _ \
   / _ \   | |_) | | ' /  | | | |
  / ___ \  |  __/  | . \  | |_| |
 /_/   \_\ |_|     |_|\_\  \___/
apko

GitVersion:    v0.1
GitCommit:     98e1549
GitTreeState:  dirty
BuildDate:     '2022-02-24T16:08:23Z'
GoVersion:     go1.17.6
Compiler:      gc
Platform:      darwin/amd64

on the image

$ docker run ko.local/apko:feca0f036129cdc1a62bb2a0a3f1b0852e826d075a57c4b5a7120031b0d455d7 version
     _      ____    _  __   ___
    / \    |  _ \  | |/ /  / _ \
   / _ \   | |_) | | ' /  | | | |
  / ___ \  |  __/  | . \  | |_| |
 /_/   \_\ |_|     |_|\_\  \___/
apko

GitVersion:    v0.1
GitCommit:     98e1549
GitTreeState:  dirty
BuildDate:     '2022-02-24T16:08:23Z'
GoVersion:     go1.17.6
Compiler:      gc
Platform:      linux/amd64

cc @mattmoor @kaniini

@cpanato cpanato force-pushed the updates branch 3 times, most recently from 2bdfbb3 to 27e8b94 Compare February 25, 2022 10:49
mageFile.go Outdated
return errors.New("missing KO_DOCKER_REPO environment variable")
}

digest, err := sh.Output("ko", "build", "--base-import-paths", "--bare",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--base-... and --bare are mutually exclusive

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

humm did not know and they not complain, which one we should use?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I generally use the "base" one, but I used --bare for the release build so KO_DOCKER_REPO is exactly where the image goes.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, thanks

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

@mattmoor mattmoor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IDK how folks feel about the mageFile stuff in general. It's certainly new to me.

A few general comments

mageFile.go Outdated Show resolved Hide resolved
mageFile.go Outdated Show resolved Hide resolved
mageFile.go Outdated Show resolved Hide resolved
@cpanato
Copy link
Member Author

cpanato commented Feb 25, 2022

IDK how folks feel about the mageFile stuff in general. It's certainly new to me.

A few general comments

if people do not like I can change to a traditional makefile

@kaniini
Copy link
Contributor

kaniini commented Feb 26, 2022

I'd prefer to use a traditional makefile, but please also add make install target, cosign's doesn't have it.

@cpanato
Copy link
Member Author

cpanato commented Feb 27, 2022

@kaniini thanks for the feedback i will update that

@cpanato cpanato force-pushed the updates branch 3 times, most recently from 5296969 to c1057e9 Compare March 1, 2022 09:45
@cpanato cpanato changed the title Introduce mage to run build/release commands Introduce makefile to run build/release commands Mar 1, 2022
@cpanato
Copy link
Member Author

cpanato commented Mar 1, 2022

changed to makefile PTAL @kaniini @mattmoor

@kaniini
Copy link
Contributor

kaniini commented Mar 1, 2022

Looks good!

@kaniini kaniini merged commit 1bdb6fb into chainguard-dev:main Mar 1, 2022
@cpanato cpanato deleted the updates branch March 1, 2022 15: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.

4 participants