Skip to content

Commit

Permalink
Install helm diff (#6)
Browse files Browse the repository at this point in the history
* Add method for plugin install

* fix exec

* install helm s3 plugin

* package

* Bump version
  • Loading branch information
kondoumh authored May 28, 2020
1 parent c9bfe6f commit 027bab0
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 7 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ jobs:
ls -l ~/bin
kubectl version --client
helm version
helm plugin list
helmfile --version
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ Setup [helmfile](https://github.com/roboll/helmfile) with Helm and kubectl in Gi
> - The AWS version of kubectl is installed.
> - This action works on Linux.
> - Helm 2.x is not supported.
> - Following Helm plugins will be installed
> - helm-diff
> - helm-s3
```yaml
name: CI
Expand All @@ -18,7 +21,7 @@ jobs:
steps:
- uses: actions/checkout@v1
- name: Setup helmfile
uses: mamezou-tech/setup-helmfile@v0.2.4
uses: mamezou-tech/setup-helmfile@v0.3.0
- name: Test
run: |
helmfile --version
Expand All @@ -43,9 +46,9 @@ jobs:
steps:
- uses: actions/checkout@v1
- name: Setup helmfile
uses: mamezou-tech/setup-helmfile@v0.2.4
uses: mamezou-tech/setup-helmfile@v0.3.0
with:
helmfile-version: "v0.99.2"
helmfile-version: "v0.118.0"
- name: Test
run: |
helmfile --version
Expand Down
9 changes: 8 additions & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4312,6 +4312,11 @@ async function installHelm(version) {
await install(`${folder}/linux-amd64/helm`, "helm");
}

async function installHelmPlugins() {
await exec.exec("helm plugin install https://github.com/databus23/helm-diff --version master");
await exec.exec("helm plugin install https://github.com/hypnoglow/helm-s3.git");
}

async function installHelmfile(version) {
const baseUrl = "https://github.com/roboll/helmfile/releases/download"
const downloadPath = await download(`${baseUrl}/${version}/helmfile_linux_amd64`);
Expand Down Expand Up @@ -4341,6 +4346,7 @@ async function install(downloadPath, filename) {
module.exports = {
installKubectl,
installHelm,
installHelmPlugins,
installHelmfile
}

Expand Down Expand Up @@ -4560,12 +4566,13 @@ function isUnixExecutable(stats) {
/***/ (function(__unusedmodule, __unusedexports, __webpack_require__) {

const core = __webpack_require__(470);
const { installKubectl, installHelm, installHelmfile } = __webpack_require__(636);
const { installKubectl, installHelm, installHelmPlugins, installHelmfile } = __webpack_require__(636);

async function run() {
try {
installKubectl(core.getInput("kubectl-version"), core.getInput("kubectl-release-date"));
installHelm(core.getInput("helm-version"));
installHelmPlugins();
installHelmfile(core.getInput("helmfile-version"));
} catch (error) {
core.setFailed(error.message);
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "setup-helmfile",
"version": "0.2.4",
"version": "0.3.0",
"description": "Action for setup helmfile",
"main": "index.js",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
const core = require(`@actions/core`);
const { installKubectl, installHelm, installHelmfile } = require("./setup");
const { installKubectl, installHelm, installHelmPlugins, installHelmfile } = require("./setup");

async function run() {
try {
installKubectl(core.getInput("kubectl-version"), core.getInput("kubectl-release-date"));
installHelm(core.getInput("helm-version"));
installHelmPlugins();
installHelmfile(core.getInput("helmfile-version"));
} catch (error) {
core.setFailed(error.message);
Expand Down
6 changes: 6 additions & 0 deletions src/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ async function installHelm(version) {
await install(`${folder}/linux-amd64/helm`, "helm");
}

async function installHelmPlugins() {
await exec.exec("helm plugin install https://github.com/databus23/helm-diff --version master");
await exec.exec("helm plugin install https://github.com/hypnoglow/helm-s3.git");
}

async function installHelmfile(version) {
const baseUrl = "https://github.com/roboll/helmfile/releases/download"
const downloadPath = await download(`${baseUrl}/${version}/helmfile_linux_amd64`);
Expand Down Expand Up @@ -47,5 +52,6 @@ async function install(downloadPath, filename) {
module.exports = {
installKubectl,
installHelm,
installHelmPlugins,
installHelmfile
}

0 comments on commit 027bab0

Please sign in to comment.