From d2d87bb36adaadd73a9a661120a9514a07d6194b Mon Sep 17 00:00:00 2001 From: "andrebriggs@users.noreply.github.com" Date: Tue, 25 Feb 2020 14:31:33 -0800 Subject: [PATCH] Updating to 0.5.4 --- CHANGELOG.md | 6 ++++ docs/commands/data.json | 65 +++++++++++++++++++++-------------------- package.json | 2 +- 3 files changed, 40 insertions(+), 33 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d87e3d582..4e5c511ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # RELEASE NOTES +## [0.5.4] - 2020-02-25 + +### Changed + +- Various bug fixes and refactoring + ## [0.5.3] - 2020-02-19 ### Changed diff --git a/docs/commands/data.json b/docs/commands/data.json index 011374cc0..79ff72c32 100644 --- a/docs/commands/data.json +++ b/docs/commands/data.json @@ -39,8 +39,7 @@ }, { "arg": "--p1 ", - "description": "Identifier for the first pipeline", - "defaultValue": "" + "description": "Identifier for the first pipeline" }, { "arg": "--image-tag ", @@ -78,6 +77,10 @@ { "arg": "--manifest-commit-id ", "description": "Commit Id in the manifest repository" + }, + { + "arg": "--repository ", + "description": "URL of the repository (SRC, HLD, Manifest)" } ] }, @@ -241,7 +244,8 @@ "required": false, "defaultValue": "definitions/traefik2" } - ] + ], + "markdown": "## Description\n\nInitializes the HLD repository by creating the pipeline\n`manifest-generation.yaml` file, and the default `component.yaml` for\n[fabrikate](https://github.com/microsoft/fabrikate) to consume, if each does not\nalready exist.\n\nThe created `component.yaml` will be populated with a traefik2 definition by\ndefault:\n\n```\nname: default-component\nsubcomponents:\n - name: traefik2\n method: git\n source: 'https://github.com/microsoft/fabrikate-definitions.git'\n path: definitions/traefik2\n```\n\nHowever, you can set a another fabrikate definition to be added instead via the\n`--default-component-*` flags.\n" }, "hld install-manifest-pipeline": { "command": "install-manifest-pipeline", @@ -263,11 +267,6 @@ "description": "Organization Name for Azure DevOps", "defaultValue": "" }, - { - "arg": "-r, --hld-name ", - "description": "HLD Repository Name in Azure DevOps", - "defaultValue": "" - }, { "arg": "-u, --hld-url ", "description": "HLD Repository URL", @@ -294,13 +293,15 @@ "required": false, "defaultValue": "master" } - ] + ], + "markdown": "## Description\n\nAfter merging the azure-pipelines yaml file generated by the init step above\ninto the `master` branch, run the following command to install the HLD to\nManifest pipeline. This pipeline will be triggered on commits to master and\ninvoke \"manifest generation\"\n[(via fabrikate)](https://github.com/microsoft/fabrikate), rendering helm charts\nand configuration into Kubernetes yaml.\n" }, "hld reconcile": { "command": "reconcile ", "alias": "r", "description": "Reconcile a HLD with the services tracked in bedrock.yaml.", - "options": [] + "options": [], + "markdown": "## Description\n\nThe reconcile feature scaffolds a HLD with the services in the `bedrock.yaml`\nfile at the root level of the application repository. Recall that in a\nmono-repo, `spk service create` will add an entry into the `bedrock.yaml`\ncorresponding to all tracked services. When the service has been merged into\n`master` of the application repository, a pipeline (see `hld-lifecycle.yaml`,\ncreated by `spk project init`) runs `spk hld reconcile` to add any _new_\nservices tracked in `bedrock.yaml` to the HLD.\n\nThis command is _intended_ to be run in a pipeline (see the generated\n`hld-lifecycle.yaml` created from `spk project init`), but can be run by the\nuser in a CLI for verification.\n\nFor a `bedrock.yaml` file that contained within the\n`https://dev.azure.com/foo/bar/_git` repository, that has the following\nstructure:\n\n```\nrings:\n master:\n isDefault: true\nservices:\n ./services/fabrikam:\n displayName: 'fabrikam'\n k8sBackendPort: 8001\n k8sBackend: 'fabrikam-k8s-svc'\n pathPrefix: 'fabrikam-service'\n pathPrefixMajorVersion: 'v1'\n helm:\n chart:\n branch: master\n git: 'https://dev.azure.com/foo/bar/_git'\n path: stable/fabrikam-application\n middlewares:\n - ''\nvariableGroups:\n - fabrikam-vg\n```\n\nA HLD is produced that resembles the following:\n\n```\n├── component.yaml\n└── fabrikam\n ├── access.yaml\n ├── component.yaml\n ├── config\n │   └── common.yaml\n └── fabrikam\n ├── component.yaml\n ├── config\n │   └── common.yaml\n └── master\n ├── component.yaml\n ├── config\n │   └── common.yaml\n └── static\n ├── ingress-route.yaml\n └── middlewares.yaml\n```\n\nWith the `ingress-route.yaml` representing a\n[Traefik2 Ingress Route](https://docs.traefik.io/routing/providers/kubernetes-crd/#kind-ingressroute)\nbacked by a Kubernetes Service, and the `middlewares.yaml` representing a\n[Traefik2 Middleware](https://docs.traefik.io/routing/providers/kubernetes-crd/#kind-middleware)\nthat strips path prefixes.\n\nFor the `bedrock.yaml` shown above, the `ingress-route.yaml` produced is:\n\n```\napiVersion: traefik.containo.us/v1alpha1\nkind: IngressRoute\nmetadata:\n name: fabrikam-master\nspec:\n routes:\n - kind: Rule\n match: 'PathPrefix(`/v1/fabrikam-service`) && Headers(`Ring`, `master`)'\n middlewares:\n - name: fabrikam-master\n services:\n - name: fabrikam-k8s-svc-master\n port: 8001\n```\n\nAnd the `middlewares.yaml` produced is:\n\n```\napiVersion: traefik.containo.us/v1alpha1\nkind: Middleware\nmetadata:\n name: fabrikam-master\nspec:\n stripPrefix:\n forceSlash: false\n prefixes:\n - /v1/fabrikam-service\n```\n\nNote that there exists a third generated file, `access.yaml`. For the above\n`bedrock.yaml`, `access.yaml` contains a single line, which represents a\n[Fabrikate access.yaml definition](https://github.com/microsoft/fabrikate/blob/master/docs/auth.md#accessyaml),\nallowing Fabrikate to pull Helm Charts that are contained within the same\napplication repository:\n\n```\n'https://dev.azure.com/foo/bar/_git': ACCESS_TOKEN_SECRET\n```\n\nWhen `fabrikate` is invoked in the HLD to Manifest pipeline, it will utilize the\n`ACCESS_TOKEN_SECRET` environment variable injected at pipeline run-time as a\nPersonal Access Token to pull any referenced helm charts from the application\nrepository.\n" }, "infra generate": { "command": "generate", @@ -318,7 +319,7 @@ "required": false } ], - "markdown": "## Description\n\nCreates a \"generated\" deployment folder with the completed Terraform files based\non definitions provided from a scaffolded project.\n\nIt will do the following:\n\n- Check if a provided project folder contains a `definition.yaml`\n- Verify the configuration of parent and leaf definitions.\n- Check if the terraform template `source` provided has a valid remote\n repository.\n- Clone and cache the master version of the provided `source` repository locally\n in `~/.spk/templates`\n > Cached repositories will be converted through regex for spk to hash. (i.e. a\n > `source` template of `https://github.com/microsoft/bedrock` will be cached\n > into a folder called `_microsoft_bedrock_git`)\n- Create a \"generated\" directory for Terrform deployments (alongside the\n scaffolded project directory)\n- Copy the appropriate Terraform templates to the \"generated\" directory\n- Create a `spk.tfvars` in the generated directory based on the variables\n provided in `definition.yaml` files of the parent and leaf directories.\n\n## Example\n\nAssuming you have the following setup:\n\n```\nfabrikam\n |- definition.yaml\n |- east/\n |- definition.yaml\n |- central/\n |- definition.yaml\n```\n\nWhen executing the following command **in the `fabrikam` directory**:\n\n```\nspk infra generate --project east\n```\n\nThe following hiearchy of directories will be generated _alongside_ the targeted\ndirectory. In addition, the appropriate versioned Terraform templates will be\ncopied over to the leaf directory with a `spk.tfvars`, which contains the\nvariables accumulated from parent **and** leaf definition.yaml files, where if a\nvariable exists in both parent and leaf definition, the **leaf definitions will\ntake precedence**.\n\n```\nfabrikam\n |- definition.yaml\n |- east/\n |- definition.yaml\n |- central/\n |- definition.yaml\nfabrikam-generated\n |- east\n |- main.tf\n |- variables.tf\n |- spk.tfvars (concatenation of variables from fabrikam/definition.yaml (parent) and fabrikam/east/definition.yaml (leaf))\n```\n\nYou can also have a \"single-tree\" generation by executing `spk infra generate`\ninside a directory without specifying a project folder. For example, if you had\nthe following tree structure:\n\n```\nfabrikam\n |- definition.yaml\n```\n\nand executed `spk infra generate` inside the `fabrikam` directory, this will\ngenerate the following:\n\n```\nfabrikam-generated\n |- main.tf\n |- variables.tf\n |- spk.tfvars\n```" + "markdown": "## Description\n\nCreates a \"generated\" deployment folder with the completed Terraform files based\non definitions provided from a scaffolded project.\n\nIt will do the following:\n\n- Check if a provided project folder contains a `definition.yaml`\n- Verify the configuration of parent and leaf definitions.\n- Check if the terraform template `source` provided has a valid remote\n repository.\n- Clone and cache the master version of the provided `source` repository locally\n in `~/.spk/templates`\n > Cached repositories will be converted through regex for spk to hash. (i.e. a\n > `source` template of `https://github.com/microsoft/bedrock` will be cached\n > into a folder called `_microsoft_bedrock_git`)\n- Create a \"generated\" directory for Terrform deployments (alongside the\n scaffolded project directory)\n- Copy the appropriate Terraform templates to the \"generated\" directory\n- Create a `spk.tfvars` in the generated directory based on the variables\n provided in `definition.yaml` files of the parent and leaf directories.\n\n## Example\n\nAssuming you have the following setup:\n\n```\nfabrikam\n |- definition.yaml\n |- east/\n |- definition.yaml\n |- central/\n |- definition.yaml\n```\n\nWhen executing the following command **in the `fabrikam` directory**:\n\n```\nspk infra generate --project east\n```\n\nThe following hiearchy of directories will be generated _alongside_ the targeted\ndirectory. In addition, the appropriate versioned Terraform templates will be\ncopied over to the leaf directory with a `spk.tfvars`, which contains the\nvariables accumulated from parent **and** leaf definition.yaml files, where if a\nvariable exists in both parent and leaf definition, the **leaf definitions will\ntake precedence**.\n\n```\nfabrikam\n |- definition.yaml\n |- east/\n |- definition.yaml\n |- central/\n |- definition.yaml\nfabrikam-generated\n |- east\n |- main.tf\n |- variables.tf\n |- spk.tfvars (concatenation of variables from fabrikam/definition.yaml (parent) and fabrikam/east/definition.yaml (leaf))\n```\n\nYou can also have a \"single-tree\" generation by executing `spk infra generate`\ninside a directory without specifying a project folder. For example, if you had\nthe following tree structure:\n\n```\nfabrikam\n |- definition.yaml\n```\n\nand executed `spk infra generate` inside the `fabrikam` directory, this will\ngenerate the following:\n\n```\nfabrikam-generated\n |- main.tf\n |- variables.tf\n |- spk.tfvars\n```\n" }, "infra scaffold": { "command": "scaffold", @@ -350,7 +351,7 @@ "defaultValue": "" } ], - "markdown": "## Description\n\nBuilds a scaffold of an infrastructure deployment project containing a\n`definition.yaml` that enables a user to version, modify and organize terraform\ndeployments.\n\nIn detail, it will do the following:\n\n- Create a new folder with the `` you provided.\n- Clone and cache the source repo to `~.spk/templates`.\n- Provide an infrastructure deployment scaffold based on a `` git url\n for a repo that holds terraform template, a `` respective to the\n repository tag or branch to pull from, and a `