unique task def per job

pull/218/head
Frostebite 2021-02-07 00:45:33 +00:00
parent 17455cc5ea
commit db0096619c
4 changed files with 8 additions and 14 deletions

File diff suppressed because one or more lines are too long

View File

@ -21,9 +21,9 @@
"base-64": "^0.1.0", "base-64": "^0.1.0",
"cloudwatch-logs-hose": "0.0.2", "cloudwatch-logs-hose": "0.0.2",
"kubernetes-client": "^9.0.0", "kubernetes-client": "^9.0.0",
"nanoid": "3.1.20",
"selfsigned": "1.10.8", "selfsigned": "1.10.8",
"semver": "^7.3.2", "semver": "^7.3.2"
"shortid": "2.2.16"
}, },
"devDependencies": { "devDependencies": {
"@babel/cli": "7.8.4", "@babel/cli": "7.8.4",

View File

@ -1,11 +1,11 @@
/* eslint-disable no-plusplus */ /* eslint-disable no-plusplus */
/* eslint-disable no-await-in-loop */ /* eslint-disable no-await-in-loop */
import * as SDK from 'aws-sdk'; import * as SDK from 'aws-sdk';
import { nanoid } from 'nanoid';
import { CloudWatch, CloudWatchLogs } from 'aws-sdk'; import { CloudWatch, CloudWatchLogs } from 'aws-sdk';
const fs = require('fs'); const fs = require('fs');
const core = require('@actions/core'); const core = require('@actions/core');
const Shortid = require('shortid');
class AWS { class AWS {
static async runBuildJob(buildParameters, baseImage) { static async runBuildJob(buildParameters, baseImage) {
@ -33,7 +33,7 @@ class AWS {
const CF = new SDK.CloudFormation(); const CF = new SDK.CloudFormation();
const alphanumericImageName = image.toString().replace(/[^\da-z]/gi, ''); const alphanumericImageName = image.toString().replace(/[^\da-z]/gi, '');
const taskDefStackName = `${stackName}-taskDef-${alphanumericImageName}-${Shortid.generate()}`; const taskDefStackName = `${stackName}-taskDef-${alphanumericImageName}-${nanoid()}`;
const stackExists = const stackExists =
(await CF.listStacks().promise()).StackSummaries.find( (await CF.listStacks().promise()).StackSummaries.find(
(x) => x.StackName === taskDefStackName, (x) => x.StackName === taskDefStackName,

View File

@ -3939,9 +3939,9 @@ nan@^2.12.1:
version "2.14.1" version "2.14.1"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.1.tgz#d7be34dfa3105b91494c3147089315eff8874b01" resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.1.tgz#d7be34dfa3105b91494c3147089315eff8874b01"
nanoid@^2.1.0: nanoid@3.1.20:
version "2.1.11" version "3.1.20"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-2.1.11.tgz#ec24b8a758d591561531b4176a01e3ab4f0f0280" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.20.tgz#badc263c6b1dcf14b71efaa85f6ab4c1d6cfc788"
nanomatch@^1.2.9: nanomatch@^1.2.9:
version "1.2.13" version "1.2.13"
@ -4847,12 +4847,6 @@ shellwords@^0.1.1:
version "0.1.1" version "0.1.1"
resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b"
shortid@2.2.16:
version "2.2.16"
resolved "https://registry.yarnpkg.com/shortid/-/shortid-2.2.16.tgz#b742b8f0cb96406fd391c76bfc18a67a57fe5608"
dependencies:
nanoid "^2.1.0"
side-channel@^1.0.2: side-channel@^1.0.2:
version "1.0.2" version "1.0.2"
resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.2.tgz#df5d1abadb4e4bf4af1cd8852bf132d2f7876947" resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.2.tgz#df5d1abadb4e4bf4af1cd8852bf132d2f7876947"