Skip to content

Commit

Permalink
bump version for local-dev-cluster to 0.0.3
Browse files Browse the repository at this point in the history
Signed-off-by: Sam Yuan <[email protected]>
  • Loading branch information
SamYuan1990 committed Aug 1, 2023
1 parent d7e47ee commit 760ed5c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 78 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ jobs:
- uses: actions/checkout@v3
- uses: ./
with:
runningBranch: ${{matrix.cluster_provider}}
local_dev_cluster_version: v0.0.1
cluster_provider: ${{matrix.cluster_provider}}
- name: verify
Expand All @@ -54,12 +53,11 @@ jobs:
- uses: actions/checkout@v3
- uses: ./
with:
runningBranch: ${{matrix.cluster_provider}}
cluster_provider: ${{matrix.cluster_provider}}
bcc_version: 0.25.0
kubectl_version: 1.27.2
local_dev_cluster_version: v0.0.1
kind_version: 0.20.0
#kubectl_version: 1.27.2
local_dev_cluster_version: v0.0.3
#kind_version: 0.20.0
prometheus_enable: true
prometheus_operator_version: v0.12.0
grafana_enable: true
Expand Down
44 changes: 8 additions & 36 deletions dist/index.js

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

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

44 changes: 8 additions & 36 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,7 @@ async function bcc() {
return
}

async function kubectl() {
let kubectl_version = core.getInput('kubectl_version');
core.debug(kubectl_version);
if (kubectl_version === undefined || kubectl_version == null || kubectl_version.length === 0) {
kubectl_version="1.25.4";
}
core.info(`Get kubectl with version `+ kubectl_version);
if (shell.exec("curl -LO https://dl.k8s.io/release/v"+kubectl_version+"/bin/linux/amd64/kubectl").code !== 0) {
shell.echo("fail to install kubectl");
shell.exit(1);
}
}

async function setup() {
let cluster_provider = core.getInput('cluster_provider');
core.debug(cluster_provider);
if (cluster_provider == undefined || cluster_provider == null || cluster_provider.length ===0){
cluster_provider="kind";
}
async function setup(cluster_provider) {
let local_dev_cluster_version = core.getInput('local_dev_cluster_version');
core.debug(local_dev_cluster_version);
if (local_dev_cluster_version === undefined || local_dev_cluster_version == null || local_dev_cluster_version.length === 0) {
Expand All @@ -57,16 +39,6 @@ async function setup() {
core.info(`Get local-cluster-dev with version `+ local_dev_cluster_version);
shell.exec("git clone -b "+local_dev_cluster_version+" https://github.com/sustainable-computing-io/local-dev-cluster.git --depth=1");
let parameterExport = "";
if (cluster_provider === "kind"){
const kind_version = core.getInput('kind_version');
core.debug(kind_version);
if (kind_version !== undefined && kind_version!=null && kind_version.length!=0) {
core.info(`use kind version `+kind_version);
// kind_version, KIND_VERSION
parameterExport = parameterExport + "export KIND_VERSION="+kind_version;
parameterExport = parameterExport + " && "
}
}
parameterExport = parameterExport + "export CLUSTER_PROVIDER="+cluster_provider;
const prometheus_enable = core.getInput('prometheus_enable');
core.debug(prometheus_enable);
Expand Down Expand Up @@ -109,21 +81,21 @@ async function setup() {
// most @actions toolkit packages have async methods
async function run() {
const runningBranch = core.getInput('runningBranch');
let cluster_provider = core.getInput('cluster_provider');
core.debug(cluster_provider);
try {
if (runningBranch == 'bcc') {
return bcc()
}
if (runningBranch == 'kind') {
if (runningBranch == 'kind' || cluster_provider == 'kind') {
bcc()
kubectl()
return setup()
return setup(cluster_provider)
}
if (runningBranch == 'microshift') {
if (runningBranch == 'microshift' || cluster_provider == 'microshift') {
bcc()
kubectl()
return setup()
return setup(cluster_provider)
}
core.error('runningBranch should in value of [bcc, kind, microshift]')
core.error('runningBranch should in value of [bcc, kind, microshift], or use cluster_provider as [kind, microshift] for short')
} catch (error) {
core.setFailed(error.message);
}
Expand Down

0 comments on commit 760ed5c

Please sign in to comment.