Skip to content

Commit

Permalink
Rename application-generated filenames (#588)
Browse files Browse the repository at this point in the history
Changes infix used for generated `docker-compose.kev.xxx.yaml` files from `kev` to `env` (e.g. `docker-compose.env.dev.yaml`), and renames `kev,yaml` to `appmeta.yaml`
  • Loading branch information
chriswalker authored Jun 25, 2021
1 parent ab1cd94 commit dd7dff8
Show file tree
Hide file tree
Showing 69 changed files with 114 additions and 114 deletions.
2 changes: 1 addition & 1 deletion cmd/kev/cmd/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var initLongDesc = `Tracks compose sources & creates deployment environments.
Examples:
### Initialise kev.yaml with root docker-compose.yml and override file tracking. Adds a sandbox dev deployment environment.
### Initialise the project with root docker-compose.yml and override file tracking. Adds a sandbox dev deployment environment.
$ kev init
### Use an alternate docker-compose.yml file.
Expand Down
2 changes: 1 addition & 1 deletion docs/cli/kev.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ Develop Kubernetes apps iteratively using Docker-Compose.
* [kev render](kev_render.md) - Generates application's deployment artefacts according to the specified output format for a given environment (ALL environments by default).
* [kev version](kev_version.md) - Print version information.

###### Auto generated by spf13/cobra on 23-Jun-2021
###### Auto generated by spf13/cobra on 25-Jun-2021
2 changes: 1 addition & 1 deletion docs/cli/kev_dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,4 @@ kev dev [flags]

* [kev](kev.md) - Develop Kubernetes apps iteratively using Docker-Compose.

###### Auto generated by spf13/cobra on 23-Jun-2021
###### Auto generated by spf13/cobra on 25-Jun-2021
4 changes: 2 additions & 2 deletions docs/cli/kev_init.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Tracks compose sources & creates deployment environments.

Examples:

### Initialise kev.yaml with root docker-compose.yml and override file tracking. Adds a sandbox dev deployment environment.
### Initialise the project with root docker-compose.yml and override file tracking. Adds a sandbox dev deployment environment.
$ kev init

### Use an alternate docker-compose.yml file.
Expand Down Expand Up @@ -45,4 +45,4 @@ kev init [flags]

* [kev](kev.md) - Develop Kubernetes apps iteratively using Docker-Compose.

###### Auto generated by spf13/cobra on 23-Jun-2021
###### Auto generated by spf13/cobra on 25-Jun-2021
2 changes: 1 addition & 1 deletion docs/cli/kev_render.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ kev render [flags]

* [kev](kev.md) - Develop Kubernetes apps iteratively using Docker-Compose.

###### Auto generated by spf13/cobra on 23-Jun-2021
###### Auto generated by spf13/cobra on 25-Jun-2021
2 changes: 1 addition & 1 deletion docs/cli/kev_version.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ kev version [flags]

* [kev](kev.md) - Develop Kubernetes apps iteratively using Docker-Compose.

###### Auto generated by spf13/cobra on 23-Jun-2021
###### Auto generated by spf13/cobra on 25-Jun-2021
2 changes: 1 addition & 1 deletion docs/misc/reconcile.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: Misc

## Reconciling project changes

Kev tracks updates made to a project's docker-compose files (files listed in `kev.yaml`).
Kev tracks updates made to a project's docker-compose files (files listed in `appmeta.yaml`).

Kev will specifically monitor the scenarios listed here. And, then apply strategies to manage those scenarios.

Expand Down
59 changes: 30 additions & 29 deletions docs/tutorials/getting-started-with-kev.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,22 +108,22 @@ Detecting secrets in: docker-compose.yaml
✓ None detected in service: wordpress

» Creating deployment environments...
✓ Creating the dev sandbox env file: docker-compose.kev.dev.yaml
✓ Creating the local env file: docker-compose.kev.local.yaml
✓ Creating the stage env file: docker-compose.kev.stage.yaml
✓ Creating the dev sandbox env file: docker-compose.env.dev.yaml
✓ Creating the local env file: docker-compose.env.local.yaml
✓ Creating the stage env file: docker-compose.env.stage.yaml

» Detecting Skaffold settings...
Skipping - no Skaffold options detected

Project initialised!
A 'kev.yaml' file was created. Do not edit this file.
A 'appmeta.yaml' file was created. Do not edit this file.
It syncs your deployment environments to updates made
to your compose sources.

And, the following deployment env files have been created:
dev: docker-compose.kev.dev.yaml
local: docker-compose.kev.local.yaml
stage: docker-compose.kev.stage.yaml
dev: docker-compose.env.dev.yaml
local: docker-compose.env.local.yaml
stage: docker-compose.env.stage.yaml

Update these to configure your deployments per related environment.

Expand All @@ -139,25 +139,26 @@ Kev has now been initialised and configured. It has,
- Created `dev` (a sandbox used by Kev for continuous development), `local` (useful for testing on our own machine) and `staging` (useful for testing on a remote machine) _Compose environment overrides_.

It has also generated four files:
- `kev.yaml`, a manifest that describes our _source application definition_ and _Compose environment overrides_.
- Three `docker-compose.kev.*.yaml` files to represent our _Compose environment overrides_.
- `appmeta.yaml`, a project metadata file that describes our _source application definition_ and _Compose environment overrides_.
- Three `docker-compose.env.*.yaml` files to represent our _Compose environment overrides_.

#### Manifest: kev.yaml
#### Project metadata file

The `appmeta.yaml` metadata file contains references to all required files in the conversion process. Its creation confirms a successful `init`,

The `kev.yaml` manifest file confirms a successful `init`,
```yaml
id: b903b060-9762-4a59-8131-47e129f70256
compose:
- docker-compose.yaml
environments:
dev: docker-compose.kev.dev.yaml
local: docker-compose.kev.local.yaml
stage: docker-compose.kev.stage.yaml
dev: docker-compose.env.dev.yaml
local: docker-compose.env.local.yaml
stage: docker-compose.env.stage.yaml
```
#### Compose environment overrides: docker-compose.kev.*.yaml
#### Compose environment overrides files
The created `dev`, `local` and `stage` _Compose environment overrides_ are currently identical.
The created `docker-compose.env.dev.yaml` (and `local` and `stage` equivalents) are generated for each of the `-e` switches we used in the `kev init` command. These _Compose environment overrides_ are currently identical.

The `x-k8s` extension section for each service enables you to control how the app runs on Kubernetes. See the [configuration reference](../reference/config-params.md) to find all the available options and understand how they affect deployments.

Expand Down Expand Up @@ -205,29 +206,29 @@ Detecting secrets in: docker-compose.yaml
✓ None detected in service: wordpress
» Validating compose environment overrides...
Detecting secrets in: docker-compose.kev.dev.yaml
Detecting secrets in: docker-compose.env.dev.yaml
✓ None detected in service: wordpress
Detecting secrets in: docker-compose.kev.local.yaml
Detecting secrets in: docker-compose.env.local.yaml
✓ None detected in service: wordpress
Detecting secrets in: docker-compose.kev.stage.yaml
Detecting secrets in: docker-compose.env.stage.yaml
✓ None detected in service: wordpress
» Detecting project updates...
dev: docker-compose.kev.dev.yaml
dev: docker-compose.env.dev.yaml
✓ No version update detected
✓ No service additions detected
✓ No service removals detected
✓ No env var removals detected
✓ No volume additions detected
✓ No volume removals detected
local: docker-compose.kev.local.yaml
local: docker-compose.env.local.yaml
✓ No version update detected
✓ No service additions detected
✓ No service removals detected
✓ No env var removals detected
✓ No volume additions detected
✓ No volume removals detected
stage: docker-compose.kev.stage.yaml
stage: docker-compose.env.stage.yaml
✓ No version update detected
✓ No service additions detected
✓ No service removals detected
Expand All @@ -236,19 +237,19 @@ stage: docker-compose.kev.stage.yaml
✓ No volume removals detected
» Rendering manifests, format: kubernetes...
dev: docker-compose.kev.dev.yaml
dev: docker-compose.env.dev.yaml
✓ Converted service: wordpress
| rendered Deployment
| rendered Service
✓ Networking
| rendered NetworkPolicy
local: docker-compose.kev.local.yaml
local: docker-compose.env.local.yaml
✓ Converted service: wordpress
| rendered Deployment
| rendered Service
✓ Networking
| rendered NetworkPolicy
stage: docker-compose.kev.stage.yaml
stage: docker-compose.env.stage.yaml
✓ Converted service: wordpress
| rendered Deployment
| rendered Service
Expand Down Expand Up @@ -420,7 +421,7 @@ https://github.com/appvia/kev/blob/master/docs/reference/config-params.md#refere
...
» Rendering manifests, format: kubernetes...
dev: docker-compose.kev.dev.yaml
dev: docker-compose.env.dev.yaml
✓ Converted service: db
| rendered StatefulSet
| rendered Service
Expand All @@ -429,7 +430,7 @@ dev: docker-compose.kev.dev.yaml
...
✓ Networking
...
local: docker-compose.kev.local.yaml
local: docker-compose.env.local.yaml
✓ Converted service: db
| rendered StatefulSet
| rendered Service
Expand All @@ -438,7 +439,7 @@ local: docker-compose.kev.local.yaml
...
✓ Networking
...
stage: docker-compose.kev.stage.yaml
stage: docker-compose.env.stage.yaml
✓ Converted service: db
| rendered StatefulSet
| rendered Service
Expand Down Expand Up @@ -536,7 +537,7 @@ As it happens, we have a requirement that our `stage` environment should mirror

In this case, we need to run 5 instances of the `wordpress` service to simulate how the app works in a heavy user traffic setting.

Let's make this happen. We need to edit our `docker-compose.kev.stage.yaml` Compose environment override file.
Let's make this happen. We need to edit our `docker-compose.env.stage.yaml` Compose environment override file.

We'll change the: `x-k8s.workload.replicas` value from 1 to 5.

Expand Down
6 changes: 3 additions & 3 deletions docs/tutorials/kev-dev-with-skaffold.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ This command prepares your application and bootstraps a new Skaffold config (_sk

#### Retrofit Skaffold support in existing Kev project

If a Kev project has been previously initialised without Skaffold support, the easiest way forward to adopt Skaffold is to remove _kev.yaml_ file and initialize the project again.
If a Kev project has been previously initialised without Skaffold support, the easiest way forward to adopt Skaffold is to remove _appmeta.yaml_ file and initialize the project again.

**Note:** Be mindful that names of all the environments you want to track must be specified - Kev `init` won't automatically discover existing environment override files!

Alternatively, use `skaffold init` to bootstrap _skaffold.yaml_ and tell Kev about the fact by adding the following line in _kev.yaml_ file:
Alternatively, use `skaffold init` to bootstrap _skaffold.yaml_ and tell Kev about the fact by adding the following line in _appmeta.yaml_ file:

```sh
# Initialize Skaffold in your project
Expand All @@ -55,7 +55,7 @@ Alternatively, use `skaffold init` to bootstrap _skaffold.yaml_ and tell Kev abo
skaffold init
```

And then add the following line to the `kev.yaml` file.
And then add the following line to the `appmeta.yaml` file.

```yaml
compose:
Expand Down
8 changes: 4 additions & 4 deletions docs/tutorials/quickstart-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ It makes use of,
Creating the files below in your project directory:

```sh
├── docker-compose.kev.dev.yaml # dev sandbox Compose environment override file
├── docker-compose.kev.prod.yaml # prod Compose environment override file
├── docker-compose.kev.stage.yaml # stage Compose environment override file
├── kev.yaml # kev project manifest
├── docker-compose.env.dev.yaml # dev sandbox Compose environment override file
├── docker-compose.env.prod.yaml # prod Compose environment override file
├── docker-compose.env.stage.yaml # stage Compose environment override file
├── appmeta.yaml # kev project manifest
├── ...
```

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/simple-nodejs-app-ci-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ You will notice the staging environment configuration file has been created:
> Added environment specific override files:
```sh
...
|- docker-compose.kev.staging.yaml # staging env
|- docker-compose.env.staging.yaml # staging env
```

Adjust your Kubernetes `staging` application parameters for each of the components as needed. This is done via Compose [extensions](../../docs/reference/config-params.md).
Expand Down
6 changes: 3 additions & 3 deletions docs/tutorials/simple-nodejs-app-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ You will notice that 3 separate environment specific configuration files have be

> Added environment specific override files:
```sh
|- docker-compose.kev.dev.yaml
|- docker-compose.kev.staging.yaml
|- docker-compose.kev.prod.yaml
|- docker-compose.env.dev.yaml
|- docker-compose.env.staging.yaml
|- docker-compose.env.prod.yaml
```

(The `dev` configuration is created by default by kev).
Expand Down
4 changes: 2 additions & 2 deletions e2e/helper.bash
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ setup() {
}

teardown() {
[ -f "$BATS_TEST_DIRNAME/kev.yaml" ] && rm -f "$BATS_TEST_DIRNAME/kev.yaml"
[ -f "$BATS_TEST_DIRNAME/docker-compose.kev.$E2E_KEV_ENV.yaml" ] && rm -rf "$BATS_TEST_DIRNAME/docker-compose.kev.$E2E_KEV_ENV.yaml"
[ -f "$BATS_TEST_DIRNAME/appmeta.yaml" ] && rm -f "$BATS_TEST_DIRNAME/appmeta.yaml"
[ -f "$BATS_TEST_DIRNAME/docker-compose.env.$E2E_KEV_ENV.yaml" ] && rm -rf "$BATS_TEST_DIRNAME/docker-compose.env.$E2E_KEV_ENV.yaml"
[ -d "$TMP/k8s" ] && rm -rf "$TMP/k8s"
cd -
}
Expand Down
8 changes: 4 additions & 4 deletions examples/wordpress-mysql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ It also contains all the _Kev_ artefacts required to migrate the app from a Dock
Project structure:
```
.
├── docker-compose.kev.dev.yaml
├── docker-compose.kev.local.yaml
├── docker-compose.kev.stage.yaml
├── docker-compose.env.dev.yaml
├── docker-compose.env.local.yaml
├── docker-compose.env.stage.yaml
├── docker-compose.yaml
├── kev.yaml
├── appmeta.yaml
└── README.md
```
7 changes: 7 additions & 0 deletions examples/wordpress-mysql/appmeta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
id: 98b5e7c9-4a40-4006-bb5e-57e496b183c4
compose:
- docker-compose.yaml
environments:
dev: docker-compose.env.dev.yaml
local: docker-compose.env.local.yaml
stage: docker-compose.env.stage.yaml
7 changes: 0 additions & 7 deletions examples/wordpress-mysql/kev.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions pkg/kev/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ var _ = Describe("InitRunner", func() {
})

It("should contain an override environment", func() {
filename := filepath.Join(workingDir, "compose.kev.dev.yml")
filename := filepath.Join(workingDir, "compose.env.dev.yml")
Expect(results).To(ContainElement(kev.WritableResult{WriterTo: env, FilePath: filename}))
})
})
Expand All @@ -83,7 +83,7 @@ var _ = Describe("InitRunner", func() {
Expect(buffer.String()).To(ContainSubstring("compose:"))
Expect(buffer.String()).To(MatchRegexp(`.*- .*compose.yml`))
Expect(buffer.String()).To(ContainSubstring("environments:"))
Expect(buffer.String()).To(MatchRegexp(`dev: .*compose.kev.dev.yml`))
Expect(buffer.String()).To(MatchRegexp(`dev: .*compose.env.dev.yml`))
})
})

Expand Down
2 changes: 1 addition & 1 deletion pkg/kev/init_ui_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ var _ = Describe("InitRunner UI", func() {
Expect(err).NotTo(HaveOccurred())

Expect(log.NextHeader()).To(HaveKeyWithValue("Creating deployment environments...", []string{}))
Expect(log.NextStep()).To(HaveKeyWithValue("Creating the dev sandbox env file: testdata/init-default/compose-yml/compose.kev.dev.yml", []string{}))
Expect(log.NextStep()).To(HaveKeyWithValue("Creating the dev sandbox env file: testdata/init-default/compose-yml/compose.env.dev.yml", []string{}))
Expect(log.NextStep()).To(HaveKeyWithValue("Success", []string{}))
})
})
Expand Down
2 changes: 1 addition & 1 deletion pkg/kev/kev.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const (

var (
// ManifestFilename is a name of main application manifest file
ManifestFilename = "kev.yaml"
ManifestFilename = "appmeta.yaml"
SecretsReferenceUrl = "https://github.com/appvia/kev/blob/master/docs/reference/config-params.md#reference-k8s-secret-key-value"
)

Expand Down
Loading

0 comments on commit dd7dff8

Please sign in to comment.