freeipa/ipatests/azure/templates/setup-test-environment.yml
Stanislav Levin b5bb436e9f Exit on fail in azure multiline script
By default, the `last` exit code returned from Azure script will be
checked and, if non-zero, treated as a step failure.  Luckily,
for Linux script is a shortcut for Bash. Hence errexit/e option
could be applied. But Azure pipelines doesn't set it by default:
https://github.com/microsoft/azure-pipelines-agent/issues/1803

For multiline script this is a problem, unless otherwise designed.
Some of benefits of checking the result of each subcommand:
- preventing subsequent issues (broken packages, container images, etc.)
- time saving (next steps will not run)
- good diagnostics (tells which part of script fails)

Signed-off-by: Stanislav Levin <slev@altlinux.org>
Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
2019-06-26 20:47:58 +03:00

27 lines
1.0 KiB
YAML

steps:
- script: |
set -e
echo '{ "ipv6": true, "fixed-cidr-v6": "2001:db8::/64" }' > docker-daemon.json
sudo mkdir -p /etc/docker
sudo cp docker-daemon.json /etc/docker/daemon.json
sudo chown root:root /etc/docker/daemon.json
sudo systemctl restart docker
sudo modprobe ip6_tables
displayName: Configure containerization to allow IPv6 network
- task: DownloadPipelineArtifact@0
displayName: Download prebuilt packages
inputs:
artifactName: 'packages-$(Build.BuildId)-$(Agent.OS)-$(Agent.OSArchitecture)'
targetPath: $(Agent.BuildDirectory)/s/dist
- task: DownloadPipelineArtifact@0
displayName: Download pre-built container
inputs:
artifactName: 'image-$(Build.BuildId)-$(Agent.OS)-$(Agent.OSArchitecture)'
targetPath: $(Agent.BuildDirectory)/s
- script: |
set -e
docker load --input $(Agent.BuildDirectory)/s/freeipa-fedora-builder-container.tar.gz
docker images
docker inspect freeipa-fedora-builder:latest
displayName: Import pre-built container to the engine