@@ -2,6 +2,7 @@ FROM mcr.microsoft.com/windows/servercore:ltsc2022
2
2
3
3
# Specify this with --build-arg PW=SomePassword
4
4
ARG PW=T3mp=Passwd
5
+ ARG git_ref=master
5
6
6
7
# Download Cygwin Bootstrapper & Verify Its Checksum
7
8
RUN powershell -Command \
@@ -16,8 +17,9 @@ RUN powershell -Command \
16
17
Write-Host 'Checksum verification succeeded!' -ForegroundColor Green; \
17
18
}"
18
19
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 && \
20
+ # Set up cygwin with git and ansible as a bootstrap, and add to system default path
21
+ 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 && \
22
+ C:\cygwin64\bin\git config --system core.autocrlf false && \
21
23
del setup-x86_64.exe && \
22
24
setx PATH "c:\cygwin64\bin;%PATH%" && \
23
25
mkdir c:\temp
@@ -45,11 +47,14 @@ RUN PowerShell .\ConfigureRemotingForAnsible.ps1 -CertValidityDays 9999 & \
45
47
ENV TERM=dumb
46
48
47
49
RUN net user ansible %PW% /ADD & net localgroup "Administrators" ansible /ADD & net localgroup "Remote Management Users" ansible /ADD && \
48
- sed -i -e 's/hosts: .*/hosts: localhost/' infrastructure/ansible/playbooks/AdoptOpenJDK_Windows_Playbook/main.yml && \
49
- echo localhost ansible_connection=winrm > infrastructure/ansible/hosts && \
50
- cd C:\infrastructure\ansible && \
51
- C:\cygwin64\bin\python3.7m.exe /usr/bin/ansible-playbook -e git_sha=00000000 -e ansible_user=ansible -e ansible_password=%PW% -i hosts \
52
- --skip-tags=adoptopenjdk,reboot,Windows_Updates,NTP_TIME,MSVS_2013,MSVS_2017,MSVS_2019 playbooks/AdoptOpenJDK_Windows_Playbook/main.yml && \
50
+ C:\cygwin64\bin\git clone https://github.com/adoptium/infrastructure c:/infrastructure && \
51
+ cd infrastructure && C:\cygwin64\bin\git fetch origin %git_ref% && C:\cygwin64\bin\git checkout FETCH_HEAD && \
52
+ sed -i -e 's/hosts: .*/hosts: localhost/' ansible/playbooks/AdoptOpenJDK_Windows_Playbook/main.yml && \
53
+ echo localhost ansible_connection=winrm > ansible/hosts && \
54
+ cd ansible && \
55
+ C:\cygwin64\bin\python3.7m.exe /usr/bin/ansible-playbook -e git_sha=000000 -e ansible_user=ansible -e ansible_password=%PW% -i hosts \
56
+ --skip-tags=adoptopenjdk,reboot,Windows_Updates,NTP_TIME,MSVS_2013,Rust,IcedTea-Web playbooks/AdoptOpenJDK_Windows_Playbook/main.yml && \
57
+ rmdir /s /q c:\infrastructure && \
53
58
net user ansible /DELETE
54
59
55
60
ENTRYPOINT ["C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\Common7\\Tools\\VsDevCmd.bat", "&&", "powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"]
0 commit comments