forked from common-voice/common-voice
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
49 lines (49 loc) · 3.09 KB
/
.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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
dist: trusty
sudo: enabled
language: node_js
node_js:
- '10'
services:
- mysql
- docker
# Skip npm install
install: true
before_install:
- mysql -e "SET PASSWORD FOR 'root'@'localhost' = PASSWORD('');"
- sudo add-apt-repository ppa:mc3man/trusty-media --yes
- sudo apt-get update
- sudo apt-get install ffmpeg gstreamer0.10-ffmpeg
before_script:
- SAFE_BRANCH_NAME=$(echo -n $TRAVIS_BRANCH | perl -pe's/[^a-zA-Z0-9_.-]/_/g' )
- REVISION_TAG="$SAFE_BRANCH_NAME-$TRAVIS_COMMIT"
- if [ "$TRAVIS_TAG" == "" ]; then SYMBOLIC_TAG="$SAFE_BRANCH_NAME-latest"; else SYMBOLIC_TAG="$TRAVIS_TAG";
fi
- echo "Branch $SAFE_BRANCH_NAME"
- echo "Tag $TRAVIS_TAG"
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin; fi
- if [ "$TRAVIS_TAG" == "" ]; then docker pull "$IMAGE_NAME:$SYMBOLIC_TAG" || true
; fi
after_script:
- docker images
script:
- docker build --build-arg=TAG=$TRAVIS_TAG --build-arg=REPO=$TRAVIS_REPO_SLUG --build-arg=COMMIT=$TRAVIS_COMMIT
--build-arg=BRANCH=$TRAVIS_BRANCH --pull --cache-from "$IMAGE_NAME" --tag "$IMAGE_NAME"
-f docker/Dockerfile .
- yarn install --frozen-lockfile
- yarn test
before_deploy:
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker tag $IMAGE_NAME "$IMAGE_NAME:$REVISION_TAG"
- docker tag $IMAGE_NAME "$IMAGE_NAME:$SYMBOLIC_TAG"
- git diff
deploy:
provider: script
on:
all_branches: true
condition: ($TRAVIS_TAG != "" || $TRAVIS_BRANCH =~ ^(main|production|stage)$) && ! $TRAVIS_COMMIT_MESSAGE =~ ^Pontoon:*
script: docker push "$IMAGE_NAME:$REVISION_TAG" && docker push "$IMAGE_NAME:$SYMBOLIC_TAG"
env:
global:
- IMAGE_NAME=itsre/voice-web
- secure: UQGXi9wTiftApnfryK7fyMliNRZ+UzG93VlehYn3K5Aw7kZpJZEX5xJyz8sN0zMErxcaQC0LZ9CJF/fDCMb/LDW1dxsMin0Y8Sqr3nikpv0qMIE9rjzpwd2VEsfT9ya6ruLtW2fWfkH3FV+6+oVdWuwYr0C19E+AnQFImL/O48y5kmFMIAY4FC99cOL5PpiBA8uFj+5vniVC7vTcCg8/cvXNYYSLCwwc7Y4R8xDiXSUCtBDvnEn6fWX9oO6AdEoWLCMAwbmkk7qG/W5ijnS5depuRgoKzK6og98KVSxjRZv7xWkHx06Bn2Csvxd4m+W3WwV4YdL5SPec0k+H3bZ9+Fw+cljPjhFqwj1wMEqR2cCkFXtSzDloBPrDt4oQY5J6IZ00LmB+ul8c6rcM+j6F9c8lS36Pj08/OymZHLCowVJHMGgnG9X6CwykFHz0Po+kCcrbwfkOkcpRWG2JHPicpSUSOPCRPNM2dKa/QzjlCCI4DrBQrcGt6RS5DVMKm4PE9K7eIovP5CjSfHPx4n9BaDFdiwM0wpKgJAvafMyR6d4OPTguiwUyPJf4Bugx1kGkEjohvUnGf0m3zW3ZO2LTNf2zILOI1bcTsNWtJX+GLfUrczzYlA8UWDaPGWqncesoYH1SZ3QHf5fFvq+nhXKoZXNbrrJM8m/Quw9lidw0to0=
- secure: wYs0Ay42nlfJSVSgYTztgcIRQc5gl0WxrJDKlxtpEb35zjFUmXcnNfCtSt0hSE2Oi/5R2F0dFedP6/asVgE16KPL6ozx75L3FWY1JMcrJz3jrB1odeij1qt0mpjCY4R7ojUt2TbtMEhI3XGOnwDocl0JxfE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