-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.azure-pipeline.yml
99 lines (86 loc) · 3.48 KB
/
.azure-pipeline.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
variables:
temp: /__w/_temp
resources:
# This section defines the containers which are used by the pipeline.
# The /var/run/usbmuxd file is the socket used by usbmuxd, which is used
# to communicate to iOS devices.
#
# All containers in the same job share certain paths, such as
# $(Pipeline.Workspace).
#
# This assumes that the developer disk images are available at
# /home/ubuntu/devimg. You could also deploy the developer disk images
# via a container, or store them in a Git repository and clone that
# repository as part of the build.
containers:
- container: node
image: node:14
options: >-
--name job-$(Build.BuildId)-node
-v /var/run/usbmuxd:/var/run/usbmuxd:ro
-v /usr/bin/docker:/tmp/docker:ro
- container: appium
image: quamotion/appium-docker-ios:1.0.1
options: >-
--name job-$(Build.BuildId)-appium
-v /var/run/usbmuxd:/var/run/usbmuxd:ro
-v /home/ubuntu/devimg:/etc/quamotion/devimg:ro
command: >-
appium
--log ${{ variables.temp }}/appium/appium.log
--log-level error:debug
env:
LICENSE_PATH: ${{ variables.temp }}/quamotion/quamotion.license
DEVELOPER_PROFILE_PATH: ${{ variables.temp }}/quamotion/quamotion.developerprofile
DEVELOPER_PROFILE_PASSWORD: quamotion
pool: default
container: node
services:
appium: appium
steps:
# These steps download the Quamotion license file and iOS Developer Profile which will be used
# by the Appium container to install and launch the WebDriverAgent on your iOS device.
# You'll need to manually upload these files to the Pipelines Library in your Azure project.
- task: DownloadSecureFile@1
name: license
inputs:
secureFile: quamotion.license
displayName: "Download Quamotion license file"
- task: DownloadSecureFile@1
name: developerProfile
inputs:
secureFile: quamotion.developerprofile
displayName: "Download iOS Developer Profile"
- script: |
mkdir -p $(temp)/quamotion
mv $(license.secureFilePath) $(temp)/quamotion/quamotion.license
mv $(developerProfile.secureFilePath) $(temp)/quamotion/quamotion.developerprofile
displayName: "Install Quamotion license file, iOS Developer Profile"
# These steps install and execute the idevice_id utility to print the UDID of all available iOS devices.
# You can this to make sure your iOS devices are connected properly, and are available in your containers.
- script: |
/tmp/docker exec -t -u 0 job-$(Build.BuildId)-node \
sh -c "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -o Dpkg::Options::="--force-confold" -y install sudo"
displayName: "Install sudo"
- script: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends libimobiledevice-utils
displayName: "Install libimobiledevice-utils"
- script: |
idevice_id -l
displayName: "List available iOS devices"
# These steps get information about the Appium server and create a new Appium session.
# They act as a smoke test for the Appium server.
# The apipum server is available at http://appium:4723/; 'appium' is the name of the
# service container and 4723 is the default port.
- script: |
curl -X GET http://appium:4723/wd/hub/status
displayName: Get Appium status
- script: |
curl -X POST -H "Content-Type: application/json" --data "@capabilities.json" http://appium:4723/wd/hub/session
displayName: Create Appium session
- task: PublishBuildArtifacts@1
inputs:
pathToPublish: $(temp)/appium/
artifactName: logs
displayName: Publish Appium logs