Skip to content

Commit

Permalink
Merge pull request #20 from mamezou-tech/add-option-install-only-plugins
Browse files Browse the repository at this point in the history
Add option install Helm plugins
  • Loading branch information
kudoh authored Dec 20, 2020
2 parents 883ddc4 + 868b962 commit 0891dd6
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 12 deletions.
41 changes: 38 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,67 @@ name: CI
on: [pull_request, workflow_dispatch]

jobs:
install_all:
install_all_default:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Setup helmfile
uses: ./
- name: Test
run: |
ls -l ~/bin
helmfile --version
kubectl version --client
helm version
helm plugin list
install_helmfile_with_version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup helmfile
uses: ./
with:
helmfile-version: "v0.135.0"
- name: Test
run: |
ls -l ~/bin
helmfile --version
kubectl version --client
helm version
helm plugin list
install_helm_plugins_without_helm:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup helmfile
uses: ./
with:
install-kubectl: no
install-helm: no
- name: Test
run: |
ls -l ~/bin
helmfile --version
kubectl version --client
helm version
helm plugin list
install_only_helmfile:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- name: Setup helmfile
uses: ./
with:
install-kubectl: no
install-helm: no
install-helm-plugins: no
- name: Test
run: |
ls -l ~/bin
helmfile --version
kubectl version --client
helm version
helm plugin list
30 changes: 21 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
steps:
- uses: actions/checkout@v1
- name: Setup helmfile
uses: mamezou-tech/setup-helmfile@v0.5.0
uses: mamezou-tech/setup-helmfile@v0.7.0
- name: Test
run: |
helmfile --version
Expand All @@ -35,6 +35,7 @@ jobs:
- `kubectl-release-date` : kubectl release date. Default `2020-08-04`
- `install-kubectl` : Install kubectl. Default `yes`
- `install-helm` : Install Helm. Default `yes`
- `install-helm-plugins` : Install Helm plugins. Default `yes`

> See "[Installing kubectl - Amazon EKS](https://docs.aws.amazon.com/eks/latest/userguide/install-kubectl.html)" for information how to specify the kubectl version.

Expand All @@ -47,30 +48,41 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup helmfile
uses: mamezou-tech/setup-helmfile@v0.5.0
uses: mamezou-tech/setup-helmfile@v0.7.0
with:
helmfile-version: "v0.118.0"
helmfile-version: "v0.135.0"
```

If you want use default kubectl / Helm installed in GitHub Runner. you can specify inputs to not install them.
If you are not particular about the version of kubectl / Helm and you can use the versions pre-installed on GitHub Actions runner, you can specify inputs not to install them.

> Notice: Helm plugins will be installed in this case.

```yaml
name: CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Setup helmfile
uses: mamezou-tech/setup-helmfile@v0.6.0
uses: mamezou-tech/setup-helmfile@v0.7.0
with:
install-kubectl: no
install-helm: no
```

If you don't want helm plugins installed, specify `no` for `install-helm-plugins`.

```yaml
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup helmfile
uses: mamezou-tech/[email protected]
with:
install-helm-plugins: no
```

### Build action (for maintainer)
```
$ npm install
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ inputs:
description: "Install helm"
default: "yes"
required: false
install-helm-plugins:
description: "Install Helm plugins"
default: "yes"
required: false
runs:
using: "node12"
main: "dist/index.js"
2 changes: 2 additions & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4865,6 +4865,8 @@ async function run() {
}
if (core.getInput("install-helm") === "yes") {
installHelm(core.getInput("helm-version"));
}
if (core.getInput("install-helm-plugins") === "yes") {
installHelmPlugins();
}
installHelmfile(core.getInput("helmfile-version"));
Expand Down
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ async function run() {
}
if (core.getInput("install-helm") === "yes") {
installHelm(core.getInput("helm-version"));
}
if (core.getInput("install-helm-plugins") === "yes") {
installHelmPlugins();
}
installHelmfile(core.getInput("helmfile-version"));
Expand Down

0 comments on commit 0891dd6

Please sign in to comment.