This adds support for building and pushing docker containers
when you perform either `kompose convert` or `kompose up`.
Docker Compose files who have build parameters with their respective
image and build keys will automatically be both built and pushed.
This does a major refactor on the compose.go functions as well as brings
in a new era of v3 support to Kompose.
Similar to how we utilize libcompose, we utilize docker/cli's "stack
deploy" code which has a built-in v3 parser. We convert the parsed
structure to our own and then convert it to Kubernetes/OpenShift
artifacts.
If test in `make test-cmd` is failing, now it will show diff so that
it will be easy to debug.
for example,
```
===> Starting test <===
convert::expect_success_and_warning: Running: 'kompose -f /home/snarwade/go/src/github.com/kubernetes-incubator/kompose/script/test/fixtures/service-name-change/docker-compose.yml convert --stdout -j' expected_output: '/home/snarwade/go/src/github.com/kubernetes-incubator/kompose/script/test/fixtures/service-name-change/output-k8s.json' expected_warning: 'Unsupported root level volumes key - ignoring'
WARN Unsupported root level volumes key - ignoring
WARN Unsupported depends_on key - ignoring
103c103
< "value": "bitnami_wordpres"
---
> "value": "bitnami_wordpress"
FAIL: converted output does not match
```
* Two new scripts testing kompose-specific labels have been added:
script/test_in_openshift/tests/routes-service-expose-hostname.sh
script/test_in_openshift/tests/routes-service-expose-true.sh
* Tests for buildconfig dockerfile construct has been added:
script/test_in_openshift/tests/buildconfig_dockerfile.sh
* Tests for restart option:
script/test_in_openshift/tests/restart-options.sh
* Ability to run individual scripts: Changes have been made to script/test_in_openshift/run.sh
for running individual scripts:
Eg. ./script/test_in_openshift/run.sh script/test_in_openshift/tests/routes-service-expose-true.sh
now args provided under build in docker-compose file can be available in buildconfig.
it solves #406
Added unit test and functional test
solves #445
Separated key:"value" pairs by spaces
Resolves#576
This PR includes `output-os-template.json` in `nginx-node-redis` example,
which is basically output template contains `%URI%` and `%REF%` variables
which will be filled while initializing test cases and new will be stored as
`/tmp/output-os.json`
This will remove the problem of git uri and ref.
* This PR adds functional tests for kompose up/down. The test scripts
are hosted under script/test_in_openshift. The directory structure,
as follows:
script/test_in_openshift/
├── compose-files
│ └── docker-compose-command.yml
├── lib.sh
├── run.sh
└── tests
├── buildconfig.sh
├── entrypoint-command.sh
├── etherpad.sh
└── redis-replica-2.sh
* script/test_in_openshift/run.sh is the master script
which executes all the tests
* script/test_in_openshift/lib.sh consists of helper functions
for `kompose up` and `kompose down` checks
* script/test_in_openshift/tests directory consists of test scripts
* The scripts use 'oc cluster up' for setting up a single-machine
OpenShift cluster. It exits if oc binaries are not installed
* Most of the docker compose files used are the ones already
available in examples/ or script/test/fixtures.
* How to run the tests: 'make test-openshift'
Removes the '$CLI' portion of uploading the binaries / tarballs. Had a
naming error when uploading.
Updates it so we cd to `bin` so we can create the tarballs without the
`/bin` folder being located within it.
Updates the release script to use the actual GOPATH directory as
previous problems with commit hashes / versions in `kompose version`.
Cleans this up in regards to all the `cd` and `cd ..` commands.
No need to `git clone`.
fixes#445
This PR was partially fixed by docker/libcompose#450, which now gives consistent build context,
also it modifies the function getAbsBuildContext to create accurate build context, Unit test are being modified
according to new structure.
If we have a docker-file with root level volumes and we do a kompose up
using that docker-file, libcompose will add an additional _ followed by
the current directory name. Since kubernetes doesn't allow _ in the
objects created so kompose up will fail to deploy it. As a solution we
replace _ to - and we can then deploy it successfully.
This PR uses the "SelectorFromSet()" function which takes alabel or
selector as an argument returns all the object that uses that label or
selector. Once we get the object that uses a particular label we can
further do the delete operation on them. This is similar to "kubectl
delete <object> --selector=<key>=<value>". Also the label has been
modified from service to io.kompose.service.
This adds the functionality for Travis to sync with http://kompose.io in
regards to "syncing" the docs directory in master and the docs within
gh-pages.
Two things are added:
script/sync-docs/sh
script/deploy_key.enc
The encrypted key follows the conventions here:
https://gist.github.com/domenic/ec8b0fc8ab45f39403dd
and the functionality of running: `travis encrypt-file encrypt_key`
The script is ran each-time a PR is merged (and only if it's
sucessful!) as per the modifications in `.travis.yml`.
Thus each time we make a change in master, there's no need to open up
another PR for syncing the changes with `gh-pages`.