From 33cc70c7b5a32e73ba59fdbb511db6a744ad6b05 Mon Sep 17 00:00:00 2001 From: ywchung Date: Sat, 2 Jan 2021 12:47:07 +0900 Subject: [PATCH 1/3] =?UTF-8?q?nodejs=20version=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/template/ad/phase1.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index e81b70c..8b98f5e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@zigbang/appstream", - "version": "1.1.2", + "version": "1.1.3", "main": "index.js", "scripts": { "build": "npx -p @mermaid-js/mermaid-cli mmdc -i ./docs/workflow.mmd -o ./docs/workflow.png && npx tsc", diff --git a/src/template/ad/phase1.ps1 b/src/template/ad/phase1.ps1 index c8c7cc4..ef6a04e 100644 --- a/src/template/ad/phase1.ps1 +++ b/src/template/ad/phase1.ps1 @@ -1,7 +1,7 @@ Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) choco install -y awscli -choco install -y nodejs +choco install -y nodejs-lts choco install -y yarn Set-Location \ From 89d8746985afa9f344e75a3dd421af11974d91e3 Mon Sep 17 00:00:00 2001 From: ywchung Date: Mon, 11 Jan 2021 23:27:14 +0900 Subject: [PATCH 2/3] =?UTF-8?q?AppStream=20SDK=20Describe=20Image=20Issue?= =?UTF-8?q?=20=EC=9E=84=EC=8B=9C=20=EB=8C=80=EC=9D=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/sdk/SdkUtil.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 8b98f5e..22706af 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@zigbang/appstream", - "version": "1.1.3", + "version": "1.1.4-beta.2", "main": "index.js", "scripts": { "build": "npx -p @mermaid-js/mermaid-cli mmdc -i ./docs/workflow.mmd -o ./docs/workflow.png && npx tsc", diff --git a/src/sdk/SdkUtil.ts b/src/sdk/SdkUtil.ts index 99b61de..be965a9 100644 --- a/src/sdk/SdkUtil.ts +++ b/src/sdk/SdkUtil.ts @@ -63,7 +63,7 @@ export class SdkUtil { async describeImage(): Promise { try { - const data = this.appstream.describeImages().promise() + const data = this.appstream.describeImages({ Names: [`${this.config?.baseImage}` || "AppStream-WinServer2019-12-28-2020"] }).promise() const result = JSON.stringify((await data).Images) const images = JSON.parse(result) From 9582a814784bccd39170d8505b7928d01df14bea Mon Sep 17 00:00:00 2001 From: ywchung Date: Thu, 14 Jan 2021 16:56:30 +0900 Subject: [PATCH 3/3] sdk image describe fix --- package.json | 2 +- src/sdk/SdkUtil.ts | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 22706af..889b656 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@zigbang/appstream", - "version": "1.1.4-beta.2", + "version": "1.1.4", "main": "index.js", "scripts": { "build": "npx -p @mermaid-js/mermaid-cli mmdc -i ./docs/workflow.mmd -o ./docs/workflow.png && npx tsc", diff --git a/src/sdk/SdkUtil.ts b/src/sdk/SdkUtil.ts index be965a9..3141183 100644 --- a/src/sdk/SdkUtil.ts +++ b/src/sdk/SdkUtil.ts @@ -63,18 +63,17 @@ export class SdkUtil { async describeImage(): Promise { try { - const data = this.appstream.describeImages({ Names: [`${this.config?.baseImage}` || "AppStream-WinServer2019-12-28-2020"] }).promise() - const result = JSON.stringify((await data).Images) - + const data = await this.appstream.describeImages().promise() + const result = JSON.stringify((data).Images) const images = JSON.parse(result) const winSvr = images.filter((list: any) => { return list.Name.includes(this.config?.baseImage || "AppStream-WinServer2019") }) const result2 = Object.keys(winSvr) .sort((a, b) => Date.parse(winSvr[b].PublicBaseImageReleasedDate) - Date.parse(winSvr[a].PublicBaseImageReleasedDate)) - .map((k) => ({ [k]: winSvr[k] })) + .map((k) => (winSvr[k])) const winSvrLatestImage: any = result2[0] - const winSvrLatestImageArn = winSvrLatestImage[0]["Arn"] + const winSvrLatestImageArn = winSvrLatestImage["Arn"] return winSvrLatestImageArn as string } catch (err) { console.log(err, err.stack)