@@ -260,84 +260,9 @@ jobs:
260260 docker build --platform windows/amd64 -f ./amazon-cloudwatch-container-insights/cloudwatch-agent-dockerfile/localmsi/Dockerfile.Windows . -t $env:REGISTRY/$env:REPOSITORY
261261 docker push $env:REGISTRY/$env:REPOSITORY
262262
263- BuildMSI-2019 :
264- name : ' BuildMSI-2019'
265- runs-on : windows-2019
266- needs : [MakeMSIZip]
267- permissions :
268- id-token : write
269- contents : read
270- steps :
271- - uses : actions/checkout@v3
272-
273- - name : Configure AWS Credentials
274- uses : aws-actions/configure-aws-credentials@v4
275- with :
276- role-to-assume : ${{ secrets.TERRAFORM_AWS_ASSUME_ROLE }}
277- aws-region : us-west-2
278-
279- - name : Cache msi
280- id : cached_msi
281- uses : actions/cache@v3
282- with :
283- key : " cached_msi_${{ github.sha }}"
284- path : go.mod
285-
286- # Using the env variable returns "" for bucket name thus use the secret
287- - name : Copy msi
288- if : contains(inputs.BucketKey, 'test') == false || steps.cached_msi.outputs.cache-hit == false
289- run : aws s3 cp s3://${{ secrets.S3_INTEGRATION_BUCKET }}/${{ inputs.BucketKey }}/buildMSI.zip .
290-
291- - name : Create msi
292- if : contains(inputs.BucketKey, 'test') == false || steps.cached_msi.outputs.cache-hit == false
293- run : |
294- curl -OLS https://github.com/wixtoolset/wix3/releases/download/wix314rtm/wix314.exe
295- .\wix314.exe /install /quiet /norestart
296- $wixToolsetBinPath = ";C:\Program Files (x86)\WiX Toolset v3.14\bin;"
297- $env:PATH = $env:PATH + $wixToolsetBinPath
298- Expand-Archive buildMSI.zip -Force
299- cd buildMSI/msi_dep
300- .\create_msi.ps1 "nosha" ${{ secrets.S3_INTEGRATION_BUCKET }}/${{ inputs.PackageBucketKey }}
301-
302- - name : clean ecr login credential cache
303- if : contains(inputs.BucketKey, 'test') == false || steps.cached_msi.outputs.cache-hit == false
304- run : |
305- echo '{"auths": {"https://index.docker.io/v1/": {}}, "HttpHeaders": { "User-Agent": "Docker-Client/19.03.12 (windows)"}}' > ~/.docker/config.json
306-
307- - name : Login ECR
308- if : contains(inputs.BucketKey, 'test') == false || steps.cached_msi.outputs.cache-hit == false
309- id : login-ecr
310- uses : aws-actions/amazon-ecr-login@v2
311-
312- # Build dir is ignored in our .dockerignore thus need to copy to another dir.
313- - name : Copy Binary For Agent Image Build
314- if : contains(inputs.BucketKey, 'test') == false || steps.cached_msi.outputs.cache-hit == false
315- run : |
316- pwd
317- mkdir amd64
318- cp -r buildMSI/msi_dep/amazon-cloudwatch-agent.msi amd64/
319-
320- - name : Get ECR Repo name
321- id : repo_name
322- env :
323- ContainerRepositoryNameAndTag : ${{ inputs.ContainerRepositoryNameAndTag }}
324- run : |
325- $splitArray = $env:ContainerRepositoryNameAndTag.Split(":")[0]
326- Write-Output "::set-output name=ContainerRepositoryName::$splitArray"
327-
328- - name : Build Windows Cloudwatch Agent Image
329- env :
330- REGISTRY : ${{ steps.login-ecr.outputs.registry }}
331- REPOSITORY : ${{ steps.repo_name.outputs.ContainerRepositoryName }}:2019
332- if : contains(inputs.BucketKey, 'test') == false || steps.cached_msi.outputs.cache-hit == false
333- run : |
334- Write-Output "$env:REGISTRY/$env:REPOSITORY"
335- docker build --platform windows/amd64 -f ./amazon-cloudwatch-container-insights/cloudwatch-agent-dockerfile/localmsi/Dockerfile.Windows --build-arg IMAGE_TAG=ltsc2019 . -t $env:REGISTRY/$env:REPOSITORY
336- docker push $env:REGISTRY/$env:REPOSITORY
337-
338263 CreateContainerManifest :
339264 name : ' CreateManifest'
340- needs : ['BuildMSI-2019', 'BuildMSI- 2022', 'MakeBinary']
265+ needs : ['BuildMSI-2022', 'MakeBinary']
341266 runs-on : ubuntu-latest
342267 permissions :
343268 id-token : write
0 commit comments