Skip to content

Commit 46f99bc

Browse files
committed
remove more
1 parent e966f62 commit 46f99bc

1 file changed

Lines changed: 180 additions & 179 deletions

File tree

.github/workflows/test-build-docker.yml

Lines changed: 180 additions & 179 deletions
Original file line numberDiff line numberDiff line change
@@ -126,143 +126,143 @@ jobs:
126126
platforms: linux/arm64
127127
provenance: false
128128

129-
MakeMSIZip:
130-
name: 'MakeMSIZip'
131-
runs-on: ubuntu-latest
132-
permissions:
133-
id-token: write
134-
contents: read
135-
steps:
136-
- uses: actions/checkout@v3
137-
with:
138-
repository: ${{env.CWA_GITHUB_TEST_REPO_NAME}}
139-
140-
- name: Set up Go 1.x
141-
uses: actions/setup-go@v4
142-
with:
143-
go-version: ~1.22.2
144-
145-
- name: Configure AWS Credentials
146-
uses: aws-actions/configure-aws-credentials@v4
147-
with:
148-
role-to-assume: ${{ secrets.TERRAFORM_AWS_ASSUME_ROLE }}
149-
aws-region: us-west-2
150-
151-
- name: Cache win zip
152-
id: cached_win_zip
153-
uses: actions/cache@v3
154-
with:
155-
key: "cached_win_zip_${{ github.sha }}_${{ inputs.PackageBucketKey }}_${{ inputs.Bucket }}_${{ inputs.BucketKey }}"
156-
path: go.mod
157-
158-
- name: Copy binary
159-
if: contains(inputs.BucketKey, 'test') == false || steps.cached_win_zip.outputs.cache-hit == false
160-
run: |
161-
aws s3 cp s3://${{ secrets.S3_INTEGRATION_BUCKET }}/${{ inputs.BucketKey }} . --recursive
162-
- name: Unzip
163-
if: contains(inputs.BucketKey, 'test') == false || steps.cached_win_zip.outputs.cache-hit == false
164-
run: |
165-
sudo apt install unzip
166-
unzip windows/amd64/amazon-cloudwatch-agent.zip -d windows-agent
167-
- name: Create msi dep folder and copy deps
168-
if: contains(inputs.BucketKey, 'test') == false || steps.cached_win_zip.outputs.cache-hit == false
169-
run: |
170-
export version=$(cat CWAGENT_VERSION)
171-
echo cw agent version $version
172-
mkdir msi_dep
173-
cp -r msi/tools/. msi_dep/
174-
cp -r windows-agent/amazon-cloudwatch-agent/. msi_dep/
175-
go run msi/tools/msiversion/msiversionconverter.go $version msi_dep/amazon-cloudwatch-agent.wxs '<version>'
176-
go run msi/tools/msiversion/msiversionconverter.go $version msi_dep/manifest.json __VERSION__
177-
178-
- name: Zip
179-
if: contains(inputs.BucketKey, 'test') == false || steps.cached_win_zip.outputs.cache-hit == false
180-
run: |
181-
sudo apt install zip
182-
zip buildMSI.zip msi_dep/*
183-
184-
- name: Upload zip
185-
if: contains(inputs.BucketKey, 'test') == false || steps.cached_win_zip.outputs.cache-hit == false
186-
run: aws s3 cp buildMSI.zip s3://${{ secrets.S3_INTEGRATION_BUCKET }}/${{ inputs.BucketKey }}/buildMSI.zip
187-
188-
BuildMSI-2022:
189-
name: 'BuildMSI-2022'
190-
runs-on: windows-2022
191-
needs: [ MakeMSIZip ]
192-
permissions:
193-
id-token: write
194-
contents: read
195-
steps:
196-
- uses: actions/checkout@v3
197-
198-
- name: Configure AWS Credentials
199-
uses: aws-actions/configure-aws-credentials@v4
200-
with:
201-
role-to-assume: ${{ secrets.TERRAFORM_AWS_ASSUME_ROLE }}
202-
aws-region: us-west-2
203-
204-
- name: Cache msi
205-
id: cached_msi
206-
uses: actions/cache@v3
207-
with:
208-
key: "cached_msi_${{ github.sha }}"
209-
path: go.mod
210-
211-
# Using the env variable returns "" for bucket name thus use the secret
212-
- name: Copy msi
213-
if: contains(inputs.BucketKey, 'test') == false || steps.cached_msi.outputs.cache-hit == false
214-
run: aws s3 cp s3://${{ secrets.S3_INTEGRATION_BUCKET }}/${{ inputs.BucketKey }}/buildMSI.zip .
215-
216-
- name: Create msi
217-
if: contains(inputs.BucketKey, 'test') == false || steps.cached_msi.outputs.cache-hit == false
218-
run: |
219-
curl -OLS https://github.com/wixtoolset/wix3/releases/download/wix314rtm/wix314.exe
220-
.\wix314.exe /install /quiet /norestart
221-
$wixToolsetBinPath = ";C:\Program Files (x86)\WiX Toolset v3.14\bin;"
222-
$env:PATH = $env:PATH + $wixToolsetBinPath
223-
Expand-Archive buildMSI.zip -Force
224-
cd buildMSI/msi_dep
225-
.\create_msi.ps1 "nosha" ${{ secrets.S3_INTEGRATION_BUCKET }}/${{ inputs.PackageBucketKey }}
226-
227-
- name: clean ecr login credential cache
228-
if: contains(inputs.BucketKey, 'test') == false || steps.cached_msi.outputs.cache-hit == false
229-
run : |
230-
echo '{"auths": {"https://index.docker.io/v1/": {}}, "HttpHeaders": { "User-Agent": "Docker-Client/19.03.12 (windows)"}}' > ~/.docker/config.json
231-
232-
- name: Login ECR
233-
if: contains(inputs.BucketKey, 'test') == false || steps.cached_msi.outputs.cache-hit == false
234-
id: login-ecr
235-
uses: aws-actions/amazon-ecr-login@v2
236-
237-
# Build dir is ignored in our .dockerignore thus need to copy to another dir.
238-
- name: Copy Binary For Agent Image Build
239-
if: contains(inputs.BucketKey, 'test') == false || steps.cached_msi.outputs.cache-hit == false
240-
run: |
241-
pwd
242-
mkdir amd64
243-
cp -r buildMSI/msi_dep/amazon-cloudwatch-agent.msi amd64/
244-
245-
- name: Get ECR Repo name
246-
id: repo_name
247-
env:
248-
ContainerRepositoryNameAndTag: ${{ inputs.ContainerRepositoryNameAndTag }}
249-
run: |
250-
$splitArray = $env:ContainerRepositoryNameAndTag.Split(":")[0]
251-
Write-Output "::set-output name=ContainerRepositoryName::$splitArray"
252-
253-
- name: Build Windows Cloudwatch Agent Image
254-
env:
255-
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
256-
REPOSITORY: ${{ steps.repo_name.outputs.ContainerRepositoryName }}:2022
257-
if: contains(inputs.BucketKey, 'test') == false || steps.cached_msi.outputs.cache-hit == false
258-
run: |
259-
Write-Output "$env:REGISTRY/$env:REPOSITORY"
260-
docker build --platform windows/amd64 -f ./amazon-cloudwatch-container-insights/cloudwatch-agent-dockerfile/localmsi/Dockerfile.Windows . -t $env:REGISTRY/$env:REPOSITORY
261-
docker push $env:REGISTRY/$env:REPOSITORY
129+
# MakeMSIZip:
130+
# name: 'MakeMSIZip'
131+
# runs-on: ubuntu-latest
132+
# permissions:
133+
# id-token: write
134+
# contents: read
135+
# steps:
136+
# - uses: actions/checkout@v3
137+
# with:
138+
# repository: ${{env.CWA_GITHUB_TEST_REPO_NAME}}
139+
#
140+
# - name: Set up Go 1.x
141+
# uses: actions/setup-go@v4
142+
# with:
143+
# go-version: ~1.22.2
144+
#
145+
# - name: Configure AWS Credentials
146+
# uses: aws-actions/configure-aws-credentials@v4
147+
# with:
148+
# role-to-assume: ${{ secrets.TERRAFORM_AWS_ASSUME_ROLE }}
149+
# aws-region: us-west-2
150+
#
151+
# - name: Cache win zip
152+
# id: cached_win_zip
153+
# uses: actions/cache@v3
154+
# with:
155+
# key: "cached_win_zip_${{ github.sha }}_${{ inputs.PackageBucketKey }}_${{ inputs.Bucket }}_${{ inputs.BucketKey }}"
156+
# path: go.mod
157+
#
158+
# - name: Copy binary
159+
# if: contains(inputs.BucketKey, 'test') == false || steps.cached_win_zip.outputs.cache-hit == false
160+
# run: |
161+
# aws s3 cp s3://${{ secrets.S3_INTEGRATION_BUCKET }}/${{ inputs.BucketKey }} . --recursive
162+
# - name: Unzip
163+
# if: contains(inputs.BucketKey, 'test') == false || steps.cached_win_zip.outputs.cache-hit == false
164+
# run: |
165+
# sudo apt install unzip
166+
# unzip windows/amd64/amazon-cloudwatch-agent.zip -d windows-agent
167+
# - name: Create msi dep folder and copy deps
168+
# if: contains(inputs.BucketKey, 'test') == false || steps.cached_win_zip.outputs.cache-hit == false
169+
# run: |
170+
# export version=$(cat CWAGENT_VERSION)
171+
# echo cw agent version $version
172+
# mkdir msi_dep
173+
# cp -r msi/tools/. msi_dep/
174+
# cp -r windows-agent/amazon-cloudwatch-agent/. msi_dep/
175+
# go run msi/tools/msiversion/msiversionconverter.go $version msi_dep/amazon-cloudwatch-agent.wxs '<version>'
176+
# go run msi/tools/msiversion/msiversionconverter.go $version msi_dep/manifest.json __VERSION__
177+
#
178+
# - name: Zip
179+
# if: contains(inputs.BucketKey, 'test') == false || steps.cached_win_zip.outputs.cache-hit == false
180+
# run: |
181+
# sudo apt install zip
182+
# zip buildMSI.zip msi_dep/*
183+
#
184+
# - name: Upload zip
185+
# if: contains(inputs.BucketKey, 'test') == false || steps.cached_win_zip.outputs.cache-hit == false
186+
# run: aws s3 cp buildMSI.zip s3://${{ secrets.S3_INTEGRATION_BUCKET }}/${{ inputs.BucketKey }}/buildMSI.zip
187+
#
188+
# BuildMSI-2022:
189+
# name: 'BuildMSI-2022'
190+
# runs-on: windows-2022
191+
# needs: [ MakeMSIZip ]
192+
# permissions:
193+
# id-token: write
194+
# contents: read
195+
# steps:
196+
# - uses: actions/checkout@v3
197+
#
198+
# - name: Configure AWS Credentials
199+
# uses: aws-actions/configure-aws-credentials@v4
200+
# with:
201+
# role-to-assume: ${{ secrets.TERRAFORM_AWS_ASSUME_ROLE }}
202+
# aws-region: us-west-2
203+
#
204+
# - name: Cache msi
205+
# id: cached_msi
206+
# uses: actions/cache@v3
207+
# with:
208+
# key: "cached_msi_${{ github.sha }}"
209+
# path: go.mod
210+
#
211+
# # Using the env variable returns "" for bucket name thus use the secret
212+
# - name: Copy msi
213+
# if: contains(inputs.BucketKey, 'test') == false || steps.cached_msi.outputs.cache-hit == false
214+
# run: aws s3 cp s3://${{ secrets.S3_INTEGRATION_BUCKET }}/${{ inputs.BucketKey }}/buildMSI.zip .
215+
#
216+
# - name: Create msi
217+
# if: contains(inputs.BucketKey, 'test') == false || steps.cached_msi.outputs.cache-hit == false
218+
# run: |
219+
# curl -OLS https://github.com/wixtoolset/wix3/releases/download/wix314rtm/wix314.exe
220+
# .\wix314.exe /install /quiet /norestart
221+
# $wixToolsetBinPath = ";C:\Program Files (x86)\WiX Toolset v3.14\bin;"
222+
# $env:PATH = $env:PATH + $wixToolsetBinPath
223+
# Expand-Archive buildMSI.zip -Force
224+
# cd buildMSI/msi_dep
225+
# .\create_msi.ps1 "nosha" ${{ secrets.S3_INTEGRATION_BUCKET }}/${{ inputs.PackageBucketKey }}
226+
#
227+
# - name: clean ecr login credential cache
228+
# if: contains(inputs.BucketKey, 'test') == false || steps.cached_msi.outputs.cache-hit == false
229+
# run : |
230+
# echo '{"auths": {"https://index.docker.io/v1/": {}}, "HttpHeaders": { "User-Agent": "Docker-Client/19.03.12 (windows)"}}' > ~/.docker/config.json
231+
#
232+
# - name: Login ECR
233+
# if: contains(inputs.BucketKey, 'test') == false || steps.cached_msi.outputs.cache-hit == false
234+
# id: login-ecr
235+
# uses: aws-actions/amazon-ecr-login@v2
236+
#
237+
# # Build dir is ignored in our .dockerignore thus need to copy to another dir.
238+
# - name: Copy Binary For Agent Image Build
239+
# if: contains(inputs.BucketKey, 'test') == false || steps.cached_msi.outputs.cache-hit == false
240+
# run: |
241+
# pwd
242+
# mkdir amd64
243+
# cp -r buildMSI/msi_dep/amazon-cloudwatch-agent.msi amd64/
244+
#
245+
# - name: Get ECR Repo name
246+
# id: repo_name
247+
# env:
248+
# ContainerRepositoryNameAndTag: ${{ inputs.ContainerRepositoryNameAndTag }}
249+
# run: |
250+
# $splitArray = $env:ContainerRepositoryNameAndTag.Split(":")[0]
251+
# Write-Output "::set-output name=ContainerRepositoryName::$splitArray"
252+
#
253+
# - name: Build Windows Cloudwatch Agent Image
254+
# env:
255+
# REGISTRY: ${{ steps.login-ecr.outputs.registry }}
256+
# REPOSITORY: ${{ steps.repo_name.outputs.ContainerRepositoryName }}:2022
257+
# if: contains(inputs.BucketKey, 'test') == false || steps.cached_msi.outputs.cache-hit == false
258+
# run: |
259+
# Write-Output "$env:REGISTRY/$env:REPOSITORY"
260+
# docker build --platform windows/amd64 -f ./amazon-cloudwatch-container-insights/cloudwatch-agent-dockerfile/localmsi/Dockerfile.Windows . -t $env:REGISTRY/$env:REPOSITORY
261+
# docker push $env:REGISTRY/$env:REPOSITORY
262262

263263
CreateContainerManifest:
264264
name: 'CreateManifest'
265-
needs: ['BuildMSI-2022', 'MakeBinary']
265+
needs: ['MakeBinary']
266266
runs-on: ubuntu-latest
267267
permissions:
268268
id-token: write
@@ -310,52 +310,53 @@ jobs:
310310
REPOLinuxArm: ${{ steps.repo_name.outputs.ContainerRepositoryName }}:linux-arm64
311311
if: contains(inputs.BucketKey, 'test') == false || steps.cached_binaries.outputs.cache-hit == false
312312
run: |
313-
docker manifest create $REGISTRY/$REPOSITORYWindows --amend $REGISTRY/$REPO2022 --amend $REGISTRY/$REPO2019
314-
docker manifest push $REGISTRY/$REPOSITORYWindows
313+
# docker manifest create $REGISTRY/$REPOSITORYWindows --amend $REGISTRY/$REPO2022 --amend $REGISTRY/$REPO2019
314+
# docker manifest push $REGISTRY/$REPOSITORYWindows
315315

316-
docker manifest create $REGISTRY/$OrigREPOSITORY --amend $REGISTRY/$REPO2022 --amend $REGISTRY/$REPO2019 --amend $REGISTRY/$REPOLinuxAmd --amend $REGISTRY/$REPOLinuxArm
316+
# docker manifest create $REGISTRY/$OrigREPOSITORY --amend $REGISTRY/$REPO2022 --amend $REGISTRY/$REPO2019 --amend $REGISTRY/$REPOLinuxAmd --amend $REGISTRY/$REPOLinuxArm
317+
docker manifest create $REGISTRY/$OrigREPOSITORY --amend $REGISTRY/$REPOLinuxAmd --amend $REGISTRY/$REPOLinuxArm
317318
docker manifest push $REGISTRY/$OrigREPOSITORY
318319

319320
#GH actions set up gpg only works on ubuntu as of this commit date
320-
GPGSignWindowsPackage:
321-
name: 'GPGSignWindowsPackage'
322-
runs-on: ubuntu-latest
323-
needs: [ BuildMSI-2022 ]
324-
permissions:
325-
id-token: write
326-
contents: read
327-
steps:
328-
- uses: actions/checkout@v3
329-
330-
- name: Configure AWS Credentials
331-
uses: aws-actions/configure-aws-credentials@v4
332-
with:
333-
role-to-assume: ${{ secrets.TERRAFORM_AWS_ASSUME_ROLE }}
334-
aws-region: us-west-2
335-
336-
- name: Cache sig
337-
id: cached_sig
338-
uses: actions/cache@v3
339-
with:
340-
key: "cached_sig_${{ github.sha }}"
341-
path: go.mod
342-
343-
- name: Download from s3
344-
if: contains(inputs.BucketKey, 'test') == false || steps.cached_sig.outputs.cache-hit == false
345-
run: |
346-
mkdir -p packages/amd64
347-
mkdir packages/arm64
348-
aws s3 cp s3://${{ secrets.S3_INTEGRATION_BUCKET }}/${{ inputs.PackageBucketKey }}/amazon-cloudwatch-agent.msi ./packages/amazon-cloudwatch-agent.msi
349-
- name: Import GPG Key
350-
uses: crazy-max/ghaction-import-gpg@v5
351-
with:
352-
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
353-
passphrase: ${{ secrets.PASSPHRASE }}
354-
355-
- name: Sign Build Files
356-
run: for f in $(find packages/); do if [ ! -d $f ]; then echo "Signing file $f" && gpg --detach-sign $f ; fi ; done
357-
358-
- name: Upload to s3
359-
if: contains(inputs.BucketKey, 'test') == false || steps.cached_sig.outputs.cache-hit == false
360-
run: |
361-
aws s3 cp packages/amazon-cloudwatch-agent.msi.sig s3://${{ secrets.S3_INTEGRATION_BUCKET }}/${{ inputs.PackageBucketKey }}/amazon-cloudwatch-agent.msi.sig
321+
# GPGSignWindowsPackage:
322+
# name: 'GPGSignWindowsPackage'
323+
# runs-on: ubuntu-latest
324+
# needs: [ BuildMSI-2022 ]
325+
# permissions:
326+
# id-token: write
327+
# contents: read
328+
# steps:
329+
# - uses: actions/checkout@v3
330+
#
331+
# - name: Configure AWS Credentials
332+
# uses: aws-actions/configure-aws-credentials@v4
333+
# with:
334+
# role-to-assume: ${{ secrets.TERRAFORM_AWS_ASSUME_ROLE }}
335+
# aws-region: us-west-2
336+
#
337+
# - name: Cache sig
338+
# id: cached_sig
339+
# uses: actions/cache@v3
340+
# with:
341+
# key: "cached_sig_${{ github.sha }}"
342+
# path: go.mod
343+
#
344+
# - name: Download from s3
345+
# if: contains(inputs.BucketKey, 'test') == false || steps.cached_sig.outputs.cache-hit == false
346+
# run: |
347+
# mkdir -p packages/amd64
348+
# mkdir packages/arm64
349+
# aws s3 cp s3://${{ secrets.S3_INTEGRATION_BUCKET }}/${{ inputs.PackageBucketKey }}/amazon-cloudwatch-agent.msi ./packages/amazon-cloudwatch-agent.msi
350+
# - name: Import GPG Key
351+
# uses: crazy-max/ghaction-import-gpg@v5
352+
# with:
353+
# gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
354+
# passphrase: ${{ secrets.PASSPHRASE }}
355+
#
356+
# - name: Sign Build Files
357+
# run: for f in $(find packages/); do if [ ! -d $f ]; then echo "Signing file $f" && gpg --detach-sign $f ; fi ; done
358+
#
359+
# - name: Upload to s3
360+
# if: contains(inputs.BucketKey, 'test') == false || steps.cached_sig.outputs.cache-hit == false
361+
# run: |
362+
# aws s3 cp packages/amazon-cloudwatch-agent.msi.sig s3://${{ secrets.S3_INTEGRATION_BUCKET }}/${{ inputs.PackageBucketKey }}/amazon-cloudwatch-agent.msi.sig

0 commit comments

Comments
 (0)