Skip to content

Commit c8a0de2

Browse files
committed
mount current clone as workdir
1 parent 3fdbedd commit c8a0de2

File tree

3 files changed

+11
-15
lines changed

3 files changed

+11
-15
lines changed

.github/workflows/build_windows.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ jobs:
3939
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
4040

4141
- name: Build container image
42-
run: docker build -t adoptium.azurecr.io/windows2022_build_image:latest -f ansible/docker/Dockerfile.win2022 .
42+
run: docker build \
43+
-t adoptium.azurecr.io/windows2022_build_image:latest \
44+
--build-arg SOURCE_DIR=. \
45+
-f ansible/docker/Dockerfile.win2022 . \
46+
--output 'type=local,dest=C:\infrastructure'
4347

4448
- name: Push container image to ACR
4549
if: github.ref == 'refs/heads/master'

ansible/docker/Dockerfile.win2022

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@ RUN powershell -Command \
1616
Write-Host 'Checksum verification succeeded!' -ForegroundColor Green; \
1717
}"
1818

19-
# Set up cygwin with git and ansible as a bootstrap, and add to system default path
20-
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 & \
21-
C:\cygwin64\bin\git config --system core.autocrlf false & \
22-
del setup-x86_64.exe & \
23-
setx PATH "c:\cygwin64\bin;%PATH%" & \
19+
# Set up cygwin with ansible as a bootstrap, and add to system default path
20+
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 && \
21+
del setup-x86_64.exe && \
22+
setx PATH "c:\cygwin64\bin;%PATH%" && \
2423
mkdir c:\temp
2524

2625
# Download Ansible Config Script & Verify Its Checksum
@@ -46,13 +45,11 @@ RUN PowerShell .\ConfigureRemotingForAnsible.ps1 -CertValidityDays 9999 & \
4645
ENV TERM=dumb
4746

4847
RUN net user ansible %PW% /ADD & net localgroup "Administrators" ansible /ADD & net localgroup "Remote Management Users" ansible /ADD && \
49-
C:\cygwin64\bin\git clone https://github.com/sxa/infrastructure -b wind-noant c:/infrastructure && \
5048
sed -i -e 's/hosts: .*/hosts: localhost/' infrastructure/ansible/playbooks/AdoptOpenJDK_Windows_Playbook/main.yml && \
5149
echo localhost ansible_connection=winrm > infrastructure/ansible/hosts && \
52-
cd infrastructure\ansible && \
50+
cd C:\infrastructure\ansible && \
5351
C:\cygwin64\bin\python3.7m.exe /usr/bin/ansible-playbook -e git_sha=00000000 -e ansible_user=ansible -e ansible_password=%PW% -i hosts \
5452
--skip-tags=adoptopenjdk,reboot,Windows_Updates,NTP_TIME,MSVS_2013,MSVS_2017,MSVS_2019 playbooks/AdoptOpenJDK_Windows_Playbook/main.yml && \
55-
rmdir /s /q c:\infrastructure && \
5653
net user ansible /DELETE
5754

5855
ENTRYPOINT ["C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\Common7\\Tools\\VsDevCmd.bat", "&&", "powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"]

ansible/playbooks/AdoptOpenJDK_Windows_Playbook/roles/ANT/tasks/main.yml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,7 @@
6464
tags: ANT
6565

6666
- name: Download ant-contrib
67-
win_get_url:
68-
url: https://sourceforge.net/projects/ant-contrib/files/ant-contrib/ant-contrib-1.0b2/ant-contrib-1.0b2-bin.zip
69-
dest: c:\temp\ant-contrib.zip
70-
force: no
71-
checksum: 22bae6c3ddf1a464b285784599eef8698f64dde24378c77e42522a536b88cbbc
72-
checksum_algorithm: sha256
67+
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
7368
when: (not ant_contrib_installed.stat.exists)
7469
tags: ANT
7570

0 commit comments

Comments
 (0)