diff --git a/.github/actions/helm/CHANGELOG.md b/.github/actions/helm/CHANGELOG.md new file mode 100644 index 00000000..9b037bf6 --- /dev/null +++ b/.github/actions/helm/CHANGELOG.md @@ -0,0 +1,144 @@ +# Changelog + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +### [1.6.1](https://github.com/deliverybot/helm/compare/v1.6.0...v1.6.1) (2020-06-06) + + +### Bug Fixes + +* Remove colon in action.yml ([1f0d808](https://github.com/deliverybot/helm/commit/1f0d808b77f835b1547c80cdd5080a217465cefe)) + +## [1.6.0](https://github.com/deliverybot/helm/compare/v1.5.0...v1.6.0) (2020-06-06) + + +### Features + +* Add additional parameters to download a chart by url ([#23](https://github.com/deliverybot/helm/issues/23)) ([547935f](https://github.com/deliverybot/helm/commit/547935f280af50b2cb7f7fcfd08c29f367433395)) +* Add missing `helm` input parameter to action.yml ([#29](https://github.com/deliverybot/helm/issues/29)) ([8612a75](https://github.com/deliverybot/helm/commit/8612a75699d4ca8ea60072bb3350f4d26095ad27)) +* Add support for EKS clusters and fix helm v3 home issue ([#27](https://github.com/deliverybot/helm/issues/27)) ([70b15cc](https://github.com/deliverybot/helm/commit/70b15cc0dc343686882dfb9185ff67cef9d47723)), closes [#22](https://github.com/deliverybot/helm/issues/22) + +## [1.5.0](https://github.com/deliverybot/helm/compare/v1.4.0...v1.5.0) (2019-12-24) + + +### Features + +* Add timeout parameter ([#18](https://github.com/deliverybot/helm/issues/18)) ([d494b05](https://github.com/deliverybot/helm/commit/d494b05)) + +## [1.4.0](https://github.com/deliverybot/helm/compare/v1.3.0...v1.4.0) (2019-11-21) + + +### Bug Fixes + +* Pass kubeconfig var ([2b78a84](https://github.com/deliverybot/helm/commit/2b78a84)) + + +### Features + +* Update Helm 2 binary ([#15](https://github.com/deliverybot/helm/issues/15)) ([b5d5c58](https://github.com/deliverybot/helm/commit/b5d5c58)) +* Update Helm 3 binary ([#14](https://github.com/deliverybot/helm/issues/14)) ([8dc3e86](https://github.com/deliverybot/helm/commit/8dc3e86)) + +## [1.3.0](https://github.com/deliverybot/helm/compare/v1.2.0...v1.3.0) (2019-10-16) + + +### Features + +* Generated value file is last arg ([#13](https://github.com/deliverybot/helm/issues/13)) ([9e1a0cf](https://github.com/deliverybot/helm/commit/9e1a0cf)) + +## [1.2.0](https://github.com/deliverybot/helm/compare/v1.1.0...v1.2.0) (2019-09-30) + + +### Bug Fixes + +* If remove mark inactive ([3edcc80](https://github.com/deliverybot/helm/commit/3edcc80)) +* Include preview for inactive state ([4b47dd7](https://github.com/deliverybot/helm/commit/4b47dd7)) + + +### Features + +* Add delete --purge for helm2 ([de6b027](https://github.com/deliverybot/helm/commit/de6b027)) + +## [1.1.0](https://github.com/deliverybot/helm/compare/v1.0.0...v1.1.0) (2019-09-21) + + +### Bug Fixes + +* CI pipeline using GitHub actions ([7eddfb9](https://github.com/deliverybot/helm/commit/7eddfb9)) +* Helm3 compatibility on deletes ([c9eafdd](https://github.com/deliverybot/helm/commit/c9eafdd)) + + +### Features + +* Add helm3 binary ([5e2cd2f](https://github.com/deliverybot/helm/commit/5e2cd2f)) +* Remove purge flag from helm delete ([3821f46](https://github.com/deliverybot/helm/commit/3821f46)) + +## [1.0.0](https://github.com/deliverybot/helm/compare/v0.1.2...v1.0.0) (2019-09-08) + +### [0.1.2](https://github.com/deliverybot/helm/compare/v0.1.1...v0.1.2) (2019-09-08) + +### [0.1.1](https://github.com/deliverybot/helm/compare/v0.1.0...v0.1.1) (2019-09-08) + +## [0.1.0](https://github.com/deliverybot/helm/compare/v0.0.4...v0.1.0) (2019-09-08) + + +### Features + +* Canary triggered on canary track only ([671da40](https://github.com/deliverybot/helm/commit/671da40)) + +### [0.0.4](https://github.com/deliverybot/helm/compare/v0.0.3...v0.0.4) (2019-09-08) + + +### Features + +* Add migration ([10d3007](https://github.com/deliverybot/helm/commit/10d3007)) +* Add remove canary option ([5f991c6](https://github.com/deliverybot/helm/commit/5f991c6)) +* Add workers ([13efedc](https://github.com/deliverybot/helm/commit/13efedc)) +* Introduce appName for canary deployments ([6538c4c](https://github.com/deliverybot/helm/commit/6538c4c)) +* Update labels and names to app ([9387304](https://github.com/deliverybot/helm/commit/9387304)) + +### [0.0.3](https://github.com/deliverybot/helm/compare/v0.0.2...v0.0.3) (2019-09-01) + + +### Bug Fixes + +* Add value files to args ([9036930](https://github.com/deliverybot/helm/commit/9036930)) +* Default to root health ([b2d98d0](https://github.com/deliverybot/helm/commit/b2d98d0)) +* Parse secret values ([64b622a](https://github.com/deliverybot/helm/commit/64b622a)) +* Value list load if not string ([6483cd3](https://github.com/deliverybot/helm/commit/6483cd3)) + + +### Features + +* Helm chart customization ([abc7b15](https://github.com/deliverybot/helm/commit/abc7b15)) +* Templating of value files ([4b30064](https://github.com/deliverybot/helm/commit/4b30064)) + +### [0.0.2](https://github.com/deliverybot/helm/compare/v0.0.1...v0.0.2) (2019-08-31) + + +### Bug Fixes + +* Absolute path for helm chart ([e15e1e4](https://github.com/deliverybot/helm/commit/e15e1e4)) +* Add debug for kubeconfig ([bfa3f4b](https://github.com/deliverybot/helm/commit/bfa3f4b)) +* Add log and target url ([688f310](https://github.com/deliverybot/helm/commit/688f310)) +* Cat out the value file ([4d83f1e](https://github.com/deliverybot/helm/commit/4d83f1e)) +* Include debug logs about vars ([4ad9022](https://github.com/deliverybot/helm/commit/4ad9022)) +* Parse values if an object ([76181ec](https://github.com/deliverybot/helm/commit/76181ec)) +* Remove replace on vars ([e624622](https://github.com/deliverybot/helm/commit/e624622)) +* Show variables in debug ([a416967](https://github.com/deliverybot/helm/commit/a416967)) +* Undefined object opts ([ab3e5f9](https://github.com/deliverybot/helm/commit/ab3e5f9)) + + +### Features + +* Add basic app chart ([35049a2](https://github.com/deliverybot/helm/commit/35049a2)) +* Add canary support built in ([27023d5](https://github.com/deliverybot/helm/commit/27023d5)) + +### 0.0.1 (2019-08-23) + + +### Features + +* Add dry-run option to inputs ([988fedd](https://github.com/deliverybot/helm/commit/988fedd)) +* Add helm action ([1b24336](https://github.com/deliverybot/helm/commit/1b24336)) +* Add initial node_modules and package ([9005d46](https://github.com/deliverybot/helm/commit/9005d46)) +* Implement deployment status ([2069c0b](https://github.com/deliverybot/helm/commit/2069c0b)) diff --git a/.github/actions/helm/Dockerfile b/.github/actions/helm/Dockerfile new file mode 100644 index 00000000..d9595117 --- /dev/null +++ b/.github/actions/helm/Dockerfile @@ -0,0 +1,27 @@ +FROM alpine:3.10.2 + +ENV BASE_URL="https://get.helm.sh" + +ENV HELM_2_FILE="helm-v2.17.0-linux-amd64.tar.gz" +ENV HELM_3_FILE="helm-v3.4.2-linux-amd64.tar.gz" + +RUN apk add --no-cache ca-certificates \ + --repository http://dl-3.alpinelinux.org/alpine/edge/community/ \ + jq curl bash nodejs aws-cli && \ + # Install helm version 2: + curl -L ${BASE_URL}/${HELM_2_FILE} |tar xvz && \ + mv linux-amd64/helm /usr/bin/helm && \ + chmod +x /usr/bin/helm && \ + rm -rf linux-amd64 && \ + # Install helm version 3: + curl -L ${BASE_URL}/${HELM_3_FILE} |tar xvz && \ + mv linux-amd64/helm /usr/bin/helm3 && \ + chmod +x /usr/bin/helm3 && \ + rm -rf linux-amd64 && \ + # Init version 2 helm: + helm init --client-only + +ENV PYTHONPATH "/usr/lib/python3.8/site-packages/" + +COPY . /usr/src/ +ENTRYPOINT ["node", "/usr/src/index.js"] diff --git a/.github/actions/helm/LICENSE b/.github/actions/helm/LICENSE new file mode 100644 index 00000000..6c92c663 --- /dev/null +++ b/.github/actions/helm/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 deliverybot + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/.github/actions/helm/README.md b/.github/actions/helm/README.md new file mode 100644 index 00000000..854f1015 --- /dev/null +++ b/.github/actions/helm/README.md @@ -0,0 +1,159 @@ +# Helm Action + +Deploys a helm chart using GitHub actions. Supports canary deployments and +provides a built in helm chart for apps that listen over http to get your ramped +up quickly. + +View an example repository using this action at +[github.com/deliverybot/example-helm](https://github.com/deliverybot/example-helm). + +## Parameters + +### Inputs + +Inputs below are additionally loaded from the payload of the deployment event +payload if the action was triggered by a deployment. + +- `release`: Helm release name. Will be combined with track if set. (required) +- `namespace`: Kubernetes namespace name. (required) +- `chart`: Helm chart path. If set to "app" this will use the built in helm + chart found in this repository. (required) +- `chart_version`: The version of the helm chart you want to deploy (distinct from app version) +- `values`: Helm chart values, expected to be a YAML or JSON string. +- `track`: Track for the deployment. If the track is not "stable" it activates + the canary workflow described below. +- `task`: Task name. If the task is "remove" it will remove the configured helm + release. +- `dry-run`: Helm dry-run option. +- `token`: Github repository token. If included and the event is a deployment + then the deployment_status event will be fired. +- `value-files`: Additional value files to apply to the helm chart. Expects a + JSON encoded array or a string. +- `secrets`: Secret variables to include in value file interpolation. Expects a + JSON encoded map. +- `helm`: Helm binary to execute, one of: [`helm`, `helm3`]. +- `version`: Version of the app, usually commit sha works here. +- `timeout`: specify a timeout for helm deployment +- `repository`: specify the URL for a helm repo to come from + +Additional parameters: If the action is being triggered by a deployment event +and the `task` parameter in the deployment event is set to `"remove"` then this +action will execute a `helm delete $service` + +#### Versions + +- `helm`: v2.16.1 +- `helm3`: v3.0.0 + +### Environment + +- `KUBECONFIG_FILE`: Kubeconfig file for Kubernetes cluster access. + +### Value file interpolation + +The following syntax allows variables to be used in value files: + +- `${{ secrets.KEY }}`: References secret variables passed in the secrets input. +- `${{ deployment }}`: References the deployment event that triggered this + action. + +## Example + +```yaml +# .github/workflows/deploy.yml +name: Deploy +on: ['deployment'] + +jobs: + deployment: + runs-on: 'ubuntu-latest' + steps: + - uses: actions/checkout@v1 + + - name: 'Deploy' + uses: 'deliverybot/helm@v1' + with: + release: 'nginx' + namespace: 'default' + chart: 'app' + token: '${{ github.token }}' + values: | + name: foobar + value-files: >- + [ + "values.yaml", + "values.production.yaml" + ] + env: + KUBECONFIG_FILE: '${{ secrets.KUBECONFIG }}' +``` + +## Example canary + +If a track is chosen that is equal to canary, this updates the helm chart +in a few ways: + +1. Release name is changed to `{release}-{track}` (eg. myapp-canary). +2. The service is disabled on the helm chart `service.enabled=false` +3. The ingress is disabled on the helm chart `ingress.enabled=false` + +Not enabling the service or ingress allows the stable ingress and service +resources to pick up the canary pods and route traffic to them. + +```yaml +# .github/workflows/deploy.yml +name: Deploy +on: ['deployment'] + +jobs: + deployment: + runs-on: 'ubuntu-latest' + steps: + - uses: actions/checkout@v1 + + - name: 'Deploy' + uses: 'deliverybot/helm@v1' + with: + release: 'nginx' + track: canary + namespace: 'default' + chart: 'app' + token: '${{ github.token }}' + values: | + name: foobar + env: + KUBECONFIG_FILE: '${{ secrets.KUBECONFIG }}' +``` + +## Example pr cleanup + +If you are creating an environment per pull request with Helm you may have the +issue where pull request environments like `pr123` sit around in your cluster. +By using GitHub actions we can clean those up by listening for pull request +close events. + +```yaml +# .github/workflows/pr-cleanup.yml +name: PRCleanup +on: + pull_request: + types: [closed] + +jobs: + deployment: + runs-on: 'ubuntu-latest' + steps: + - name: 'Deploy' + uses: 'deliverybot/helm@v1' + with: + # Task remove means to remove the helm release. + task: 'remove' + release: 'review-myapp-${{ github.event.pull_request.number }}' + version: '${{ github.sha }}' + track: 'stable' + chart: 'app' + namespace: 'example-helm' + token: '${{ github.token }}' + env: + KUBECONFIG_FILE: '${{ secrets.KUBECONFIG }}' +``` diff --git a/.github/actions/helm/action.yml b/.github/actions/helm/action.yml new file mode 100644 index 00000000..08f6242a --- /dev/null +++ b/.github/actions/helm/action.yml @@ -0,0 +1,44 @@ +name: Deliverybot Helm Action +description: Deploys a helm chart +author: deliverybot +icon: box +color: gray-dark +inputs: + release: + description: Helm release name. Will be combined with track if set. (required) + required: true + namespace: + description: Kubernetes namespace name. (required) + required: true + chart: + description: Helm chart path. If set to "app" this will use the built in helm + chart found in this repository. (required) + required: true + values: + description: Helm chart values, expected to be a YAML or JSON string. + required: false + dry-run: + description: Task name. If the task is "remove" it will remove the configured + helm release. + required: false + helm: + description: Helm binary to execute, one of [helm, helm3]. + required: false + token: + description: Github repository token. If included and the event is a deployment + the deployment_status event will be fired. + required: false + value-files: + description: Additional value files to apply to the helm chart. Expects JSON encoded + array or a string. + required: false + secrets: + description: Secret variables to include in value file interpolation. Expects + JSON encoded map. + required: false + version: + description: Version of the app, usually commit sha works here. + required: false +runs: + using: docker + image: Dockerfile diff --git a/.github/actions/helm/index.js b/.github/actions/helm/index.js new file mode 100644 index 00000000..498334b3 --- /dev/null +++ b/.github/actions/helm/index.js @@ -0,0 +1,266 @@ +const core = require("@actions/core"); +const github = require("@actions/github"); +const exec = require("@actions/exec"); +const fs = require("fs"); +const util = require("util"); +const Mustache = require("mustache"); + +const writeFile = util.promisify(fs.writeFile); +const readFile = util.promisify(fs.readFile); +const required = { required: true }; + +/** + * Status marks the deployment status. Only activates if token is set as an + * input to the job. + * + * @param {string} state + */ +async function status(state) { + try { + const context = github.context; + const deployment = context.payload.deployment; + const token = core.getInput("token"); + if (!token || !deployment) { + core.debug("not setting deployment status"); + return; + } + + const client = new github.GitHub(token); + const url = `https://github.com/${context.repo.owner}/${context.repo.repo}/commit/${context.sha}/checks`; + + await client.repos.createDeploymentStatus({ + ...context.repo, + deployment_id: deployment.id, + state, + log_url: url, + target_url: url, + headers: { + accept: 'application/vnd.github.ant-man-preview+json' + } + }); + } catch (error) { + core.warning(`Failed to set deployment status: ${error.message}`); + } +} + +function releaseName(name, track) { + if (track !== "stable") { + return `${name}-${track}`; + } + return name; +} + +function chartName(name) { + if (name === "app") { + return "/usr/src/charts/app"; + } + return name; +} + +function getValues(values) { + if (!values) { + return "{}"; + } + if (typeof values === "object") { + return JSON.stringify(values); + } + return values; +} + +function getSecrets(secrets) { + if (typeof secrets === "string") { + try { + return JSON.parse(secrets); + } catch (err) { + return secrets; + } + } + return secrets; +} + +function getValueFiles(files) { + let fileList; + if (typeof files === "string") { + try { + fileList = JSON.parse(files); + } catch (err) { + // Assume it's a single string. + fileList = [files]; + } + } else { + fileList = files; + } + if (!Array.isArray(fileList)) { + return []; + } + return fileList.filter(f => !!f); +} + +function getInput(name, options) { + const context = github.context; + const deployment = context.payload.deployment; + let val = core.getInput(name.replace("_", "-"), { + ...options, + required: false + }); + if (deployment) { + if (deployment[name]) val = deployment[name]; + if (deployment.payload[name]) val = deployment.payload[name]; + } + if (options && options.required && !val) { + throw new Error(`Input required and not supplied: ${name}`); + } + return val; +} + +/** + * Render files renders data into the list of provided files. + * @param {Array} files + * @param {any} data + */ +function renderFiles(files, data) { + core.debug( + `rendering value files [${files.join(",")}] with: ${JSON.stringify(data)}` + ); + const tags = ["${{", "}}"]; + const promises = files.map(async file => { + const content = await readFile(file, { encoding: "utf8" }); + const rendered = Mustache.render(content, data, {}, tags); + await writeFile(file, rendered); + }); + return Promise.all(promises); +} + +/** + * Makes a delete command for compatibility between helm 2 and 3. + * + * @param {string} helm + * @param {string} namespace + * @param {string} release + */ +function deleteCmd(helm, namespace, release) { + if (helm === "helm3") { + return ["delete", "-n", namespace, release]; + } + return ["delete", "--purge", release]; +} + +/** + * Run executes the helm deployment. + */ +async function run() { + try { + const context = github.context; + await status("pending"); + + const track = getInput("track") || "stable"; + const appName = getInput("release", required); + const release = releaseName(appName, track); + const namespace = getInput("namespace", required); + const chart = chartName(getInput("chart", required)); + const chartVersion = getInput("chart_version"); + const values = getValues(getInput("values")); + const task = getInput("task"); + const version = getInput("version"); + const valueFiles = getValueFiles(getInput("value_files")); + const removeCanary = getInput("remove_canary"); + const helm = getInput("helm") || "helm"; + const timeout = getInput("timeout"); + const repository = getInput("repository"); + const dryRun = core.getInput("dry-run"); + const secrets = getSecrets(core.getInput("secrets")); + + core.debug(`param: track = "${track}"`); + core.debug(`param: release = "${release}"`); + core.debug(`param: appName = "${appName}"`); + core.debug(`param: namespace = "${namespace}"`); + core.debug(`param: chart = "${chart}"`); + core.debug(`param: chart_version = "${chartVersion}"`); + core.debug(`param: values = "${values}"`); + core.debug(`param: dryRun = "${dryRun}"`); + core.debug(`param: task = "${task}"`); + core.debug(`param: version = "${version}"`); + core.debug(`param: secrets = "${JSON.stringify(secrets)}"`); + core.debug(`param: valueFiles = "${JSON.stringify(valueFiles)}"`); + core.debug(`param: removeCanary = ${removeCanary}`); + core.debug(`param: timeout = "${timeout}"`); + core.debug(`param: repository = "${repository}"`); + + + // Setup command options and arguments. + const args = [ + "upgrade", + release, + chart, + "--install", + "--wait", + "--atomic", + `--namespace=${namespace}`, + ]; + + // Per https://helm.sh/docs/faq/#xdg-base-directory-support + if (helm === "helm3") { + process.env.XDG_DATA_HOME = "/root/.helm/" + process.env.XDG_CACHE_HOME = "/root/.helm/" + process.env.XDG_CONFIG_HOME = "/root/.helm/" + } else { + process.env.HELM_HOME = "/root/.helm/" + } + + if (dryRun) args.push("--dry-run"); + if (appName) args.push(`--set=app.name=${appName}`); + if (version) args.push(`--set=app.version=${version}`); + if (chartVersion) args.push(`--version=${chartVersion}`); + if (timeout) args.push(`--timeout=${timeout}`); + if (repository) args.push(`--repo=${repository}`); + valueFiles.forEach(f => args.push(`--values=${f}`)); + args.push("--values=./values.yml"); + + // Special behaviour is triggered if the track is labelled 'canary'. The + // service and ingress resources are disabled. Access to the canary + // deployments can be routed via the main stable service resource. + if (track === "canary") { + args.push("--set=service.enabled=false", "--set=ingress.enabled=false"); + } + + // Setup necessary files. + if (process.env.KUBECONFIG_FILE) { + process.env.KUBECONFIG = "./kubeconfig.yml"; + await writeFile(process.env.KUBECONFIG, process.env.KUBECONFIG_FILE); + } + await writeFile("./values.yml", values); + + core.debug(`env: KUBECONFIG="${process.env.KUBECONFIG}"`); + + // Render value files using github variables. + await renderFiles(valueFiles.concat(["./values.yml"]), { + secrets, + deployment: context.payload.deployment, + }); + + // Remove the canary deployment before continuing. + if (removeCanary) { + core.debug(`removing canary ${appName}-canary`); + await exec.exec(helm, deleteCmd(helm, namespace, `${appName}-canary`), { + ignoreReturnCode: true + }); + } + + // Actually execute the deployment here. + if (task === "remove") { + await exec.exec(helm, deleteCmd(helm, namespace, release), { + ignoreReturnCode: true + }); + } else { + await exec.exec(helm, args); + } + + await status(task === "remove" ? "inactive" : "success"); + } catch (error) { + core.error(error); + core.setFailed(error.message); + await status("failure"); + } +} + +run(); diff --git a/.github/actions/helm/package-lock.json b/.github/actions/helm/package-lock.json new file mode 100644 index 00000000..4c740051 --- /dev/null +++ b/.github/actions/helm/package-lock.json @@ -0,0 +1,356 @@ +{ + "name": "status", + "version": "1.6.1", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@actions/core": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.0.0.tgz", + "integrity": "sha512-aMIlkx96XH4E/2YZtEOeyrYQfhlas9jIRkfGPqMwXD095Rdkzo4lB6ZmbxPQSzD+e1M+Xsm98ZhuSMYGv/AlqA==" + }, + "@actions/exec": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@actions/exec/-/exec-1.0.0.tgz", + "integrity": "sha512-nquH0+XKng+Ll7rZfCojN7NWSbnGh+ltwUJhzfbLkmOJgxocGX2/yXcZLMyT9fa7+tByEow/NSTrBExNlEj9fw==" + }, + "@actions/github": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@actions/github/-/github-1.0.0.tgz", + "integrity": "sha512-PPbWZ5wFAD/Vr+RCECfR3KNHjTwYln4liJBihs9tQUL0/PCFqB2lSkIh9V94AcZFHxgKk8snImjuLaBE8bKR7A==", + "requires": { + "@octokit/graphql": "^2.0.1", + "@octokit/rest": "^16.15.0" + } + }, + "@octokit/endpoint": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-5.3.2.tgz", + "integrity": "sha512-gRjteEM9I6f4D8vtwU2iGUTn9RX/AJ0SVXiqBUEuYEWVGGAVjSXdT0oNmghH5lvQNWs8mwt6ZaultuG6yXivNw==", + "requires": { + "deepmerge": "4.0.0", + "is-plain-object": "^3.0.0", + "universal-user-agent": "^3.0.0", + "url-template": "^2.0.8" + }, + "dependencies": { + "universal-user-agent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-3.0.0.tgz", + "integrity": "sha512-T3siHThqoj5X0benA5H0qcDnrKGXzU8TKoX15x/tQHw1hQBvIEBHjxQ2klizYsqBOO/Q+WuxoQUihadeeqDnoA==", + "requires": { + "os-name": "^3.0.0" + } + } + } + }, + "@octokit/graphql": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-2.1.3.tgz", + "integrity": "sha512-XoXJqL2ondwdnMIW3wtqJWEwcBfKk37jO/rYkoxNPEVeLBDGsGO1TCWggrAlq3keGt/O+C/7VepXnukUxwt5vA==", + "requires": { + "@octokit/request": "^5.0.0", + "universal-user-agent": "^2.0.3" + } + }, + "@octokit/request": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.0.2.tgz", + "integrity": "sha512-z1BQr43g4kOL4ZrIVBMHwi68Yg9VbkRUyuAgqCp1rU3vbYa69+2gIld/+gHclw15bJWQnhqqyEb7h5a5EqgZ0A==", + "requires": { + "@octokit/endpoint": "^5.1.0", + "@octokit/request-error": "^1.0.1", + "deprecation": "^2.0.0", + "is-plain-object": "^3.0.0", + "node-fetch": "^2.3.0", + "once": "^1.4.0", + "universal-user-agent": "^3.0.0" + }, + "dependencies": { + "universal-user-agent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-3.0.0.tgz", + "integrity": "sha512-T3siHThqoj5X0benA5H0qcDnrKGXzU8TKoX15x/tQHw1hQBvIEBHjxQ2klizYsqBOO/Q+WuxoQUihadeeqDnoA==", + "requires": { + "os-name": "^3.0.0" + } + } + } + }, + "@octokit/request-error": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-1.0.4.tgz", + "integrity": "sha512-L4JaJDXn8SGT+5G0uX79rZLv0MNJmfGa4vb4vy1NnpjSnWDLJRy6m90udGwvMmavwsStgbv2QNkPzzTCMmL+ig==", + "requires": { + "deprecation": "^2.0.0", + "once": "^1.4.0" + } + }, + "@octokit/rest": { + "version": "16.28.7", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-16.28.7.tgz", + "integrity": "sha512-cznFSLEhh22XD3XeqJw51OLSfyL2fcFKUO+v2Ep9MTAFfFLS1cK1Zwd1yEgQJmJoDnj4/vv3+fGGZweG+xsbIA==", + "requires": { + "@octokit/request": "^5.0.0", + "@octokit/request-error": "^1.0.2", + "atob-lite": "^2.0.0", + "before-after-hook": "^2.0.0", + "btoa-lite": "^1.0.0", + "deprecation": "^2.0.0", + "lodash.get": "^4.4.2", + "lodash.set": "^4.3.2", + "lodash.uniq": "^4.5.0", + "octokit-pagination-methods": "^1.1.0", + "once": "^1.4.0", + "universal-user-agent": "^3.0.0", + "url-template": "^2.0.8" + }, + "dependencies": { + "universal-user-agent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-3.0.0.tgz", + "integrity": "sha512-T3siHThqoj5X0benA5H0qcDnrKGXzU8TKoX15x/tQHw1hQBvIEBHjxQ2klizYsqBOO/Q+WuxoQUihadeeqDnoA==", + "requires": { + "os-name": "^3.0.0" + } + } + } + }, + "atob-lite": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/atob-lite/-/atob-lite-2.0.0.tgz", + "integrity": "sha1-D+9a1G8b16hQLGVyfwNn1e5D1pY=" + }, + "before-after-hook": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.1.0.tgz", + "integrity": "sha512-IWIbu7pMqyw3EAJHzzHbWa85b6oud/yfKYg5rqB5hNE8CeMi3nX+2C2sj0HswfblST86hpVEOAb9x34NZd6P7A==" + }, + "btoa-lite": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/btoa-lite/-/btoa-lite-1.0.0.tgz", + "integrity": "sha1-M3dm2hWAEhD92VbCLpxokaudAzc=" + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "deepmerge": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.0.0.tgz", + "integrity": "sha512-YZ1rOP5+kHor4hMAH+HRQnBQHg+wvS1un1hAOuIcxcBy0hzcUf6Jg2a1w65kpoOUnurOfZbERwjI1TfZxNjcww==" + }, + "deprecation": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", + "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" + }, + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "requires": { + "once": "^1.4.0" + } + }, + "execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "requires": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + } + }, + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "requires": { + "pump": "^3.0.0" + } + }, + "is-plain-object": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.0.tgz", + "integrity": "sha512-tZIpofR+P05k8Aocp7UI/2UTa9lTJSebCXpFFoR9aibpokDj/uXBsJ8luUu0tTVYKkMU6URDUuOfJZ7koewXvg==", + "requires": { + "isobject": "^4.0.0" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + }, + "isobject": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-4.0.0.tgz", + "integrity": "sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA==" + }, + "lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=" + }, + "lodash.set": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/lodash.set/-/lodash.set-4.3.2.tgz", + "integrity": "sha1-2HV7HagH3eJIFrDWqEvqGnYjCyM=" + }, + "lodash.uniq": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", + "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=" + }, + "macos-release": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.3.0.tgz", + "integrity": "sha512-OHhSbtcviqMPt7yfw5ef5aghS2jzFVKEFyCJndQt2YpSQ9qRVSEv2axSJI1paVThEu+FFGs584h/1YhxjVqajA==" + }, + "mustache": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/mustache/-/mustache-3.0.3.tgz", + "integrity": "sha512-vM5FkMHamTYmVYeAujypihuPrJQDtaUIlKeeVb1AMJ73OZLtWiF7GprqrjxD0gJWT53W9JfqXxf97nXQjMQkqA==" + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" + }, + "node-fetch": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", + "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==" + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "requires": { + "path-key": "^2.0.0" + } + }, + "octokit-pagination-methods": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/octokit-pagination-methods/-/octokit-pagination-methods-1.1.0.tgz", + "integrity": "sha512-fZ4qZdQ2nxJvtcasX7Ghl+WlWS/d9IgnBIwFZXVNNZUmzpno91SX5bc5vuxiuKoCtK78XxGGNuSCrDC7xYB3OQ==" + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "os-name": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/os-name/-/os-name-3.1.0.tgz", + "integrity": "sha512-h8L+8aNjNcMpo/mAIBPn5PXCM16iyPGjHNWo6U1YO8sJTMHtEtyczI6QJnLoplswm6goopQkqc7OAnjhWcugVg==", + "requires": { + "macos-release": "^2.2.0", + "windows-release": "^3.1.0" + } + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" + }, + "universal-user-agent": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-2.1.0.tgz", + "integrity": "sha512-8itiX7G05Tu3mGDTdNY2fB4KJ8MgZLS54RdG6PkkfwMAavrXu1mV/lls/GABx9O3Rw4PnTtasxrvbMQoBYY92Q==", + "requires": { + "os-name": "^3.0.0" + } + }, + "url-template": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/url-template/-/url-template-2.0.8.tgz", + "integrity": "sha1-/FZaPMy/93MMd19WQflVV5FDnyE=" + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "requires": { + "isexe": "^2.0.0" + } + }, + "windows-release": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.2.0.tgz", + "integrity": "sha512-QTlz2hKLrdqukrsapKsINzqMgOUpQW268eJ0OaOpJN32h272waxR9fkB9VoWRtK7uKHG5EHJcTXQBD8XZVJkFA==", + "requires": { + "execa": "^1.0.0" + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + } + } +} diff --git a/.github/actions/helm/package.json b/.github/actions/helm/package.json new file mode 100644 index 00000000..83c47439 --- /dev/null +++ b/.github/actions/helm/package.json @@ -0,0 +1,20 @@ +{ + "name": "status", + "version": "1.6.1", + "main": "index.js", + "license": "MIT", + "homepage": "https://github.com/deliverybot/helm", + "author": { + "name": "deliverybot", + "url": "https://github.com/deliverybot" + }, + "dependencies": { + "@actions/core": "^1.0.0", + "@actions/exec": "^1.0.0", + "@actions/github": "^1.0.0", + "mustache": "^3.0.3" + }, + "scripts": { + "release": "standard-version" + } +} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d1aebab5..2cb309a3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -111,7 +111,7 @@ jobs: cache-from: type=local,src=/tmp/.buildx-cache cache-to: type=local,dest=/tmp/.buildx-cache - name: Deploy - uses: deliverybot/helm@v1 + uses: './.github/actions/helm' with: helm: helm3 release: exventure