-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
50 lines (50 loc) · 2.83 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
50
services:
- docker
env:
global:
- DOCKER_COMPOSE_VERSION=1.23.2
- secure: bSUSO4BfSalDcpVkZ8YwREn51uj5CDBycZtEIzyPLLAXkEcUpv9TPrUy+MdLrkg7T0vhJ3BuPMtV4dbZ0eHx5l4KoLRJT5g0yf7cbvIWrxCm0mpegHDJrjbTESPA6oTKrEpv0KK7/UbRrX49OW6FCHCMKEN/V8iv18v7u9zolfBnjQr7gyrVbJiuFxHBJxQEP9QJN1+ulOa5n9nUlYb/ZlyqbF2Tfz7rKfDfBGDErZu/xR+U+FHJjfMpeffEQpBDfWGboBDcgfTtdkoLxuuO1byF6p2OPLXeUh9V4VX5s5vwFxVxAXxP6wobzRq5l1v095AVLGZgr98/Rc3R/viMA1IrFvBJQ7DNRG0lGZdczv2jZs1do9hBMWxkklhAfpXsiRMPhW6X4zkc7uW4eIA9RHZZetNMIPSIIL38YeL8L7UjqkLlw4HAc5QmyuIrSw3x741hz6LkX2IG9lxThyApKRV1zXN6wLDWvmhrgWgqZ0IuHowRU/h95kXfQDdW2BxHtYv3jHzLB1YwR2PMnoTyNeBWdoTpwpDliYHyut1bAZdoxzqtve3L3DoGlIJAQnhvpPoIhY1/QC7R0duUGy4asARlSwc9tVOxISYirhXyEPxHlhtE+47x2JDBkqeIimebDEB8Pxm418PMs154w5N55rlWlrP8Z5NUrRQQHOyEY1k=
- secure: TpMVBDdphouwKCCFDuzbIl8lJWH5sO+hwMG1VwW0Q7i5AlzaaYgo7m6kD2jyuOGuRnnxbhFJS4vVRa1CAFfHw/B35fO5pqFsMLaxKte5XLYU5nOtirXKUkJo4QcASsgjFS9rcvG3bLUjeMPpsZBwjxT9A/pjWUiW9VyyetEjvpfEpo1RJYPrj+ytQAwS96NLAyR5LE217Xzd1FUYDguGUI7MyMIVSp1OBmM/95eu1HhKXlCb76qRg0otDqatvEqYk+GlESzDxasWHR3y/X0yyoiZox2/VYDS/WjbWEJ4GyUmvHvxsJmYD18FMfmLN4S0ycLprX1wRlnfRBZ9uHHmn7wk9200O9VLSd5BUYhAGhyeO4xfyzLqDYK2fTny+aaTGCe+nhfIkLS2pYjGwiuTqp/GBdImkdu9BCCurAXrk6tm8Z4uHX60ProApNxmy1vddDUG+252MwdWNnp4NVm8jZih08F32b6WImgtAGgZtdnWwfg8MqrOGt2ggVnF0bxrfjYH0mudQDv4elU1svCCD9hN86QiupiX/cA1CJ4wJpj4PicGQG62I2FKPsoxZd98UoecILwaidBxgxusql1aWolJU2awvljMXp/iTeTogNygK6b/v7jBOepOZDJuToby0RLPRv91+HuhAkKl5WPn7NIKYiouq+3HsP6o6MLiXw8=
before_install:
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname
-s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
- docker --version
- docker-compose version
- echo "Login into Docker Hub"
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- export GIT_SHA=`git rev-parse --short HEAD`
- echo "Building commit $GIT_SHA"
jobs:
include:
- stage: tests
name: Unit Tests
script:
- cd Chapter04
- docker-compose build db
- docker-compose build test-postgresql
- docker-compose run test-postgresql
- stage: tests
name: Static Analysis
script:
- cd Chapter04
- docker-compose build static-analysis
- docker-compose run static-analysis
- stage: push
script:
- cd Chapter04
- docker-compose build server
- docker tag thoughts_server:latest majeformation/jd-thoughts-backend:$GIT_SHA
- docker push majeformation/jd-thoughts-backend:$GIT_SHA
- docker tag thoughts_server:latest majeformation/jd-thoughts-backend:$TRAVIS_BRANCH
deploy:
- provider: script
script: docker push majeformation/jd-thoughts-backend:$TRAVIS_BRANCH
on:
branch: master
- provider: script
script: docker push majeformation/jd-thoughts-backend:$TRAVIS_TAG
on:
tags: true