diff --git a/dist/index.js b/dist/index.js index a01500e..f0f4914 100644 --- a/dist/index.js +++ b/dist/index.js @@ -2819,6 +2819,8 @@ var __webpack_exports__ = {}; (() => { const core = __nccwpck_require__(186) +console.log('Preparing stack deployment') + let portainerUrl = core.getInput("portainerUrl") const accessToken = core.getInput("accessToken") const stackId = parseInt(core.getInput("stackId")) @@ -2853,14 +2855,13 @@ const postDataObject = { pullImage: true, } -console.dir(environmentVariables) if (environmentVariables !== undefined && environmentVariables !== "") { postDataObject.env = JSON.parse(environmentVariables) } const postData = JSON.stringify(postDataObject) -console.dir(postData) +console.log(`Deploying stack ${stackId} on portainer host ${portainerUrl} ${postDataObject.env ? 'With environment variables ' + JSON.stringify(postDataObject.env) : 'clearing all environment variables.'}`) const req = client.request(`${portainerUrl}/api/stacks/${stackId}/git/redeploy` + (isNaN(endpointId) ? "" : `?endpointId=${endpointId}`), { method: "PUT", @@ -2874,6 +2875,7 @@ const req = client.request(`${portainerUrl}/api/stacks/${stackId}/git/redeploy` core.setFailed(res.statusMessage) process.exit(2) } + console.log('Stack deployed successfully') }) .on("error", (error) => { core.setFailed(error.message) diff --git a/index.js b/index.js index 84a70a7..d97e028 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,7 @@ const core = require("@actions/core") +console.log('Preparing stack deployment') + let portainerUrl = core.getInput("portainerUrl") const accessToken = core.getInput("accessToken") const stackId = parseInt(core.getInput("stackId")) @@ -34,14 +36,13 @@ const postDataObject = { pullImage: true, } -console.dir(environmentVariables) if (environmentVariables !== undefined && environmentVariables !== "") { postDataObject.env = JSON.parse(environmentVariables) } const postData = JSON.stringify(postDataObject) -console.dir(postData) +console.log(`Deploying stack ${stackId} on portainer host ${portainerUrl} ${postDataObject.env ? 'With environment variables ' + JSON.stringify(postDataObject.env) : 'clearing all environment variables.'}`) const req = client.request(`${portainerUrl}/api/stacks/${stackId}/git/redeploy` + (isNaN(endpointId) ? "" : `?endpointId=${endpointId}`), { method: "PUT", @@ -55,6 +56,7 @@ const req = client.request(`${portainerUrl}/api/stacks/${stackId}/git/redeploy` core.setFailed(res.statusMessage) process.exit(2) } + console.log('Stack deployed successfully') }) .on("error", (error) => { core.setFailed(error.message)