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

Generate 'plugin_bundle.tar.gz' along with building the plugin with make plugin-build target #125

Merged

Conversation

anujc25
Copy link
Contributor

@anujc25 anujc25 commented Mar 21, 2023

What this PR does / why we need it

  • This PR updates the plugin-tooling.mk file to generate 'plugin_bundle.tar.gz' along with building the plugin with make plugin-build target

Which issue(s) this PR fixes

Fixes #

Describe testing done for PR

$ make plugin-build
/Users/anujc/Documents/code/tanzu-cli/bin/builder plugin build \
                --path ./cmd/plugin \
                --binary-artifacts /Users/anujc/Documents/code/tanzu-cli/artifacts/plugins \
                --version v0.1.0-dev-8-g6087ea00 \
                --ldflags "-X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Date=2023-03-21' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.SHA=6087ea00-dirty' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Version=v0.1.0-dev-8-g6087ea00'" \
                --os-arch linux_amd64 \
                --match "*"
2023-03-21T12:01:01-07:00 [i] building local repository at /Users/anujc/Documents/code/tanzu-cli/artifacts/plugins, v0.1.0-dev-8-g6087ea00, [linux_amd64]
2023-03-21T12:01:01-07:00 [i] 🦁 - building plugin at path "cmd/plugin/test"
2023-03-21T12:01:01-07:00 [i] 🐱 - building plugin at path "cmd/plugin/builder"
2023-03-21T12:01:04-07:00 [i] 🐱 - $ /usr/local/go/bin/go build -o /Users/anujc/Documents/code/tanzu-cli/artifacts/plugins/linux/amd64/global/builder/v0.1.0-dev-8-g6087ea00/tanzu-builder-linux_amd64 -ldflags -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Date=2023-03-21' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.SHA=6087ea00-dirty' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Version=v0.1.0-dev-8-g6087ea00' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Version=v0.1.0-dev-8-g6087ea00' -tags  ./cmd/plugin/builder
2023-03-21T12:01:06-07:00 [i] 🦁 - $ /usr/local/go/bin/go build -o /Users/anujc/Documents/code/tanzu-cli/artifacts/plugins/linux/amd64/global/test/v0.1.0-dev-8-g6087ea00/tanzu-test-linux_amd64 -ldflags -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Date=2023-03-21' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.SHA=6087ea00-dirty' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Version=v0.1.0-dev-8-g6087ea00' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Version=v0.1.0-dev-8-g6087ea00' -tags  ./cmd/plugin/test
2023-03-21T12:01:10-07:00 [i] 🦁 - $ /usr/local/go/bin/go build -o /Users/anujc/Documents/code/tanzu-cli/artifacts/plugins/linux/amd64/global/test/v0.1.0-dev-8-g6087ea00/test/tanzu-test-test-linux_amd64 -ldflags -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Date=2023-03-21' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.SHA=6087ea00-dirty' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Version=v0.1.0-dev-8-g6087ea00' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Version=v0.1.0-dev-8-g6087ea00' -tags  ./cmd/plugin/test/test
2023-03-21T12:01:11-07:00 [i] ========
2023-03-21T12:01:11-07:00 [ok] successfully built local repository
/Users/anujc/Documents/code/tanzu-cli/bin/builder plugin build \
                --path ./cmd/plugin \
                --binary-artifacts /Users/anujc/Documents/code/tanzu-cli/artifacts/plugins \
                --version v0.1.0-dev-8-g6087ea00 \
                --ldflags "-X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Date=2023-03-21' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.SHA=6087ea00-dirty' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Version=v0.1.0-dev-8-g6087ea00'" \
                --os-arch windows_amd64 \
                --match "*"
