Commit Graph

120 Commits

Author SHA1 Message Date
Ratnadeep Debnath
6f3e670af1 Refactor openshift buildconfig CLI options.
- Remove --buildconfig, -bc option. Create buildconfig if service has build info
- Rename --branch to --build-branch
- Rename --repo to --build-repo
2016-12-28 17:00:33 +05:30
Ratnadeep Debnath
fa724fe12d Allow specifying repo,branch info for buildconfig over CLI. 2016-12-28 17:00:33 +05:30
Charlie Drage
1b9228e696 Switch to spf13/cobra from urfave/cli
There's A LOT happening in this commit, so here's an outline:

First off, urfave/cli has been removed in favour of spf13/cobra. With
this, comes changes to the formatting as well as the help page for
Kompose.

Upon converting, I noticed a CLI flag was NOT appearing for OpenShift.
Specifically, --deploymentconfig. This has been added with a note
that says it is OpenShift only.

Exit codes have been fixed. If the conversion / down / up fails for
any reason, Kompose will exit with Code 1.

--verbose as well as --suppress-warnings can now be set at the
same time.

app_test.go in the cli directory has been moved to pkg/transformer
to better reflect the testing coverage.

version.go has been removed and converted to it's own CLI command in
conjuction with (most) Go software. A new CLI command has been
created. kompose version

--dab isn't a conventional way for short-form CLI paramters. This
has been shortened to -b for bundle.

CLI flags consisting of only two/three letters have been removed due to
it being unconventional for CLI. For example, --dc was removed in preference
for --deploymentconfig

--replicas has been added as an option when using kompose down or
kompose up. This has been added as previously in app.go the
replica amount was hard-coded as 1.

Differentiating names have been used for flags. For example,
persistent flags use the name Global (ex. GlobalOut). Command-specific
flags have their own names (ex. UpOpt).

Closes #239 #253
2016-12-22 08:15:51 -05:00
Shubham Minglani
7e378cd546 implement expose service, add tests, fix #140
Implements a kompose specific docker compose label "kompose.service.expose" which can be used to expose the specified services externally. The accepted values are of type string.
If the value is set to "true", the provider sets the endpoint automatically, and for any other value, the value is set as the hostname. If multiple ports are defined in a service, the first one is chosen to be the exposed.

Unit tests, functional tests, glide updates and docs have also been added in this commit for the related feature.
2016-12-21 20:00:38 +05:30
Shubham Minglani
365fe81987 implement storing to dir/file, add tests
When kompose convert -o artifacts is run, then if artifacts is a directory,
kompose stores all the resulting files inside it, and if it's not a directory,
it stores the artifacts in a single file.

Fixes #209
2016-12-21 18:12:43 +05:30
Tomas Kral
b0514bd2dd Merge pull request #259 from kadel/lint-and-vet
Add `go vet`,  and `gofmt` tests.
2016-11-25 09:49:15 +01:00
Tomas Kral
4e42a07be2
gofmt 2016-11-22 13:02:31 +01:00
Tomas Kral
c441610b4f
fix govet errors 2016-11-22 13:02:31 +01:00
Charlie Drage
94754146dd Clean up the logging output for unknown provider 2016-11-16 13:04:47 -05:00
Christopher A. Baumbauer
fc673974c4 Added flag definitions for kompose #37 2016-11-09 15:12:59 -08:00
sebgoa
00331589a3 Fix license headers, This closes #223 2016-11-01 15:01:27 +01:00
Tuna
e909f9f959 Merge pull request #227 from ngtuna/go-getable
make kompose go get-able
2016-10-30 16:55:09 +01:00
Dusty Mabe
7349dc9c9f
cli: add --emptyvols to Up/Down 2016-10-28 16:05:59 -04:00
Dusty Mabe
f67fca8be1
cli: move emtpyvols to common convert options 2016-10-28 16:05:59 -04:00
Dusty Mabe
9ce3f0cf15
cli: add --emptyvols option 2016-10-28 16:05:59 -04:00
Tuna
d68bc40458 make kompose get-able 2016-10-28 01:24:08 +02:00
Dusty Mabe
51dea8283a
transformers: add Opt variable as object data
This is so you can set Opts on instance creation of
kubernetes.Kubernetes and openshift.Openshift. This is useful
so that we can pass option information arround without having
to do it on the call stack every time.
2016-10-27 11:48:35 -04:00
Dusty Mabe
c5e07f4926
transformers: make Openshift Inherit from Kubernetes 2016-10-27 11:48:24 -04:00
Tomas Kral
414645d73c Merge pull request #211 from procrypt/unknown_args
remove unknown args and added tests
2016-10-26 14:37:08 +02:00
Abhishek
1c3092150f remove unknown args and added tests 2016-10-21 12:08:09 +05:30
Chris Baumbauer
d3142c7435 wrong global --bundle/--dab input #198 2016-10-19 09:29:04 -07:00
sebgoa
53b15bbc8c remove skippbox reference in usage 2016-10-19 16:45:47 +02:00
Tomas Kral
5e1a5cbb3b
kompose up for openshift
kompose --provider openshift up
2016-10-18 12:03:50 +02:00
Tomas Kral
f8f737be7b
move to kubernetes-incubator
update imports to reflect move to kubernetes-incubator
2016-10-17 18:14:29 +02:00
Suraj Deshmukh
b969f7aa44 --provider global flag for kompose
Now a user can select a provider using global flag
--provider=openshift to select openshift provider
or --provider-kubernetes to select kubernetes provider
if nothing is provided kubernetes is the default provider.

