-
Notifications
You must be signed in to change notification settings - Fork 5
/
.travis.yml
43 lines (34 loc) · 1.4 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
sudo: required
language: python
services:
- docker
matrix:
include:
#- python: 3.4
- python: 3.5
- python: 3.6
branches:
only:
- master
before_install:
- echo ' ----------------- BUILD PART 1 ----------------- '
- echo REGISTRY_USER = $REGISTRY_USER && echo REGISTRY_PASS = $REGISTRY_PASS
- echo 'docker bulid...' && docker build . -t xjob_env_instance
script:
- echo ' ----------------- TEST PART 1 ----------------- '
- echo 'DOCKER TEST' && docker run -it xjob_env_instance echo "docker test 123"
- echo 'AIRFLOW TEST' && docker run -it xjob_env_instance /bin/bash -c "bash tests/launch_test.sh"
- echo 'SPARK TEST' && docker run -it xjob_env_instance /bin/bash -c "cd dags && spark-submit src/pyspark_demo.py"
- container_id="` docker ps -a | awk 'FNR == 2 {print $1}'`" && echo container_id = $container_id && image_id="` docker ps -a | awk 'FNR == 2 {print $2}'`" && echo image_id = $image_id
- docker ps -a
- docker images
after_success:
- coverage report
- coveralls
before_deploy:
- echo "$REGISTRY_PASS" | docker login -u "$REGISTRY_USER" --password-stdin && echo "docker login OK" || echo "docker login failed"
deploy:
provider: script
script: (echo ----------------- DEPLOY PART 1----------------- && docker commit $container_id yennanliu/xjob_env_instance:V1 && docker push yennanliu/xjob_env_instance:V1)
on:
branch: master