2023-03-21T12:01:11-07:00 [i] building local repository at /Users/anujc/Documents/code/tanzu-cli/artifacts/plugins, v0.1.0-dev-8-g6087ea00, [windows_amd64]
2023-03-21T12:01:11-07:00 [i] 🦁 - building plugin at path "cmd/plugin/test"
2023-03-21T12:01:11-07:00 [i] 🐱 - building plugin at path "cmd/plugin/builder"
2023-03-21T12:01:14-07:00 [i] 🐱 - $ /usr/local/go/bin/go build -o /Users/anujc/Documents/code/tanzu-cli/artifacts/plugins/windows/amd64/global/builder/v0.1.0-dev-8-g6087ea00/tanzu-builder-windows_amd64.exe -ldflags -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Date=2023-03-21' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.SHA=6087ea00-dirty' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Version=v0.1.0-dev-8-g6087ea00' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Version=v0.1.0-dev-8-g6087ea00' -tags  ./cmd/plugin/builder
2023-03-21T12:01:16-07:00 [i] 🦁 - $ /usr/local/go/bin/go build -o /Users/anujc/Documents/code/tanzu-cli/artifacts/plugins/windows/amd64/global/test/v0.1.0-dev-8-g6087ea00/tanzu-test-windows_amd64.exe -ldflags -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Date=2023-03-21' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.SHA=6087ea00-dirty' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Version=v0.1.0-dev-8-g6087ea00' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Version=v0.1.0-dev-8-g6087ea00' -tags  ./cmd/plugin/test
2023-03-21T12:01:20-07:00 [i] 🦁 - $ /usr/local/go/bin/go build -o /Users/anujc/Documents/code/tanzu-cli/artifacts/plugins/windows/amd64/global/test/v0.1.0-dev-8-g6087ea00/test/tanzu-test-test-windows_amd64.exe -ldflags -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Date=2023-03-21' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.SHA=6087ea00-dirty' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Version=v0.1.0-dev-8-g6087ea00' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Version=v0.1.0-dev-8-g6087ea00' -tags  ./cmd/plugin/test/test
2023-03-21T12:01:21-07:00 [i] ========
2023-03-21T12:01:21-07:00 [ok] successfully built local repository
/Users/anujc/Documents/code/tanzu-cli/bin/builder plugin build \
                --path ./cmd/plugin \
                --binary-artifacts /Users/anujc/Documents/code/tanzu-cli/artifacts/plugins \
                --version v0.1.0-dev-8-g6087ea00 \
                --ldflags "-X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Date=2023-03-21' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.SHA=6087ea00-dirty' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Version=v0.1.0-dev-8-g6087ea00'" \
                --os-arch darwin_amd64 \
                --match "*"
