Skip to content

Commit 04a28c7

Browse files
Define appveyor.yml before_build script for Ubuntu
1 parent f00121c commit 04a28c7

File tree

1 file changed

+38
-30
lines changed

1 file changed

+38
-30
lines changed

appveyor.yml

Lines changed: 38 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -29,43 +29,14 @@ matrix:
2929
fast_finish: true
3030

3131
for:
32-
-
32+
- # Visual Studio 2019
3333
matrix:
3434
only:
3535
- image: Visual Studio 2019
3636
services:
3737
- postgresql13
38-
- docker
3938
# REF: https://github.com/docascode/docfx-seed/blob/master/appveyor.yml
4039
before_build:
41-
- sh: |
42-
# Pull Azure Cosmos Emulator Docker image
43-
echo "Pulling Azure Cosmos Emulator Docker image for Linux ..."
44-
./pull-docker-azure-cosmos-emulator-linux.sh
45-
46-
# Start Azure Cosmos Emulator container
47-
echo "Running Azure Cosmos Emulator Docker container ..."
48-
nohup ./run-docker-azure-cosmos-emulator-linux.sh &
49-
50-
# Wait for Docker container being started in the background
51-
echo "Waiting 60 seconds before trying to download Azure Cosmos Emulator SSL certificate ..."
52-
sleep 60
53-
54-
# Print the background process output to see whether there are any errors
55-
if [ -f "./nohup.out" ]; then
56-
echo "--- BEGIN CONTENTS OF NOHUP.OUT ---"
57-
cat ./nohup.out
58-
echo "--- END CONTENTS OF NOHUP.OUT ---"
59-
fi
60-
61-
# Install SSL certificate to be able to access the emulator
62-
echo "Installing Azure Cosmos Emulator SSL certificate ..."
63-
sudo ./install-azure-cosmos-emulator-linux-certificates.sh
64-
- pwsh: |
65-
# Start Azure Cosmos Emulator on Windows
66-
if ($isWindows) {
67-
.\start-cosmos-db-emulator.ps1
68-
}
6940
- pwsh: |
7041
if (-Not $env:APPVEYOR_PULL_REQUEST_TITLE) {
7142
# https://dotnet.github.io/docfx/tutorial/docfx_getting_started.html
@@ -77,6 +48,11 @@ for:
7748
if ($lastexitcode -ne 0) {
7849
throw "docfx install failed with exit code $lastexitcode."
7950
}
51+
- pwsh: |
52+
# Start Azure Cosmos Emulator on Windows
53+
if ($isWindows) {
54+
.\start-cosmos-db-emulator.ps1
55+
}
8056
after_build:
8157
- pwsh: |
8258
CD ./docs
@@ -124,6 +100,38 @@ for:
124100
on:
125101
branch: /release\/.+/
126102
appveyor_repo_tag: true
103+
- # Ubuntu
104+
matrix:
105+
only:
106+
- Ubuntu
107+
services:
108+
- postgresql13
109+
- docker
110+
before_build:
111+
- sh: |
112+
# Start Azure Cosmos Emulator on Linux
113+
# Pull Azure Cosmos Emulator Docker image
114+
echo "Pulling Azure Cosmos Emulator Docker image for Linux ..."
115+
./pull-docker-azure-cosmos-emulator-linux.sh
116+
117+
# Start Azure Cosmos Emulator container
118+
echo "Running Azure Cosmos Emulator Docker container ..."
119+
nohup ./run-docker-azure-cosmos-emulator-linux.sh &
120+
121+
# Wait for Docker container being started in the background
122+
echo "Waiting 60 seconds before trying to download Azure Cosmos Emulator SSL certificate ..."
123+
sleep 60
124+
125+
# Print the background process output to see whether there are any errors
126+
if [ -f "./nohup.out" ]; then
127+
echo "--- BEGIN CONTENTS OF NOHUP.OUT ---"
128+
cat ./nohup.out
129+
echo "--- END CONTENTS OF NOHUP.OUT ---"
130+
fi
131+
132+
# Install SSL certificate to be able to access the emulator
133+
echo "Installing Azure Cosmos Emulator SSL certificate ..."
134+
sudo ./install-azure-cosmos-emulator-linux-certificates.sh
127135
128136
build_script:
129137
- pwsh: |

0 commit comments

Comments
 (0)