Fixes #179
2016-10-06 09:37:54 +05:30
Tomas Kral
21cc608eec Merge pull request #166 from kadel/multiprovider-up
Prepare up/down for other providers
2016-09-28 15:32:06 +02:00
Tomas Kral
55f6e75573 Merge pull request #160 from kadel/add-imagestream
OpenShift - generate DeploymentConfig with ImageStream
2016-09-28 15:31:39 +02:00
Tomas Kral
6f1d01a809
OpenShift - generate DeploymentConfig with ImageStream. 2016-09-27 10:28:11 +02:00
Tuna
d15183dfe6 support -o - to stdout
fix #169
2016-09-26 23:29:21 +02:00
Tomas Kral
799345a6f9
Prepare up/down for other providers 2016-09-26 11:31:07 +02:00
Tomas Kral
c593ff8e44 Merge pull request #168 from kadel/global-dab
Make --dab/--bundle global flag
2016-09-26 11:19:43 +02:00
Tomas Kral
3ce0519a82
Make --dab global flag 2016-09-23 15:11:04 +02:00
Tomas Kral
16ca1aa136
kompose up - Get namespace from kubeconfig 2016-09-22 13:08:13 +02:00
Suraj Deshmukh
57c460cc50 dded flag --suppress-warnings, --verbose, --error-on-warning global flags
- `--suppress-warnings` it ignores all warnings.
- `--verbose` displays everything
- `--error-on-warning` with any warning exits displaying error.

Fixes #100
2016-09-16 10:37:43 +05:30
Tuna
0bad1674b5 make --file as global flag 2016-09-06 22:36:12 +07:00
Tomas Kral
e2da0f089a
Make sure that Services are first in the List
Sorts objects in Transform function, this should
make sure that Services are first everywhere as
long as we keep order in the slice that Transform returns.

fixes #130
2016-09-02 10:09:00 +02:00
Tuna
f2769066ca only print warning and keep deleting objects 2016-09-02 10:10:48 +07:00
Tuna
aafba39a42 use reapers to delete objects 2016-09-02 10:10:48 +07:00
Tuna
e08ab06f2c support kompose down 2016-09-02 10:10:48 +07:00
runseb
aa71e96175 improve messages of kompose up 2016-08-31 15:54:54 +02:00
Tuna
82ae7fab78 clean code 2016-08-25 00:34:54 +07:00
Janet Kuo
14726f1a53 Add unit test for komposeConvert 2016-08-12 18:21:56 -07:00
Tuna
baedd92036 move k8s base functions into k8s package 2016-08-12 00:46:03 +07:00
Tuna
f10d6afecf make loader, transformer as interfaces 2016-08-11 23:33:45 +07:00
Tuna
d532b29d95 clean code 2016-08-11 23:31:20 +07:00
Tuna
e867d35e39 creat kobject package, make loader and transformer refering to it 2016-08-11 23:31:20 +07:00
Tuna
85b0b6a2b8 breaking app.go into loader and transformer, to be continue 2016-08-11 23:28:49 +07:00
Suraj Deshmukh
04d1d65552 Output List kind object when using stdout
Now user gets a `List` kind object when putting eveything on
stdout or in a single file.

Fixes #73
2016-08-11 09:12:45 +00:00
Tuna
14cf356a08 Merge pull request #90 from ngtuna/unsupported-keys
enhance warning: networks, network config, volume config. Fixes #88, #71
2016-08-10 10:27:15 +07:00
Tuna
908a2563f1 fixing typos 2016-08-10 10:09:27 +07:00