Commit Graph

122 Commits

Author SHA1 Message Date
Tomas Kral
ef8c7a7a0a
fix env substitution for docker compose v3 2017-06-20 15:16:12 +02:00
Charlie Drage
ee7961216f Merge pull request #603 from procrypt/error_with_volume_name
PVC name changes if volumes containes .(dot) in it
2017-06-19 09:39:59 -04:00
Abhishek
c8881f5aa4 update created artifacts for k8s and openshift
update created artifacts for kubernetes and openshift so that env variables are populated in a particular order
2017-06-16 12:35:27 +05:30
Suraj Deshmukh
f823a22e64 Merge pull request #590 from surajnarwade/label-fix
Failing when port is specified with labels
2017-06-15 14:56:30 +05:30
Suraj Narwade
209cda28d2 Failing when port is specified with labels
Resolves #522
Kompose will give FATAL error if labels are given but ports are not defined
2017-06-15 09:30:01 +05:30
Charlie Drage
e2f9084003 Adds both build and push support
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.
2017-06-14 10:19:12 -04:00
Abhishek
c40bb4bb3a change volume name with generated deployment file
if volumes in docker file is defined as
      volumes:
        - .:/code
    Then the PVC created by kompose will containes .(dot) in it.
       .-persistentvolumeclaim.yaml
2017-06-14 14:31:07 +05:30
Tomas Kral
89cf88f665 Merge pull request #638 from surajnarwade/show-diff
Failing test will show diff
2017-06-14 09:28:30 +02:00
Suraj Deshmukh
3be76ff32b Merge pull request #600 from cdrage/add-v3-support
Add v3 support of Docker Compose
2017-06-14 10:59:05 +05:30
Charlie Drage
2b58307191 Add v3 support
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.
2017-06-13 09:44:48 -04:00
Suraj Narwade
883d11c049 Failing test will show diff
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
```
2017-06-13 14:20:52 +05:30
Tomas Kral
aa84680d6e Merge pull request #588 from ashetty1/kompose_labels_test
Adding tests for kompose-specific labels and buildconfig dockerfile construct
2017-06-08 15:09:51 +02:00
Charlie Drage
b76ed55f82 Fix adding Jekyll format to the top
Problem with `/permalink/`. This adds a few bash lines that updates
index.md without the permalink.
2017-06-02 10:05:18 -04:00
Tomas Kral
60f46fc65e Merge pull request #628 from cdrage/update-docs-with-index
Update documentation to reflect quickstart
2017-06-02 13:14:54 +02:00
Charlie Drage
ea95f0a912 Update documentation to reflect quickstart
Adds quickstart.md from the kompose.io site as well as incorporates
changes so that you can update the index page of Kompose.io via
quickstart.md
2017-06-01 15:35:05 -04:00
Anush Shetty
fb0966f9e3 Changes to make the tests work with emptyvols 2017-05-31 15:59:52 +05:30
Suraj Narwade
581e181967 Validate dockerfilepath in buildconfig
This PR will resolve #594 by validating dockerfilepath based on whether
it is relative path or not.
2017-05-30 16:31:20 +05:30
Anush Shetty
b48b250de2 Merge remote-tracking branch 'upstream/master' into kompose_labels_test 2017-05-30 15:11:22 +05:30
Charlie Drage
270d9e779b Update version number in setup.md file in release script
This change updates setup.md to include the new version number when
doing a release.
2017-05-25 11:41:02 -04:00
Anush Shetty
5f34c7368c Merge remote-tracking branch 'upstream/master' into kompose_labels_test 2017-05-25 12:19:02 +05:30
Anush Shetty
d2ad889367 Merge remote-tracking branch 'origin/master' into kompose_labels_test 2017-05-25 12:18:29 +05:30
Anush Shetty
43fa4a3fa6 Adding tests for kompose-specific labels and buildconfig dockerfile construct
* 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
2017-05-25 12:04:51 +05:30
Suraj Deshmukh
1c64b016dc Merge pull request #592 from cdrage/change-git-command
Use old git command
2017-05-18 09:12:09 +05:30
Tomas Kral
792976da1f
some of created objects were missing io.kompose.service label
label added to BuildConfig, DaemonSet, ReplicationController, Deployment and Pod
2017-05-16 17:56:32 +02:00
Suraj Narwade
8fc262bd99 Add build_args support in buildconfig
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
2017-05-16 12:19:00 +05:30
Charlie Drage
f0c4addbaf Use old git command
Some versions of git don't have git-url (case in point on Debian 8, no
get-url on packaged git).

Use old command in getting URL.
2017-05-09 08:55:55 -04:00
Suraj Narwade
aacde86eb9 Fixes fixture test for build context
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.
2017-05-08 17:54:24 +05:30
Tomas Kral
abf81926c0 Merge pull request #460 from ashetty1/openshift_up_down_test
Adding kompose up/down tests for openshift
2017-05-02 13:35:55 +02:00
Anush Shetty
1b3d876a62 Adding OpenShift functional tests for kompose up/down
* 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'
2017-05-02 12:02:30 +05:30
Charlie Drage
ef627eef1c Release script binary upload bug, tarball bug
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.
2017-04-28 10:44:47 -04:00
Charlie Drage
f64ad32ae9 Update the release script again
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`.
2017-04-28 09:43:40 -04:00
Suraj Narwade
1eb162d697 Updated Vendoring 2017-04-27 21:38:38 +05:30
Suraj Narwade
605d643a84 Adding code for consistent build context
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.
2017-04-27 21:38:38 +05:30
Tuna
65c9cf9bd8 Merge pull request #557 from procrypt/driver_local
fix driver:local in prefixing volumes with current dir name
2017-04-27 15:25:50 +07:00
Abhishek
7eccb37c19 fix driver:local in prefixing volumes
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.
2017-04-26 20:14:22 +05:30
Abhishek
ec85012a8c typo in nginx name 2017-04-25 11:14:35 +05:30
Charlie Drage
0464d24b40 Merge pull request #511 from kadel/fix-ingress-down
add missing 'io.kompose.service' label to Route and Ingress
2017-04-12 11:47:17 -04:00
Charlie Drage
ee44a2630f Move docker-compose.yml test file to tests
Moves a file that was incorrectly being used from examples to
script/test/fixtures.
2017-04-04 09:09:12 -04:00
Suraj Narwade
df014bebd6 Fixed functional tests
Fixes #431