2023-03-21T12:01:21-07:00 [i] building local repository at /Users/anujc/Documents/code/tanzu-cli/artifacts/plugins, v0.1.0-dev-8-g6087ea00, [darwin_amd64]
2023-03-21T12:01:21-07:00 [i] 🦁 - building plugin at path "cmd/plugin/test"
2023-03-21T12:01:21-07:00 [i] 🐱 - building plugin at path "cmd/plugin/builder"
2023-03-21T12:01:23-07:00 [i] 🐱 - $ /usr/local/go/bin/go build -o /Users/anujc/Documents/code/tanzu-cli/artifacts/plugins/darwin/amd64/global/builder/v0.1.0-dev-8-g6087ea00/tanzu-builder-darwin_amd64 -ldflags -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Date=2023-03-21' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.SHA=6087ea00-dirty' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Version=v0.1.0-dev-8-g6087ea00' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Version=v0.1.0-dev-8-g6087ea00' -tags  ./cmd/plugin/builder
2023-03-21T12:01:26-07:00 [i] 🦁 - $ /usr/local/go/bin/go build -o /Users/anujc/Documents/code/tanzu-cli/artifacts/plugins/darwin/amd64/global/test/v0.1.0-dev-8-g6087ea00/tanzu-test-darwin_amd64 -ldflags -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Date=2023-03-21' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.SHA=6087ea00-dirty' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Version=v0.1.0-dev-8-g6087ea00' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Version=v0.1.0-dev-8-g6087ea00' -tags  ./cmd/plugin/test
2023-03-21T12:01:35-07:00 [i] 🦁 - $ /usr/local/go/bin/go build -o /Users/anujc/Documents/code/tanzu-cli/artifacts/plugins/darwin/amd64/global/test/v0.1.0-dev-8-g6087ea00/test/tanzu-test-test-darwin_amd64 -ldflags -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Date=2023-03-21' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.SHA=6087ea00-dirty' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Version=v0.1.0-dev-8-g6087ea00' -X 'github.com/vmware-tanzu/tanzu-plugin-runtime/plugin/buildinfo.Version=v0.1.0-dev-8-g6087ea00' -tags  ./cmd/plugin/test/test
2023-03-21T12:01:36-07:00 [i] ========
2023-03-21T12:01:36-07:00 [ok] successfully built local repository
cd /Users/anujc/Documents/code/tanzu-cli/artifacts/plugins && tar -czvf ../plugin_bundle.tar.gz .
a .
a ./plugin_manifest.yaml
a ./linux
a ./darwin
a ./windows
a ./windows/amd64
a ./windows/amd64/plugin_manifest.yaml
a ./windows/amd64/global
a ./windows/amd64/global/test
a ./windows/amd64/global/builder
a ./windows/amd64/global/builder/v0.1.0-dev-8-g6087ea00
a ./windows/amd64/global/builder/v0.1.0-dev-8-g6087ea00/tanzu-builder-windows_amd64.exe
a ./windows/amd64/global/test/v0.1.0-dev-8-g6087ea00
a ./windows/amd64/global/test/v0.1.0-dev-8-g6087ea00/test
a ./windows/amd64/global/test/v0.1.0-dev-8-g6087ea00/tanzu-test-windows_amd64.exe
a ./windows/amd64/global/test/v0.1.0-dev-8-g6087ea00/test/tanzu-test-test-windows_amd64.exe
a ./darwin/amd64
a ./darwin/amd64/plugin_manifest.yaml
a ./darwin/amd64/global
a ./darwin/amd64/global/test
a ./darwin/amd64/global/builder
a ./darwin/amd64/global/builder/v0.1.0-dev-8-g6087ea00
a ./darwin/amd64/global/builder/v0.1.0-dev-8-g6087ea00/tanzu-builder-darwin_amd64
a ./darwin/amd64/global/test/v0.1.0-dev-8-g6087ea00
a ./darwin/amd64/global/test/v0.1.0-dev-8-g6087ea00/test
a ./darwin/amd64/global/test/v0.1.0-dev-8-g6087ea00/tanzu-test-darwin_amd64
a ./darwin/amd64/global/test/v0.1.0-dev-8-g6087ea00/test/tanzu-test-test-darwin_amd64
a ./linux/amd64
a ./linux/amd64/plugin_manifest.yaml
a ./linux/amd64/global
a ./linux/amd64/global/test
a ./linux/amd64/global/builder
a ./linux/amd64/global/builder/v0.1.0-dev-8-g6087ea00
a ./linux/amd64/global/builder/v0.1.0-dev-8-g6087ea00/tanzu-builder-linux_amd64
a ./linux/amd64/global/test/v0.1.0-dev-8-g6087ea00
a ./linux/amd64/global/test/v0.1.0-dev-8-g6087ea00/test
a ./linux/amd64/global/test/v0.1.0-dev-8-g6087ea00/tanzu-test-linux_amd64
a ./linux/amd64/global/test/v0.1.0-dev-8-g6087ea00/test/tanzu-test-test-linux_amd64

Release note

Update `plugin-tooling.mk` file to generate 'plugin_bundle.tar.gz' along with building the plugin with `make plugin-build`

Additional information

Special notes for your reviewer

@anujc25 anujc25 requested a review from a team as a code owner March 21, 2023 19:06
Copy link
Contributor

@vuil vuil left a comment

Choose a reason for hiding this comment

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

lgtm.

qq: for the entries in the tar, do you want the './' prefix in them? Probably doesn't mattter if it doesn't matter to whatever is consuming it. Just want to make sure that is the intent.

@anujc25
Copy link
Contributor Author

anujc25 commented Mar 21, 2023

qq: for the entries in the tar, do you want the './' prefix in them? Probably doesn't mattter if it doesn't matter to whatever is consuming it. Just want to make sure that is the intent.

Yes. We do not want to include any extra directory within the .tar.gz. So it should start with ./ as per my understanding.

@anujc25 anujc25 merged commit bcf8fff into vmware-tanzu:main Mar 21, 2023
@vuil
Copy link
Contributor

vuil commented Mar 21, 2023

@anujc25 what I mean was the difference between the entries' names produced when tar . vs tar *

@anujc25
Copy link
Contributor Author

anujc25 commented Mar 21, 2023

@anujc25 what I mean was the difference between the entries' names produced when tar . vs tar *

Ahh. I misunderstood. I tested the publishing workflow with the tar.gz created with tar . and it worked so should be fine here.
But thanks for explaining. I didn't know the different earlier.

@vuil vuil added the kind/feature Categorizes issue or PR as related to a new feature label Apr 7, 2023
@marckhouzam marckhouzam added this to the v0.90.0 milestone Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-not-required kind/feature Categorizes issue or PR as related to a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants