-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate Docker for E2E testing with Makefile and Azure pipeline orc…
…hestration
- Loading branch information
1 parent
35b2881
commit f62f93f
Showing
4 changed files
with
171 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# ./templates/e2e-pipeline-template.yml | ||
parameters: | ||
- name: rpImageACR | ||
type: string | ||
- name: acrCredentialsJSON | ||
type: string | ||
|
||
steps: | ||
# Authenticate to ACR and Install Docker Compose | ||
- task: AzureCLI@2 | ||
displayName: 'Authenticate to ACR and Install Docker Compose' | ||
inputs: | ||
azureSubscription: 'ado-pipeline-dev-image-push' # Replace with your service connection | ||
scriptType: bash | ||
scriptLocation: 'inlineScript' | ||
inlineScript: | | ||
set -xe | ||
# Ensure RP_IMAGE_ACR is correctly passed as a parameter | ||
if [ -z "${{ parameters.rpImageACR }}" ]; then | ||
echo "Error: RP_IMAGE_ACR is not set" | ||
exit 1 | ||
fi | ||
ACR_FQDN="${{ parameters.rpImageACR }}" | ||
REGISTRY_NAME=$(echo $ACR_FQDN | cut -d'.' -f1) | ||
# Install Docker Compose | ||
sudo apt-get update | ||
sudo apt-get install -y docker-compose | ||
# Login to ACR | ||
az acr login --name $REGISTRY_NAME | ||
# Pull the RP Docker image | ||
- script: | | ||
if [ -z "${{ parameters.rpImageACR }}" ]; then | ||
echo "Error: RP_IMAGE_ACR is not set" | ||
exit 1 | ||
fi | ||
export RP_IMAGE_ACR=${{ parameters.rpImageACR }} | ||
export VERSION=$(Build.BuildId) | ||
docker pull ${RP_IMAGE_ACR}/aro:${VERSION} | ||
displayName: Pull RP Docker Image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
version: '3.8' | ||
|
||
services: | ||
vpn: | ||
image: ${RP_IMAGE_ACR}/vpn_image:latest | ||
container_name: vpn-container | ||
privileged: true | ||
volumes: | ||
- /dev/shm:/dev/shm | ||
devices: | ||
- /dev/net/tun | ||
command: "openvpn --config /etc/openvpn/vpn.conf" | ||
networks: | ||
- e2e-network | ||
|
||
selenium: | ||
image: selenium/standalone-chrome | ||
container_name: selenium-container | ||
ports: | ||
- "4444:4444" | ||
networks: | ||
- e2e-network | ||
|
||
rp: | ||
image: ${RP_IMAGE_ACR}/aro:${VERSION} | ||
container_name: rp-container | ||
depends_on: | ||
- selenium | ||
ports: | ||
- "8443:8443" | ||
networks: | ||
- e2e-network | ||
|
||
e2e: | ||
image: ${RP_IMAGE_ACR}/aro:${VERSION} | ||
container_name: e2e-container | ||
depends_on: | ||
- rp | ||
networks: | ||
- e2e-network | ||
environment: | ||
- CI=true | ||
command: make test-e2e | ||
|
||
networks: | ||
e2e-network: | ||
driver: bridge |