diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml index f863597109..5f5139d10d 100644 --- a/.github/workflows/build_windows.yml +++ b/.github/workflows/build_windows.yml @@ -39,7 +39,11 @@ jobs: subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} - name: Build container image - run: docker build -t adoptium.azurecr.io/windows2022_build_image:latest -f ansible/docker/Dockerfile.win2022 . + run: docker build \ + -t adoptium.azurecr.io/windows2022_build_image:latest \ + --build-arg SOURCE_DIR=. \ + -f ansible/docker/Dockerfile.win2022 . \ + --output 'type=local,dest=C:\infrastructure' - name: Push container image to ACR if: github.ref == 'refs/heads/master' diff --git a/ansible/docker/Dockerfile.win2022 b/ansible/docker/Dockerfile.win2022 index cccf47a421..a684bc68a3 100644 --- a/ansible/docker/Dockerfile.win2022 +++ b/ansible/docker/Dockerfile.win2022 @@ -16,11 +16,10 @@ RUN powershell -Command \ Write-Host 'Checksum verification succeeded!' -ForegroundColor Green; \ }" -# Set up cygwin with git and ansible as a bootstrap, and add to system default path -RUN setup-x86_64.exe --packages git,ansible --download --local-install --delete-orphans --site https://mirrors.kernel.org/sourceware/cygwin --local-package-dir c:\cygwin_packages --root C:\cygwin64 --wait --quiet-mode & \ - C:\cygwin64\bin\git config --system core.autocrlf false & \ - del setup-x86_64.exe & \ - setx PATH "c:\cygwin64\bin;%PATH%" & \ +# Set up cygwin with ansible as a bootstrap, and add to system default path +RUN setup-x86_64.exe --packages ansible --download --local-install --delete-orphans --site https://mirrors.kernel.org/sourceware/cygwin --local-package-dir c:\cygwin_packages --root C:\cygwin64 --wait --quiet-mode && \ + del setup-x86_64.exe && \ + setx PATH "c:\cygwin64\bin;%PATH%" && \ mkdir c:\temp # Download Ansible Config Script & Verify Its Checksum @@ -46,13 +45,11 @@ RUN PowerShell .\ConfigureRemotingForAnsible.ps1 -CertValidityDays 9999 & \ ENV TERM=dumb RUN net user ansible %PW% /ADD & net localgroup "Administrators" ansible /ADD & net localgroup "Remote Management Users" ansible /ADD && \ - C:\cygwin64\bin\git clone https://github.com/sxa/infrastructure -b wind-noant c:/infrastructure && \ sed -i -e 's/hosts: .*/hosts: localhost/' infrastructure/ansible/playbooks/AdoptOpenJDK_Windows_Playbook/main.yml && \ echo localhost ansible_connection=winrm > infrastructure/ansible/hosts && \ - cd infrastructure\ansible && \ + cd C:\infrastructure\ansible && \ C:\cygwin64\bin\python3.7m.exe /usr/bin/ansible-playbook -e git_sha=00000000 -e ansible_user=ansible -e ansible_password=%PW% -i hosts \ --skip-tags=adoptopenjdk,reboot,Windows_Updates,NTP_TIME,MSVS_2013,MSVS_2017,MSVS_2019 playbooks/AdoptOpenJDK_Windows_Playbook/main.yml && \ - rmdir /s /q c:\infrastructure && \ net user ansible /DELETE ENTRYPOINT ["C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\Common7\\Tools\\VsDevCmd.bat", "&&", "powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"] diff --git a/ansible/playbooks/AdoptOpenJDK_Windows_Playbook/roles/ANT/tasks/main.yml b/ansible/playbooks/AdoptOpenJDK_Windows_Playbook/roles/ANT/tasks/main.yml index 42affc1265..c0d306f974 100644 --- a/ansible/playbooks/AdoptOpenJDK_Windows_Playbook/roles/ANT/tasks/main.yml +++ b/ansible/playbooks/AdoptOpenJDK_Windows_Playbook/roles/ANT/tasks/main.yml @@ -64,12 +64,7 @@ tags: ANT - name: Download ant-contrib - win_get_url: - url: https://sourceforge.net/projects/ant-contrib/files/ant-contrib/ant-contrib-1.0b2/ant-contrib-1.0b2-bin.zip - dest: c:\temp\ant-contrib.zip - force: no - checksum: 22bae6c3ddf1a464b285784599eef8698f64dde24378c77e42522a536b88cbbc - checksum_algorithm: sha256 + win_shell: c:\cygwin64\bin\curl -L -o /cygdrive/c/temp/ant-contrib.zip https://sourceforge.net/projects/ant-contrib/files/ant-contrib/ant-contrib-1.0b2/ant-contrib-1.0b2-bin.zip when: (not ant_contrib_installed.stat.exists) tags: ANT