Skip to content

Commit

Permalink
switch to COPY
Browse files Browse the repository at this point in the history
  • Loading branch information
gdams committed Oct 15, 2024
1 parent 670f70d commit 296f0d1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}

- name: Build container image
run: docker build -t adoptium.azurecr.io/windows2022_build_image:latest --build-arg git_ref=${{ github.ref }} -f ansible/docker/Dockerfile.win2022 .
run: docker build -t adoptium.azurecr.io/windows2022_build_image:latest -f ansible/docker/Dockerfile.win2022 .

- name: Push container image to ACR
if: github.ref == 'refs/heads/master'
Expand Down
14 changes: 6 additions & 8 deletions ansible/docker/Dockerfile.win2022
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ FROM mcr.microsoft.com/windows/servercore:ltsc2022

# Specify this with --build-arg PW=SomePassword
ARG PW=T3mp=Passwd
ARG git_ref=master

COPY . infrastructure

# Download Cygwin Bootstrapper & Verify Its Checksum
RUN powershell -Command \
Expand All @@ -17,9 +18,8 @@ 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 && \
# 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
Expand Down Expand Up @@ -47,14 +47,12 @@ 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/adoptium/infrastructure c:/infrastructure && \
cd infrastructure && C:\cygwin64\bin\git fetch origin %git_ref% && C:\cygwin64\bin\git checkout FETCH_HEAD && \
sed -i -e 's/hosts: .*/hosts: localhost/' ansible/playbooks/AdoptOpenJDK_Windows_Playbook/main.yml && \
echo localhost ansible_connection=winrm > ansible/hosts && \
cd ansible && \
cd infrastructure\ansible && \
C:\cygwin64\bin\python3.7m.exe /usr/bin/ansible-galaxy collection install ansible.windows && \
C:\cygwin64\bin\python3.7m.exe /usr/bin/ansible-playbook -e git_sha=000000 -e ansible_user=ansible -e ansible_password=%PW% -i hosts \
--skip-tags=adoptopenjdk,reboot,Windows_Updates,NTP_TIME,MSVS_2013,Rust,IcedTea-Web 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"]
Expand Down

0 comments on commit 296f0d1

Please sign in to comment.