-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
128 lines (100 loc) · 4.41 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
language: csharp
solution: ExampleTDTB.sln
sudo: required
os: linux
dist: xenial
mono: latest
dotnet: 2.2
services:
- docker
env:
global:
# https://docs.microsoft.com/ru-ru/dotnet/core/rid-catalog
DOTNETRUNTIME: ubuntu-x64
# DOCKER_USER:
# DOCKER_PASS:
# BUILD_VER
before_install:
install:
- npm install -g bower
- npm install -g gulp
- sudo apt-get install graphviz
# - sudo apt-get install -y mono-devel libgit2-24
- export PATH=`echo $PATH | sed -e 's/:\/home\/travis\/\.local\/bin//'` || true
script:
- dotnet --info
- docker version
# - dotnet remove build package GitVersion.CommandLine
- dotnet restore --runtime $DOTNETRUNTIME
- dotnet build
# - ./build.sh Debug
# - ./build.sh AllCustom
# - ./build.sh compile
- echo TRAVIS_BUILD_ID $TRAVIS_BUILD_ID
- echo TRAVIS_BUILD_NUMBER $TRAVIS_BUILD_NUMBER
- echo BUILD_VER $BUILD_VER
- echo docker image ver = $BUILD_VER.$TRAVIS_BUILD_NUMBER
- echo DOCKER_USER $DOCKER_USER
- echo DOTNETRUNTIME $DOTNETRUNTIME
- if [ "$TRAVIS_BRANCH" == "master" ] ; then
dotnet publish -c Release -f netcoreapp2.2 --runtime $DOTNETRUNTIME ;
cp -r ./src/Web/bin/Release/netcoreapp2.2/$DOTNETRUNTIME/publish ./pub-web ;
docker build -t tdtb-web -f docker/Dockerfile-Web . ;
cp -r ./src/AccountService/bin/Release/netcoreapp2.2/$DOTNETRUNTIME/publish ./pub-acc ;
docker build -t tdtb-acc -f docker/Dockerfile-AccountService . ;
cp -r ./src/ToDoService/bin/Release/netcoreapp2.2/$DOTNETRUNTIME/publish ./pub-todo ;
docker build -t tdtb-todo -f docker/Dockerfile-ToDoService . ;
cp -r ./src/ToBuyService/bin/Release/netcoreapp2.2/$DOTNETRUNTIME/publish ./pub-tobuy ;
docker build -t tdtb-tobuy -f docker/Dockerfile-ToBuyService . ;
docker login -u="$DOCKER_USER" -p="$DOCKER_PASS" ;
docker tag tdtb-web roured/tdtb-web:2.0 ;
docker tag tdtb-acc roured/tdtb-acc:2.0 ;
docker tag tdtb-todo roured/tdtb-todo:2.0 ;
docker tag tdtb-tobuy roured/tdtb-tobuy:2.0 ;
docker tag tdtb-web roured/tdtb-web:latest ;
docker tag tdtb-acc roured/tdtb-acc:latest ;
docker tag tdtb-todo roured/tdtb-todo:latest ;
docker tag tdtb-tobuy roured/tdtb-tobuy:latest ;
docker push roured/tdtb-acc:2.0 ;
docker push roured/tdtb-web:2.0 ;
docker push roured/tdtb-tobuy:2.0 ;
docker push roured/tdtb-todo:2.0 ;
docker push roured/tdtb-web:latest ;
docker push roured/tdtb-acc:latest ;
docker push roured/tdtb-tobuy:latest ;
docker push roured/tdtb-todo:latest ;
docker logout ;
fi
- if [ "$TRAVIS_BRANCH" == "dev" ] ; then
dotnet publish -c Debug -f netcoreapp2.2 --runtime $DOTNETRUNTIME ;
cp -r ./src/Web/bin/Debug/netcoreapp2.2/$DOTNETRUNTIME/publish ./pub-web ;
docker build -t tdtb-web -f docker/Dockerfile-Web . ;
cp -r ./src/AccountService/bin/Debug/netcoreapp2.2/$DOTNETRUNTIME/publish ./pub-acc ;
docker build -t tdtb-acc -f docker/Dockerfile-AccountService . ;
cp -r ./src/ToDoService/bin/Debug/netcoreapp2.2/$DOTNETRUNTIME/publish ./pub-todo ;
docker build -t tdtb-todo -f docker/Dockerfile-ToDoService . ;
cp -r ./src/ToBuyService/bin/Debug/netcoreapp2.2/$DOTNETRUNTIME/publish ./pub-tobuy ;
docker build -t tdtb-tobuy -f docker/Dockerfile-ToBuyService . ;
docker login -u="$DOCKER_USER" -p="$DOCKER_PASS" ;
docker tag tdtb-web roured/tdtb-web:2.0 ;
docker tag tdtb-acc roured/tdtb-acc:2.0 ;
docker tag tdtb-todo roured/tdtb-todo:2.0 ;
docker tag tdtb-tobuy roured/tdtb-tobuy:2.0 ;
docker tag tdtb-web roured/tdtb-web:dev ;
docker tag tdtb-acc roured/tdtb-acc:dev ;
docker tag tdtb-tobuy roured/tdtb-tobuy:dev ;
docker tag tdtb-todo roured/tdtb-todo:dev ;
docker push roured/tdtb-acc:2.0 ;
docker push roured/tdtb-web:2.0 ;
docker push roured/tdtb-todo:2.0 ;
docker push roured/tdtb-tobuy:2.0 ;
docker push roured/tdtb-web:dev ;
docker push roured/tdtb-acc:dev ;
docker push roured/tdtb-todo:dev ;
docker push roured/tdtb-tobuy:dev ;
docker logout ;
fi
after_success:
- if [ "$TRAVIS_BRANCH" == "master" ] ; then
/* Push to docker repo */
fi