* Add `--config` and `--source` flags to push
This commit adds:
1. `--config` flag to update the component with component settings
2. `--source` flag to push only the source to an already existing
component.
3. If neither `--config` nor `--source` flags are passed, update
both source and configuration onto the component
fixes#1489
Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>
* Add e2e tests to test push with `--source` and `--config`
Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>
* Incorporate @snarwade comments
Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>
* Fix a rebase error
Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>
* clean and organize context in up e2e test
* Relax timeout for component tests
Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>
* Add `--project` to push tests to workaround the openshift CI failures
Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>
* Incoporate @kadel comments
Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>
* Incorporate @surajnarwade comments
Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>
* Adding scripts to handle initialization of cluster for openshift CI.
This also fixes couple of usernames on the side
Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>
* Adding http-tools to build root so we can use htpasswd
* Adding login as developer and creation of first project
* Moving script to ./scripts and renaming makefile command
* Renaming scripts to incude tests in configure cluster script
* Making script more configurable
* Adding namespace to secret commands.
* Fixing missing username
* Simplifying script by removing unnessasary variables
* Adding TODO and slightly reduction wait time for auth config
* Making assets dir overwritable
* Making configure script executable.
* Fixing message for not existing kubeconfig
* Redirecting out and err of commands where we are not interested in msg
* Updating to 18 secs default sleep which can be overridden
* Adding workaround for missing wildfly in OpenShift 4.0
* Adding basic ci docs for prow
Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>
* Harmonize recommended command names.
* Extract component tests.
* Remove unused constant.
* Make component tests parameterized so we can vary the command prefix.
* Add sub-command component tests.
* Fix documentation.
* Fix get and set command names.
* Add tests for sub-commands.
* Add generateTimeBasedName function and use it.
* Fix improper target.
* Add getActiveElementFromCommandOutput function and use it
* Add test to validate get and set.
* Activate new component sub-command tests in Travis.
* Fix component tests.
* Fix component tests.
* Trim spaces from getActiveElementFromCommandOutput.
* Fixing #1017: Intercepting login message and printing custom message
- Adding buffer to replace os.Stdout and intercept output of login
- Customizing a message from odo based on what was intercepted,
so if new-project is present in original message, appropriate
addition is done to odo message
- Printing custom message for login success case.
Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>
* Changing extra message to more closely immitate openshifts own messaging
* Changing to plan B of string replacement of new-project.
* Replacing "<projectname>" with "<project-name>"
* Splitting replace logic into 2 lines
* Adding tests to odo login
Signed-off-by: Mohammed Zeeshan Ahmed <mohammed.zee1000@gmail.com>
* Reducing wait time for project deletetion
* Altering trigger name for odo login test
* Adding failure case with invalid token login
* Adding odo login e2e tests to travis.
* Removing references of second teat project
* Adding explicit timing
* Increasing wait time
* Replacing explicit time with WaitForCmdOut
* Watch enhancements + bug fixes
1. This PR fixes the use case of odo watch pushing observed
changes from any level nested in source root directory to
the component source root because of which, the changes
are not reflected in the component.
2. Propagation of deletes in watched source to component pod
3. Back up source dir to work-around the problem with some of the s2i
images like python where source is mv from destination dir to
Working dir which means when source is pushed by watch subsequently,
with this fix, things are expected to work just fine
4. Fix UTs in accordance with the new enhancements
5. Add more e2e tests to cover watch for source and binary
6. Fix minor bug with odoignore and gitignore lookup
Steps to verify this PR:
Test 1:
a. trigger odo watch on a local source
b. make change in a file in a nested dir in the source directory
c. See the change is reflected in the component(perhaps via component url? :) )
Test 2:
Steps in #950fixes#1099#988#1054#1121
Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>
* Move main to cmd/odo.
* Refactor doc generation into one single command.
* Rename for consistency.
* Move commands to pkg/odo/cli.
* Export Add*Flag functions to prepare for move.
* Move validateName to pkg/odo/cli/util/validation.go.
* Move functions used by only one command to the command file.
* Renamed to storage_test since tests are storage-related.
* Move usage template to cmdutils.
* Use RootCmd() instead of var access.
* Move printComponentInfo back to cmdutils and expose.
* Move application to application package.
* Move component to component package. Move componentShortFlag also.
Not sure why it was on delete and not on component.
* Move commands to appropriate packages.
* Rename root to cli.
* Rename main to odo.
* Fix wrong reference to main file.
* Fix(?) generate-coverage.sh.
* Move root command name to cli.go.
* Move Add*Flag functions to genericclioptions/context_flags.
Move adding completion handler to package-specific functions
(duplication >_<)
* Move CmdUsageTemplate and PrintComponentInfo to odo/util package.
* Move VERSION and getLatestReleaseInfo to cli/version package.
Remove now empty cmdutils.
* Start using NewCmd* instead of init. Break import cycle. :)
* Rename client to cmdutils.
* Move to use NewCmd* pattern for all commands.
* Fix cross-compilation target.
* Set up service-catalog on travis
Signed-off-by: mik-dass <mrinald7@gmail.com>
* Changed odo commands to oc and moved common parts of wait functions to a new function waitForCmdOut()
Signed-off-by: mik-dass <mrinald7@gmail.com>
* Add vendor license checks to PR
This PR aims to add automatic detection of licenses of vendor-ed packages for every PR raised
to the Odo repository using a tool called [wwhrd](https://github.com/frapposelli/wwhrd) that
iterates on every vendored package, searches for the license file, detects the license type
and validates the detected license type against the different sections of the configuration
file .wwhrd.yml.
fixes#743
Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>
* Incoporate comments from @surajnarwade
Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>
* Incoporate @tkral Comments
Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>
* Add documentation about the license checks
Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>
* Incoporate @codeclimate comments
Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>
* Incoporate @cdrage comments
Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>
* Incoporate @cdrage and @kadel comments
Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>
* Incorporate @cdrage comments
Signed-off-by: anmolbabu <anmolbudugutta@gmail.com>
demo_test.go and e2e_test.go have a lot of duplicate tests. With this PR, I am moving all the component related tests to cmp_test.go, and am removing demo_test.go.
We will continue to add more component tests to cmp_test.go
In this PR, we do away with http calls on IP:Port (which failed on minishift),
but instead create a route using `odo url` and then run curl on that url.
This PR also adds a timeout option for tests. Eg. TIMEOUT=20m make test-e2e
To achieve this, two functions have been added SetupForSupervisor and CleanupAfterSupervisor in occlient.go. Also some other functions are added in occlient to add and remove initContainers, volumeMounts and volumes to the deploymentConfig. Also updateDcAnnotations in occlient is added to update the annotations in the deploymentConfig.
Signed-off-by: mdas <mrinald7@gmail.com>
Adds verbosity to the tests as well as command-line-outout:
```sh
▶ make test-e2e
go test github.com/redhat-developer/ocdev/tests/e2e -ginkgo.v
$ git clone https://github.com/openshift/nodejs-ex /tmp/ocdev807324634/nodejs-ex
Running Suite: ocdev test suite
===============================
Random Seed: 1522871416
Will run 9 of 9 specs
Usecase #5 ocdev project
should create a new project
/home/wikus/seafile/files/dev/go/src/github.com/redhat-developer/ocdev/tests/e2e/e2e_test.go:120
$ ocdev project create ocdev-1522871416
New project created and now using project : ocdev-1522871416
$ ocdev project get --short
ocdev-1522871416
•
------------------------------
Usecase #5 creating an application when application by the same name doesn't exist
should create an application
/home/wikus/seafile/files/dev/go/src/github.com/redhat-developer/ocdev/tests/e2e/e2e_test.go:129
$ ocdev application create usecase5
Creating application: usecase5
Switched to application: usecase5
$ ocdev application get --short
usecase5
•
------------------------------
Usecase #5 creating an application when application by the same name doesn't exist
should be created within the project
/home/wikus/seafile/files/dev/go/src/github.com/redhat-developer/ocdev/tests/e2e/e2e_test.go:134
$ ocdev project get --short
ocdev-1522871416
```
1. Pushing a separate PR with glide changes for depenedencies
2. The e2e tests are run with `oc cluster up` on travis:
(i) scripts/oc-cluster.sh is used to bring up an Openshift cluster.
(ii) scripts/travis-check-pods.sh is used to check if the router
and docker-register pods are running once the oc cluster is
up.
3. In `.travis.yml`, the e2e tests are run in parallel with the
other tests
Dep doesn't resolve specific versions of transitive dependecies.
This can make problems with some projects.
For example kubernetes/client-go doesn't not support dep currently.
there are two types of packages
- build from master: version number is timestamp
(YearMonthDateHourMinuteSecond) those are uploaded to
ocdev-rpm-dev and ocdev-deb-dev repositories
- build from tag: those are released version and they have normal
semver version. They are uploaded to ocdev-rpm-releses and
ocdev-deb-releases
This script uses fpm to create rpm and deb packages.
It creates binary packages, so they can't be used in any of the official distribution's repositories.
But they can be used in our repository to make it easier for users to install ocdev