azure pipeline: replace ubuntu-20.04 with 24.04

Azure is deprecating the Ubuntu-20.04 Apr 15th, see announcement
https://devblogs.microsoft.com/devops/upcoming-updates-for-azure-pipelines-agents-images/#ubuntu

With the Ubuntu 24.04 image, we need to change permissions of /etc/shadow
in order to allow sudo commands.

Signed-off-by: Florence Blanc-Renaud <flo@redhat.com>
Reviewed-By: Rafael Guterres Jeffman <rjeffman@redhat.com>
This commit is contained in:
Florence Blanc-Renaud authored and Sudhir Menon committed 2025-04-15 16:23:32 +05:30
1 parent 8bc64a26f6
commit 26c80e8476
2 files changed
+32 -16

No files matched your search

+31 -15
View File
@@ -10,14 +10,22 @@ variables:
# platform specific variables, links to
- template: ${{ parameters.VARIABLES_FILE }}
resources:
containers:
- container: 'builder'
image: $(DOCKER_BUILD_IMAGE)
options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged --env container=docker
jobs:
- job: Build
pool:
vmImage: $(VM_IMAGE)
container:
image: $(DOCKER_BUILD_IMAGE)
options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged --env container=docker
container: builder
steps:
- script: |
CONTAINERID=`echo '$(Agent.ContainerMapping)' | jq -r '.builder.id'`
/usr/bin/docker exec $CONTAINERID bash -c "chmod a+r /etc/shadow"
target: host
- template: templates/${{ variables.PREPARE_BUILD_TEMPLATE }}
- template: templates/${{ variables.AUTOCONF_TEMPLATE }}
- template: templates/${{ variables.BUILD_TEMPLATE }}
@@ -57,10 +65,12 @@ jobs:
- job: Lint
pool:
vmImage: $(VM_IMAGE)
container:
image: $(DOCKER_BUILD_IMAGE)
options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged --env container=docker
container: builder
steps:
- script: |
CONTAINERID=`echo '$(Agent.ContainerMapping)' | jq -r '.builder.id'`
/usr/bin/docker exec $CONTAINERID bash -c "chmod a+r /etc/shadow"
target: host
- template: templates/${{ variables.PREPARE_BUILD_TEMPLATE }}
- template: templates/${{ variables.PREPARE_LINT_TEMPLATE }}
- template: templates/${{ variables.AUTOCONF_TEMPLATE }}
@@ -79,10 +89,12 @@ jobs:
- job: Docs
pool:
vmImage: $(VM_IMAGE)
container:
image: $(DOCKER_BUILD_IMAGE)
options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged --env container=docker
container: builder
steps:
- script: |
CONTAINERID=`echo '$(Agent.ContainerMapping)' | jq -r '.builder.id'`
/usr/bin/docker exec $CONTAINERID bash -c "chmod a+r /etc/shadow"
target: host
- template: templates/${{ variables.PREPARE_BUILD_TEMPLATE }}
- template: templates/${{ variables.AUTOCONF_TEMPLATE }}
- template: templates/${{ variables.BUILD_DOCS_TEMPLATE }}
@@ -95,10 +107,12 @@ jobs:
- job: Tox
pool:
vmImage: $(VM_IMAGE)
container:
image: $(DOCKER_BUILD_IMAGE)
options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged --env container=docker
container: builder
steps:
- script: |
CONTAINERID=`echo '$(Agent.ContainerMapping)' | jq -r '.builder.id'`
/usr/bin/docker exec $CONTAINERID bash -c "chmod a+r /etc/shadow"
target: host
- template: templates/${{ variables.PREPARE_BUILD_TEMPLATE }}
- template: templates/${{ variables.PREPARE_TOX_TEMPLATE }}
- script: |
@@ -118,10 +132,12 @@ jobs:
- job: WebUI_Unit_Tests
pool:
vmImage: $(VM_IMAGE)
container:
image: $(DOCKER_BUILD_IMAGE)
options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --privileged --env container=docker
container: builder
steps:
- script: |
CONTAINERID=`echo '$(Agent.ContainerMapping)' | jq -r '.builder.id'`
/usr/bin/docker exec $CONTAINERID bash -c "chmod a+r /etc/shadow"
target: host
- template: templates/${{ variables.PREPARE_BUILD_TEMPLATE }}
- template: templates/${{ variables.PREPARE_WEBUI_TEMPLATE }}
- template: templates/${{ variables.AUTOCONF_TEMPLATE }}
@@ -6,7 +6,7 @@ variables:
# https://github.com/actions/virtual-environments/blob/master/images/linux/Ubuntu1604-REA DME.md
# Ubuntu-18.04 - 3.6.9
# https://github.com/actions/virtual-environments/blob/master/images/linux/Ubuntu1804-REA DME.md
VM_IMAGE: 'ubuntu-20.04'
VM_IMAGE: 'ubuntu-24.04'
MAX_CONTAINER_ENVS: 5
IPA_TESTS_ENV_WORKING_DIR: $(Build.Repository.LocalPath)/ipa_envs
IPA_TESTS_SCRIPTS: 'ipatests/azure/scripts'