forked from compulim/azure-webapp-for-containers-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
29 lines (23 loc) · 938 Bytes
/
.travis.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
language: node_js
services:
- docker
node_js: "12"
before_install:
# Install AZ CLI
- AZ_REPO=$(lsb_release -cs) && echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" | sudo tee /etc/apt/sources.list.d/azure-cli.list
- curl -L https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
- sudo apt-get install apt-transport-https
- sudo apt-get update && sudo apt-get install azure-cli
install:
- export DOCKER_FULL_IMAGE_NAME=$ACR_NAME.azurecr.io/$DOCKER_IMAGE_NAME:$TRAVIS_COMMIT
- docker build -t $DOCKER_FULL_IMAGE_NAME .
script:
- docker run -d --env PORT=80 --name test-image -p 80:80 --rm $DOCKER_FULL_IMAGE_NAME
- sleep 2 # We need to sleep 2 seconds because the web server did not listen yet
- curl -f --retry 10 --retry-max-time 30 -vv http://localhost/health.txt
- docker stop test-image
deploy:
provider: script
on:
branch: master
script: bash scripts/docker_push