Skip to content

Commit

Permalink
Merge pull request #297 from pagarme/test
Browse files Browse the repository at this point in the history
feat: add console debug
  • Loading branch information
trajanoreuter authored Jun 30, 2023
2 parents 5567139 + a98848f commit 681e470
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ const getECSService = async ({


async function run() {

const aws_region = core.getInput('region')
const cluster = core.getInput('cluster-name')
const service = core.getInput('service-name')
const task = core.getInput('task-name')

console.log('Start client with region', aws_region)
const client = new ECSClient({ region: aws_region })

try {
Expand All @@ -71,15 +71,20 @@ async function run() {
client
})
const { taskDefinition } = head(services)
console.log('Task definition from services', taskDefinition)
const taskDef = await getTaskDefinition({
taskDefinition,
client,
})

console.log('Task definition from task', taskDef)

const replacements = core.getInput('replacements') || '{}'
const taskDefMerged = merge(taskDef, JSON.parse(replacements))
console.log('Task definition merged', taskDefMerged)

const newTaskDef = omit(taskDefMerged, IGNORED_TASK_DEFINITION_ATTRIBUTES)
console.log('Task definition merged and cleaned', newTaskDef)

// create a a file for task def
const taskDefFile = tmp.fileSync({
Expand All @@ -93,12 +98,13 @@ async function run() {
fs.writeFileSync(taskDefFile.name, JSON.stringify(newTaskDef))
core.setOutput('taskDef', taskDefFile.name)
} else {

const taskDef = await getTaskDefinition({
taskDefinition: task,
client,
})

console.log('Task definition from task', taskDef)

const replacements = core.getInput('replacements') || '{}'
const taskDefMerged = merge(taskDef, JSON.parse(replacements))

Expand Down

0 comments on commit 681e470

Please sign in to comment.