-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.local.js
28 lines (22 loc) · 1015 Bytes
/
index.local.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const configurator = require("./src/utils/configurator")
const argocd = require("./src/argocd-handler")
async function main() {
const environment = "development"
const argocdHost = "example.com.br"
const argocdUser = "admin"
const argocdPassword = "Ex4mPl3"
const argocdApplication = "example"
try {
await configurator.checkActionInputs(environment, argocdHost, argocdUser, argocdPassword, argocdApplication);
const argocdSessionToken = await argocd.openSession(argocdHost, argocdUser, argocdPassword);
await argocd.syncApplication(argocdHost, argocdSessionToken, argocdApplication);
await new Promise(resolve => setTimeout(resolve, 3000));
await argocd.validateApplicationRollout(argocdHost, argocdSessionToken, argocdApplication);
await argocd.displayApplicationInfo(argocdHost, argocdApplication)
} catch (error) {
console.error(error.message);
await argocd.displayApplicationInfo(argocdHost, argocdApplication)
process.exit(1);
}
};
main();