fixed commands where output showing `command not found` and k8s output
added for restart-options example.
2017-03-30 15:06:57 +05:30
Tomas Kral
f8da61436e
add missing 'io.kompose.service' label to Route and Ingress
This was caussing 'kompose down' not to delete Route and Ingress
2017-03-24 14:42:53 +01:00
Tomas Kral
3c3ae9807a Merge pull request #483 from procrypt/empty_vols
delete objects based on label
2017-03-24 12:11:29 +01:00
Abhishek
55ad1d9b1f delete objects based on label
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.
2017-03-24 00:31:33 +05:30
Charlie Drage
5df9f210bf Update minor bug in syncing files
Didn't catch this when testing all the pages (saw that setup and index
worked but not others).

Removes '.md' from the permalink.
2017-03-23 12:47:13 -04:00
Charlie Drage
cf6df7190c Sync changes from master to gh-pages on each merge request
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`.
2017-03-23 10:58:19 -04:00
Tomas Kral
3411f3c94b
do not fail if there is a golint violation
golint output is just suggestion. Just show ouptut, but don't fail.
This also remove unnecessary bash script that is no longer needed.
2017-03-17 17:09:49 +01:00
Charlie Drage
4e3b1c34d7 Update release script
Had an issue where I don't git pull / merge with master after the PR has
been merged.

This adds an option to sync with master before continuing.
2017-03-03 10:48:50 -05:00
Charlie Drage
7e7a01a91a Update the release script again :) 2017-02-24 10:07:23 -05:00
Charlie Drage
858314e06b Adds mem_limit support for conversion
This commit adds mem_limit support. Taking the value from
docker-compose.yaml and converting it to it's associative value in
Kubernetes artifacts.

Closes (half) of
https://github.com/kubernetes-incubator/kompose/issues/267
2017-02-22 08:19:27 -05:00
Shubham Minglani
b73efa54f2 set strategy to Recreate if vols, add tests,docs
When volumes are specified in the Docker Compose
files, then in case of Kubernetes, Deployment's
Spec.Strategy.Type and in case of OpenShift,
DeploymentConfig's Spec.Strategy.Type are set to
"Recreate". This is a safer deployment strategy
when Volumes are getting used.

This commit also adds unit tests for Kubernetes
as well as OpenShift, and fixes the failing
functional tests (tests.sh) due to the change.

No functional tests have been added since
the functionality is already covered when the
volume mounts are being tested earlier in the
file.

This fixes #264
2017-02-20 11:44:43 +05:30
Charlie Drage
438088f37d Add support for host:port:port
This adds support for supplying for example:
"127.0.0.1:80:80/tcp" to docker-compose.yaml and converting it to it's
corresponding Kubernetes / OpenShift hostIP.

This commit also refactors the loadPorts function of compose.go

Closes https://github.com/kubernetes-incubator/kompose/issues/335
2017-02-09 12:21:17 -05:00