Skip to content

Commit

Permalink
Update deps, lint the app, fix sleep to 10 sec
Browse files Browse the repository at this point in the history
  • Loading branch information
rolljee committed Feb 7, 2024
1 parent 262c5db commit 045239a
Show file tree
Hide file tree
Showing 156 changed files with 66,407 additions and 7,905 deletions.
63 changes: 47 additions & 16 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,68 @@ function sleep(s) {

class Action {
constructor() {
const trim = { trimWhitespace: true };
this.inputs = {
username: core.getInput("username", { required: true, ...trim }),
password: core.getInput("password", { required: true, ...trim }),
username: core.getInput("username", {
required: true,
trimWhitespace: true,
}),

password: core.getInput("password", {
required: true,
trimWhitespace: true,
}),

project: `paas-project-${core.getInput("project", {
required: false,
...trim,
trimWhitespace: true,
})}`,
environment: core.getInput("environment", { required: false, ...trim }),
application: core.getInput("application", { required: false, ...trim }),
image: core.getInput("image", { required: false, ...trim }),

environment: core.getInput("environment", {
required: false,
trimWhitespace: true,
}),

application: core.getInput("application", {
required: false,
trimWhitespace: true,
}),
image: core.getInput("image", { required: false, trimWhitespace: true }),

login_only: core.getBooleanInput("login_only", {
required: false,
...trim,
trimWhitespace: true,
}),

npmrc_output_dir: core.getInput("npmrc_output_dir", {
required: false,
...trim,
trimWhitespace: true,
}),
paas_api: core.getInput("paas_api", { required: false, ...trim }),

paas_api: core.getInput("paas_api", {
required: false,
trimWhitespace: true,
}),

paas_packages: core.getInput("paas_packages", {
required: false,
...trim,
trimWhitespace: true,
}),
rollback: core.getBooleanInput("rollback", { required: false, ...trim }),
timeout: parseInt(core.getInput("timeout", { required: false, ...trim })),

rollback: core.getBooleanInput("rollback", {
required: false,
trimWhitespace: true,
}),

timeout: parseInt(
core.getInput("timeout", { required: false, trimWhitespace: true })
),
};
}

async waitForApplication() {
let status = "Processing";
let tryCount = 0;

while (status !== "Healthy" && tryCount < this.inputs.timeout) {
const currentAppInfo = await this.getApplicationInfo();
status = currentAppInfo.status;
Expand Down Expand Up @@ -78,9 +108,10 @@ class Action {

await this.deploy();

await sleep(3); // Wait 10 seconds to let Argo the time to init the deployment process
await sleep(10); // Wait 10 seconds to let Argo the time to init the deployment process

let status;

let status = undefined;
try {
status = await this.waitForApplication();
console.log("Deployment succeeded!");
Expand All @@ -107,7 +138,7 @@ class Action {
tag: previousAppInfo.spec.source.helm.values.kuzzle.image.tag,
});

status = await this.waitForApplication();
await this.waitForApplication();

console.log("Rollback successful! 🥵");

Expand Down
118 changes: 82 additions & 36 deletions node_modules/.package-lock.json

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

4 changes: 2 additions & 2 deletions node_modules/@actions/core/README.md

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

4 changes: 2 additions & 2 deletions node_modules/@actions/core/lib/core.d.ts

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

2 changes: 1 addition & 1 deletion node_modules/@actions/core/lib/oidc-utils.js

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

2 changes: 1 addition & 1 deletion node_modules/@actions/core/lib/oidc-utils.js.map

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

6 changes: 3 additions & 3 deletions node_modules/@actions/core/package.json

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

6 changes: 4 additions & 2 deletions node_modules/chalk/package.json

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

3 changes: 2 additions & 1 deletion node_modules/chalk/source/vendor/supports-color/index.js

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

Loading

0 comments on commit 045239a

Please sign in to comment.