Commit Graph

38 Commits

Author SHA1 Message Date
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 df04573590 fix(version): Displays supported APIs and version (#453)
* fix(version): Displays supported APIs and version

 Fixes #404

 ```
  ./kn version
Version:      v20191017-local-6328a73-dirty
Build Date:   2019-10-17 09:55:55
Git Revision: 6328a73
Supported APIs:
- serving.knative.dev/v1alpha1 (knative-serving v0.8.0)
 ```

* Removes ServingVersion feeding from ldflags

 - hardcodes the supported APIs as they're supposed to be updated when we bump deps

* Fixes typo in e2e tests

* Uses array for deterministic order of printing supported APIs
2019-10-18 03:35:18 -07: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
Ying Chun Guo a252829ceb fix a small error in verify-codegen.sh (#451) 2019-10-16 02:39:15 -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
Naomi Seyfer 25c726453e Update serving dependency to 0.8; change all import paths (#368)
* Update serving to 0.8. Try building.

* Find the right serving version

* Change our own import path to knative.dev to match

* Remove dependency on old version of client

* Update yaml template

* Add sleep to test to deal with race

* fix merge conflict

* Update vendor modules
2019-08-15 18:09:08 -07:00
Aaron Lerner 3d3eac1dff Only test in watch mode if passed test flag (#343) 2019-08-07 01:26:55 -07:00
chaodaiG 9f203f2d4d Use knative.dev/test-infra (#319) 2019-07-31 03:20:43 -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
Adriano Cunha 144ccb875e Point release documentation to knative/test-infra (#281) 2019-07-19 15:52:31 -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ß 2db1195b3f fix(release.sh): Point to proper directory to extract the serving version (#221)
The argument to build_flags.sh must point to the basedirectory where
go.mod is located.

Fixes #212
2019-07-03 01:47:32 -07:00
Navid Shaikh 65f1c081ee Add kn revision delete command (#207)
* Adds kn revision delete command

* Adds unit tests for revision delete command

* Adds integration tests for revision delete command

 Added revision delete command tests in new workflow namely
 TestRevisionWorkflow.

* Removes extra line and renames an import alias

* Adds 10 seconds sleep between service create and revision delete

 Also adds check for 'No resources found' while grabbing revision name.

* Clean up imports

* Removes the pause after service create

* Updates testing output strings in unit and e2e

* Updates post goimports on hack and test dirs
2019-06-28 10:21:08 -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
Vincent 5d2a7aa912 Add the support to build container image for kn (#152) 2019-06-06 17:30:40 -07:00
dr.max 0800d7c4d3 Regroups code to use subpackages. Finishes issue #66 (#145)
Creates four subpackages for now:

1. kn/commands - inludes types.go for common
   struct and other common files and misc commands
2. kn/commands/service - all 'kn service *' commands
3. kn/commands/revision - all 'kn revision *' commands
4. kn/core - contains the root.go and other top level
   for code and testing
5. refactors:
   a. split .../commons/human_readable_flags.go into three
   b. modifies the HumanReadableFlags.ToPrinter to get pass
      a function that sets the columns and fields

Had to refactor all tests to avoid cycles.
2019-06-05 16:30:38 -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
Adriano Cunha 8bb85c6aed Fix auto releases of Knative Client (#124)
This requires updating test-infra to deal with a repo that has no releases yet.

Also use hash and dates from the helper, to keep the binary and the GCS dirs in sync.
2019-05-17 14:40:16 -07:00
Adriano Cunha 9ec9671b2e Setup release infrastructure for Knative Client (#115)
Just like the other Knative modules, and ready for automation.

Requires updating test-infra to the latest version.
2019-05-16 10:51:17 -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
Naomi Seyfer 5e5b46028f Disable cgo extensions in build-binaries.sh (#106)
Previously, we were running into errors on computers without cross-compilation C
headers. For simplicity of building, and because we don't need superperformant
net libs, disable cgo.
2019-05-14 12:22:31 -07:00
dr.max 95808278d4 Adds Cobra generated docs and means to generate them and first cut of other docs (#93)
* Added Cobra generated docs and ways to generate them

* Adds docs/README.md and first user's guide for Kn
2019-05-06 17:39:36 -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
Roland Huß 1cbd7138b6 chore(version): Add buildtime and git revision to version command (#76)
* chore(version): Add buildtime and git revision to version command

For that, also updated `hack/build.sh` and `hack/build-binaries.sh` to
set the values from the outside.

The file `hack/NEXT_VERSION` contains the version number of the next
release. A regular build will create version numbers in the format
"0.1.0-20190417" which according to semver.org is a version less
than 0.1.0 (i.e. a pre-release).

A release script should pick up NEXT_VERSION, make the release with
the number found there and then update to the next release, possibly
a minor a release.

* chore(build.sh): Minor cosmetic fixes

* Aligned variable name
* Streamlined console output of build scripts
* Use "2019-04-18 07:40:10" as format for build time as it used as information only

* chore(build.sh): Add GO111MODULE=on

So that the script can be used also when running from within GOPATH

* chore(build.sh): Changed shasum --> sha256sum

... as shasum is not part of coreutils, and sha256sum should be more
generally available. Made the shasum output optional, too.

* chore(build.sh): Changed from BuildTime to BuildDate

... as this better reflects the value, the date when the client was built.

* chore(build.sh): Typo fix
2019-04-18 15:53:26 -07:00
dr.max 7c4f05aa6b adding hack/build* to make life easy and added version command. Getting my feet wet (#69) 2019-04-15 15:51:01 -07:00
Ben Browning aa11ceab12 Add hack/verify-codegen.sh so CI verifies vendor/ doesn't drift (#64)
Yes, the file is called verify-codegen.sh, and yes in the other
Knative projects it both verifies generated code and verifies vendored
dependencies are up-to-date. For client, it just verifies vendored
dependencies don't drift.

The test-infra scripts specifically look for a file with this name. If
we'd prefer to call this something else, we'll also need to update
test-infra to look for that something else.
2019-04-08 10:28:58 -07:00
Naomi Seyfer fb587184c4 Actually, vendor everything (#59)
* Actually, vendor everything

* Verifier and update deps

* Dont verify codegen; we cant
2019-04-05 04:08:57 -07:00