Commit Graph

52 Commits

Author SHA1 Message Date
David Simansky 441372aea1
Add target platform flag to build script (#1981)
* Add targer platform flag to build script

* Update hack/build.sh

Co-authored-by: Chris Suszynski <krzysztof.suszynski@gmail.com>

* Drop -mod=vendor flag

---------

Co-authored-by: Chris Suszynski <krzysztof.suszynski@gmail.com>
2024-11-28 15:51:43 +00:00
Chris Suszynski f09e7164ce
Fold in knative.dev/client-pkg as a submodule (#1953)
* Move to the hack' script inflator

* Skip kn subpackage

* Move the lib/ to public pkg/ packages

* Introduce pkg submodule, remove the vendor dir

* Remove vendor references

* Use latest version of knative.dev/hack

* Publish dependent images properly

* Walkaround for knative-extensions/net-istio#1345

* Remove GOTOOLCHAIN in go.work

* Verify codegen use common funcs

* Import code from knative.dev/client-pkg

* Restore the default unit test runner

* Try knative/actions#223

* Restore the workflows

* Nit: simplify config package import
2024-09-03 13:49:11 +00:00
Chris Suszynski bb1f899634
Remove vendor dir (#1962) 2024-08-29 13:57:18 +00:00
Roland Huß cef926d3b6
some fixes for build.sh (#1901) 2023-11-29 14:01:12 +00:00
cola b59e60ba81
Fix shellcheck warnings in hack/build.sh script (#1860)
Signed-off-by: pingjiang <xiangpingjiang1998@gmail.com>
2023-09-05 10:03:17 +00:00
David Simansky 3a7d8c18ad
Add support for Eventing/v1beta2 EventTypes (#1831)
* Add support for Eventing/v1beta2 EventTypes

* Skip e2e tests on missing API

* Shortne the sink help message

* Reword the help by the review recommendation

* Reflect review feedback
2023-07-26 10:42:40 +00:00
David Simansky 189592606e
fix: Use go_run from common lib (#1793)
* fix: Use go_run from common lib

* chore: Set Bash options in name format

* Reflect shell suggestion for the direct changes
2023-04-24 09:35:42 +00:00
David Simansky bcd18d39f4
Fix OCI image build (#1666)
* Fix OCI image build

* Reflect review feedback
2022-04-29 11:48:53 +00:00
Chris Suszynski e7d7cad429
Allow overriding of build.sh for downstream projects (#1544) 2021-12-10 04:50:29 -08:00
Gunjan Vyas 5d4b4f3759
Fix windows e2e plugin tests (#1457)
* Fix windows e2e plugin tests

* Suggested changes
2021-09-21 09:54:37 -07:00
Roland Huß 707fe77b58
Fix include and be more flexible for the script interpreter. (#1420)
Since we include now a test-infra script, which is Bash 4 based,
macOs user need to install Bash >= 4 e.g. via brew now.
The bash version coming with macOs is not good enough (3)
2021-08-05 08:06:52 -07:00
David Simansky 4e1297ac8f
Add lint check to build.sh script (#1414)
* Add lint check to build.sh script

* Fix golangci-lint repo url
2021-08-05 02:39:52 -07:00
Gunjan Vyas 712e0e4af1
Adding support for darwin/arm64 (#1401)
* Adding support for darwin/amd64

* Updating go version to 1.16 in go.mod
2021-07-27 17:14:16 -07:00
David Simansky 88fd3102a6
Remove force update of go-licenses binary (#1348) 2021-06-25 05:04:21 -07:00
David Simansky e23b4d626e
Update k8s dependencies to v0.20.7 (#1344)
* Update k8s dependencies to v0.20.7

* Update vendor dir

* Fix license dir

* Remove commented code

* Update knative deps

* Use scheme to add known types for dynamic client

* Update go-licenses in build script
2021-06-17 07:42:22 -07:00
David Simansky d44f25d350
feat: Add knb plugin build tool (#1226)
* feat: Add knb plugin build tool

* fix: Fix lint errors

* fix: Fix trailing whitespaces in readme

* fix: Fix error msg

* fix: Fix all error msg

* fix: Move knb to sub-dir tools/knb

* fix: Add new dir to sources

* fix: Reflect review feedback

* fix: Reflect review feedback in readme

* fix: Code formatting

* fix: Fix gosec errors
2021-03-08 00:22:21 -08:00
Navid Shaikh b6a4deee4c
Remove unwanted var in hack/build.sh (#1147) 2020-12-01 10:54:37 -08:00
Yaakov Selkowitz cc6c7216d2
Build and release binaries for linux/ppc64le (#1153) 2020-11-30 01:03:36 -08:00
Hyounggyu Choi 724b0bddb4
Cross-compile the kn binary for linux/s390x (#1083)
Co-authored-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2020-11-24 11:51:35 -08:00
Roland Huß 1b7985eac5
feature: Add Linux arm64 builds to the release (#1106)
* feature: Add Linux arm64 builds to the release

Fixes https://github.com/knative/client/issues/1101

* update link to PR in changelog.adoc
2020-11-10 03:45:58 -08:00
Scott Nichols d1552ee0a3
updating to use the hack repo (#1084)
* updating to use the hack repo

* eof

* you need to run update deps after codegen to pick up any new deps.

* do not reinvent update-deps.

* must be winter
2020-10-30 11:41:35 -07:00
Roland Huß 2c6a4c667e
Fix bogus warning in build.sh (#1064) 2020-10-15 14:27:05 -07:00
Matt Moore a39903ba78
Run github.com/client9/misspell (#1030)
Signed-off-by: Matt Moore (via Sockpuppet) <mattmoor@vmware.com>
2020-09-25 07:45:44 -07:00
Roland Huß 490fe574cc
feat: Add plugin listing to "kn --help" (#929)
* feat: Add plugin listing to "kn --help"

This works on all levels. Test needs to be expanded still.

Fixes #266

* chore: Fix test

* Add test and ported #910 over.

* changelog update

* fix test

* Fix test

* fix integration tests

* fix test

* chore: Add some explanatory comments

* fix test
2020-07-14 13:38:33 -07:00
Navid Shaikh f91fb57f9a
kn v0.16.0 release prep (#922)
* Update unit test for invalid concurrency target value

* Vendor v0.16.0 eventing and serving

* Commit the LICENSES generated by hack/update-deps.sh

* Spare third_party dir from license check in hack/build.sh

* Update eventing and serving version for 'kn version'

* Use DeprecatedInjectionAnnotation key for backward compatibility

  Fixes #918
  Use DeprecatedInjectionAnnotation, i.e. "knative-eventing-injection"
  for reconciling broker via namespace labeling and trigger annotations.

  From eventing v0.16.0 release, this key is changed to "eventing.knative.dev/injection"
  however, older eventing installation wont recognize it. So we continue
  using the deprecated key until the sugar-controller would support reconciling
  on either keys.

* Fix(kn version): Display eventing.knative.dev at v1beta1 version

 We've been showing 'v1alpha1' in kn version while we actually
 vendor and refer v1beta1 for eventing.knative.dev

* chore(e2e): Run tests against serving/eventing v0.16.0 release

* Update test for concurrency-target to expect new error message

 the new error message for incorrect concurrency-target value contains "should be at least 0.01"

* Setup sugar-controller for released eventing version setup

 - reuse knative_setup util from common lib for latest-release CI setup

* Fix typo in YAML URL and add subheader for sugar-controller install
2020-07-10 10:41:19 -07:00
Roland Huß ff350fb6a7
Fix build.sh for macOs users (#883)
* Fix build.sh for macOs users

Fixes #882

* cleanup tempdir after installing
2020-06-09 06:42:32 -07:00
Dave Protasowski a7ea77d106
Update go.mod to specify the module is go1.14 (#866)
* Update go.mod to specify the module is go1.14

Thus the go commands will default to -mod=vendor

See: https://golang.org/doc/go1.14#go-command

* install goimports as a tool

* drop mod=vendor usage as that's the default with go1.14

* remove comment about using -mod=vendor

* Revert "drop mod=vendor usage as that's the default with go1.14"

This reverts commit 567004d404bb7ebd39ed527dc75759cfc7db672f.

* Revert "remove comment about using -mod=vendor"

This reverts commit 2a71393a2015c1539be1503e0c52cf64283e12d0.

* Revert "install goimports as a tool"

This reverts commit 9616d5e2d2ab0d61e8454b1ace057ec9712e182d.

* use go_run_tool to run goimports

* inline go_run_tool

* include required env var REPO_ROOT_DIR
2020-06-08 13:40:32 -07:00
Roland Huß b7fc4c3906
chore: Remove OWNERS files in vendor/ when updating deps (#867)
* chore: Remove OWNERS files in vendor/ when updating deps

* chore: Remove OWNERS also in build.sh
2020-06-01 19:25:03 -07:00
dr.max df78b8b40c
(refactor) address the e2e extract / refactor of issue #763 (#765)
* (refactor) address the e2e extract / refactor of issue #763

* various updates to address reviewers feedback

* renamed lib/test/integration to lib/test and package to test
2020-04-01 09:21:18 -07:00
Roland Huß cadc2d3acf chore(build): Spacing fix for newer iTerm (>=3.3.7) (#509) 2019-11-19 05:12:07 -08:00
Navid Shaikh cf40c25657 Separates cross compile in hack/build.sh from default flow (#489)
- `./hack/build.sh` performs usual flow of codegen, build and test
 - `./hack/build.sh -x` only compiles cross platform
 - Updates hack/build.sh help message to reflect this
2019-11-12 01:58:22 -08:00
Navid Shaikh f03508f74a Adds go mod tidy to update dependencies function hack/build.sh (#455)
- Added `go mod tidy` before `go mod vendor` command
2019-10-17 23:33:18 -07:00
Roland Huß e67d207d3b chore(build.sh) Add indicator in watch mode after successful compilation (#432)
* chore(build.sh) Add indicator in watch mode after successful compilation

* chore(build): Update changelog
2019-10-08 04:34:38 -07:00
Roland Huß 34fcd89bcd chore(build): Tuned cross compiling a bit (#405)
* Renamed to --build-cross to --all (as we are not building a cross but all binaries. Could be renamed to --all-bin to be more clear)
* Fixed inclusion of external build-flags.sh script (which was broken when used build.sh with a symbolic label)
* Moved cross compiling to the end (to not interfer with --fast or --codegen)
* Aligned labels (to be short and concise)
2019-09-12 07:39:32 -07:00
Navid Shaikh 10f981ccaa Ensures kn cross platform build works in presubmit tests (#385)
Fixes #364

 - Ensure kn cross platform build works in pre-submit tests
 - Run ./hack/build.sh -x after running existing pre-submit tests
 - defines a function post_build_tests to invoke cross platform builds
 - post_build_tests will be run by test-infra after build tests are compelete
2019-08-26 10:59:17 -07:00
Navid Shaikh d6c798ad65 Adds option in hack/build.sh to build cross platform binaries (#371)
- Use `./hack/build.sh -x` or `./hack/build.sh --build-cross`
 - Doesn't touch any of the existing flow, providing these options will build binaries and exit
2019-08-21 16:16:33 -07:00
Aaron Lerner 3d3eac1dff Only test in watch mode if passed test flag (#343) 2019-08-07 01:26:55 -07:00
Roland Huß 34992aa5a9 chore(build): Refactor to simplify and add dedicated test mode (#268)
Rearranged script a bit to make easier to understand the various run
modes.
Added a `--test` mode which will only run the tests
2019-07-22 11:29:35 -07:00
Roland Huß 55073029b4 fix(build): Minor build optimizations (#265)
* Check that every generated file has been regenerated for CI
* No color when not on a tty which is useful for build logs
* Always do updates when called without args
* Removed -u option and added -c for codegen only (dep update, docs gen, formatting, license check)
2019-07-15 13:21:27 -07:00
Navid Shaikh 389a7592bc Adds step to simplify code along with goimports (#239)
(and gofmt if goimports isn't available)

 - Runs goimports on all packages except vendor dir and filter on only *.go files

 - Runs gofmt on all dirs except vendor and filters on *.go files, also writes the results instead of printing diff

 - Fixes typo s/insteat/insead

 - Adds the changes after adding simply code step in hack/build.sh

 - Uses source_dir var specifying the dirs to work on

 - Combines gofmt commands into single command
2019-07-08 03:17:33 -07:00
Roland Huß a60d273d82 feat(build.sh): Enable goimports + cleanup imports in source files (#186)
* feat(build.sh): Enable goimports for cleanup imports + cleanup imports

Much like 'go fmt' for cleaning up go source, 'goimports' can help
in properly formatting and grouping imports. See https://goinbigdata.com/goimports-vs-gofmt/
for a quick overview.

This commit also cleansup imports on existing files.

* fix(build): Add missing space for output on iterm

* chore(build): Merged gofmt and goimports

And changed order so that formatting and import reordering comes
before compiling and testing
2019-06-28 06:30:08 -07:00
Roland Huß a0eb6118cd fix(build.sh): Cosmetic spacing fix (#199)
* fix(build.sh): Cosmetic spacing fix

Iterm has an issue with rendering multi byte unicode chars. This
commit adds an extra space to certain emojis on iterm only.

This fixes current rendering issues on Linux term because that extra
space was added previously unconditionally.

* fix(build.sh): Avoid uninitialized variable ITERM_PROFILE
2019-06-25 11:13:05 -07:00
Roland Huß 74abba5eb4 feat(build.sh) - Add mandatory license check (#187)
We could decide to make that optional, too, if this is coming into the way.
2019-06-14 15:50:43 -07:00
Roland Huß 0d94947366 fix(build.sh): Change from xnotify to fswatch for watching source code (#171)
While working with `build.sh --watch` it turned out the underlying
tool xnotify is not matured enough:

* It doesn't work when IntelliJ IDEA changes a file
* It can't deal with ignoring newly generated temp files (like .swp for vi)

This commit exchanges xnotify with fswatch which is much more matured.
2019-06-10 11:41:44 -07:00
Roland Huß 8a1adf0cb0 feat(build.sh): Add a watch mode for automatic recompilation (#160)
This features uses and requires https://github.com/AgentCosmic/xnotify
and should work on any platform

Use it with

* Watch & compile: build.sh --watch
* Watch, compile, test: build.sh --watch --test
* Watch, compile, test & verbose output: build.sh --watch --test --verbose

(shortcuts -w && -t can be used, too)
2019-06-06 18:10:40 -07:00
Roland Huß 9221429cb0 feat(build.sh): Adding options and running tests (#149)
* feat(build.sh): Adding options and running tests

* Added running unit tests to the script
* Added options to support different development flows (see help message below)
* Allow symlinking to /usr/local/bin so that the script can be called from everywhere

Usage message:

Knative Client Build Script

Usage: hack/build.sh [... options ...]

with the following options:

-f  --fast                    Only build (without formatting, testing, code generation)
-t  --test                    Run tests even when used with --fast
-u  --update                  Update dependencies
-h  --help                    Display this help message
    --verbose                 Verbose script output (set -x)

You can add a symbolic link to this build script into your PATH so that it can be
called from everywhere. E.g.:

ln -s .../hack/build.sh /usr/local/bin/kn_build.sh

Examples:

* Compile, format, tests, docs:       build.sh
* Compile only:                       build.sh --fast
* Compile with tests:                 build.sh -f -t

* doc(build.sh): Added documentation for new build.sh options

* docs(build.sh): Cosmetic fixes

* docs(build.sh): Tiny documentation fix

* chore(build.sh): Another typo fix
2019-05-30 10:18:32 -07:00
Roland Huß bfd5b56c3f chore: Streamlined build.sh (#136)
* chore: Streamlined build.sh

* Merged generate-docs.sh into build.sh
* Split up into smaller functions
* Added serving dependency version to 'kn version' command

Not sure whether the latter is really useful (showing the serving dependency)
as this is might get confused with the knative version
installed on the cluster.

* chore: Fixed indentation
2019-05-28 06:08:31 -07:00
Roland Huß e0f4f51e67 fix(build.sh): Reintroduced build-flags.sh (#122)
so that it can be shared between build.sh and release.sh

Fixes #120
2019-05-17 15:17:09 -07:00
dr.max d8e710f389 Updates generated Cobra docs for commands and ... (#108)
Also:

1. New docs for commands
* service get
* revision get

2. Removes auto generated docs tags

3. Auto run generated docs when building to pick up any command changes
2019-05-15 15:00:32 -07:00
Roland Huß 8caca4589f fix(build.sh): Fix path to built kn when printing out the version (#77)
The final step when printing out the version of the generated kn
binary uses now the proper path, so that this script can be called
from any directory (like when the cwd is hacks/).
2019-04-19 12:47:27 -07:00