forked from cenit-io/cenit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
42 lines (32 loc) · 1.36 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
sudo: required
services:
- docker
dist: focal
language: ruby
rvm:
- 2.5.5
branches:
only:
- master
before_install:
#Log in to the Docker CLI
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker pull mongo:3.6
- docker pull redis
- docker run -d -p 127.0.0.1:27017:27017 mongo:3.6
- docker run -p 127.0.0.1:6379:6379 -d redis redis-server --appendonly yes
- export DB_PORT=127.0.0.1:27017 SKIP_RABBIT_MQ=true
- sudo apt install -y zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev libffi-dev imagemagick libmagickwand-dev
before_script:
- bundle exec rake assets:precompile
script:
- bundle exec rspec spec
after_success:
#Build image based on New Relic CLI
- docker build -t cenitio/backend:newrelic-${TRAVIS_COMMIT::7} ./docker/newrelic
- docker build -t cenitio/frontend:newrelic-${TRAVIS_COMMIT::7} --build-arg COMMIT=${TRAVIS_COMMIT::7} ./docker/newrelic/ui
- docker build -t cenitio/backend:ubuntu-${TRAVIS_COMMIT::7} -t cenitio/backend:latest ./docker/ubuntu
- docker build -t cenitio/frontend:ubuntu-${TRAVIS_COMMIT::7} -t cenitio/frontend:latest --build-arg COMMIT=${TRAVIS_COMMIT::7} ./docker/ubuntu/ui
#Pushing containers
- docker push --all-tags cenitio/backend
- docker push --all-tags cenitio/frontend