-
Notifications
You must be signed in to change notification settings - Fork 14
/
.drone.yml
174 lines (168 loc) · 4.86 KB
/
.drone.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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
kind: pipeline
name: default
### Клонируем репозиторий
clone:
clone:
image: plugins/git
tags: true
steps:
- name: fetch-tags
image: docker:git
commands:
- git fetch --tags
when:
event:
- tag
- name: tag-the-image
image: alpine/git:1.0.4
pull: false
commands:
- echo -n `git describe --tags | sed -e "s/^v//"`",latest" > .tags
- name: tests
image: gcr.io/time-coin/sbt:latest
pull: true
volumes:
- name: sbt-cache
path: /workdir/sbt
- name: coursier-cache
path: /workdir/coursier
commands:
- export COURSIER_CACHE='/workdir/coursier/'
- export SBT_OPTS='-Dsbt.global.base=/workdir/sbt/ -Dsbt.ivy.home=/workdir/ivy/ -Divy.home=/workdir/ivy/'
- cd /workdir/code && sbt $SBT_OPTS -mem 2048 headerCheck scalafmtCheck test:scalafmtCheck test "gen-doc/run --check"
- name: package-zip
image: gcr.io/time-coin/sbt:latest
volumes:
- name: sbt-cache
path: /workdir/sbt
- name: coursier-cache
path: /workdir/coursier
commands:
- export COURSIER_CACHE='/workdir/coursier/'
- export SBT_OPTS='-Dsbt.global.base=/workdir/sbt/ -Dsbt.ivy.home=/workdir/ivy/ -Divy.home=/workdir/ivy/'
- cd /workdir/code && sbt $SBT_OPTS -mem 2048 cli/universal:packageZipTarball cli/universal:stage broadcaster/universal:stage faucet/universal:stage
- mv /workdir/code/cli/target/universal/*.tgz /workdir/code/cli/target/universal/PravdaSDK-$DRONE_TAG.tgz
when:
event: tag
- name: pack-win-installer
image: gcr.io/time-coin/builder:0.1
environment:
PRAVDA_VERSION: ${DRONE_TAG}
commands:
- cp -rf /workdir/code/cli/target/universal/stage /workdir/code/win-installer/
- cd /workdir/code/win-installer && bash build.sh
- find . -iname "*.zip" | grep ".zip"
when:
event: tag
- name: build-sign-msi
image: gcr.io/time-coin/alpine-curl:0.1
commands:
- export MSI_SERVICE_URI="http://89.20.35.142:8080/pravda-upload-win"
- for zip_file in /workdir/code/win-installer/*.zip; do curl -F zip=@$zip_file "$MSI_SERVICE_URI?version=$DRONE_TAG" -o $${zip_file%.zip}.msi; done
- cd /workdir/code/win-installer && find . -iname "*.msi" | grep ".msi"
when:
event: tag
- name: publish-to-bintray
image: gcr.io/time-coin/sbt:latest
volumes:
- name: sbt-cache
path: /workdir/sbt
- name: coursier-cache
path: /workdir/coursier
environment:
BINTRAY_USER:
from_secret: bintray_user
BINTRAY_PASS:
from_secret: bintray_pass
commands:
- export COURSIER_CACHE='/workdir/coursier/'
- export SBT_OPTS='-Dsbt.global.base=/workdir/sbt/ -Dsbt.ivy.home=/workdir/ivy/ -Divy.home=/workdir/ivy/'
- cd /workdir/code && sbt $SBT_OPTS -mem 2048 publish
when:
event: tag
- name: publish-github-releases
image: plugins/github-release
settings:
api_key:
from_secret: github_release_api_key
files:
- /workdir/code/win-installer/*.msi
- /workdir/code/cli/target/universal/*.tgz
when:
event: tag
- name: publish-docker-hub
image: plugins/docker
settings:
repo: expload/pravda
context: .
dockerfile: docker/images/pravda-cli/Dockerfile
username:
from_secret: docker_username
password:
from_secret: docker_password
when:
event: tag
- name: publish-pravda-faucet
image: plugins/docker
settings:
repo: expload/pravda-faucet
context: .
dockerfile: docker/images/pravda-faucet/Dockerfile
username:
from_secret: docker_username
password:
from_secret: docker_password
when:
event: tag
- name: publish-broadcaster-to-docker
image: plugins/docker
settings:
repo: expload/pravda-broadcaster
context: .
dockerfile: docker/images/broadcaster/Dockerfile
username:
from_secret: docker_username
password:
from_secret: docker_password
when:
event: tag
- name: publish-pravda-dll-nuget
image: microsoft/dotnet:2.2-sdk
environment:
PRAVDA_VERSION: ${DRONE_TAG##v}
NUGET_KEY:
from_secret: nuget_key
commands:
- cd /workdir/code/PravdaDotNet/Pravda
- dotnet pack -c Release
- dotnet nuget push bin/Release/Expload.Pravda.$PRAVDA_VERSION.nupkg -k $NUGET_KEY -s https://api.nuget.org/v3/index.json
settings:
nuget_key:
from_secret: nuget_key
when:
event: tag
- name: publish-pravda-program-template-nuget
image: chicker/nuget:0.8
environment:
PRAVDA_VERSION: ${DRONE_TAG##v}
NUGET_KEY:
from_secret: nuget_key
commands:
- cd /workdir/code/PravdaProgramTemplate
- nuget pack -Version $PRAVDA_VERSION Expload.PravdaProgramTemplate.nuspec
- dotnet nuget push Expload.PravdaProgramTemplate.$PRAVDA_VERSION.nupkg -k $NUGET_KEY -s https://api.nuget.org/v3/index.json
settings:
NUGET_KEY:
from_secret: nuget_key
when:
event: tag
workspace:
base: /workdir
path: code
image_pull_secrets:
- dockerconfigjson
volumes:
- name: sbt-cache
temp: {}
- name: coursier-cache
temp: {}