-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle
146 lines (127 loc) · 3.64 KB
/
build.gradle
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
buildscript {
repositories {
jcenter()
}
dependencies {
classpath group: 'com.linkedin.pygradle', name: 'pygradle-plugin', version: '0.6.17'
}
}
plugins {
id 'net.researchgate.release' version '2.6.0'
}
apply plugin: 'maven'
apply plugin: 'com.linkedin.python-cli'
ext.version_nb = "2.0"
version = "$version_nb"
if (!project.hasProperty("env")) {
ext.artifactVersion = "${version_nb}-SNAPSHOT"
} else if (project.env == "release"){
ext.artifactVersion = "${version_nb}"
}
ext {
imageRepo = "attx-dev"
artifactRepoPort = "8081"
pypiRepoPort = "5039"
serviceID = "org.uh.hulib.attx.services"
}
if (!project.hasProperty("artifactRepoURL")) {
ext.artifactRepoURL = "http://${imageRepo}:${artifactRepoPort}/repository/attx-releases"
}
if (!project.hasProperty("pypiURL")) {
ext.pypiURL = "http://${imageRepo}:${pypiRepoPort}/"
}
if (!project.hasProperty("artifactRepoUser")) {
ext.artifactRepoUser = ""
}
if (!project.hasProperty("artifactRepoPassword")) {
ext.artifactRepoPassword = ""
}
python {
testDir = file('tests')
forceVersion('pypi', 'pytz', '2016.4') // needed in Jenkins for some reason
}
dependencies {
python 'pypi:pbr:3.1.1'
python 'pypi:pytz:2016.4'
python 'pypi:jsonschema:2.6.0'
python 'pypi:celery:4.1.0'
python 'pypi:SQLAlchemy:1.1.13'
python 'pypi:falcon:1.3.0'
python 'pypi:requests:2.18.4'
python 'pypi:SPARQLWrapper:1.8.0'
python 'pypi:AMQPStorm:2.2.2'
python 'pypi:rdflib:4.2.2'
python 'pypi:rdflib-jsonld:0.4.0'
python 'pypi:gunicorn:19.7.1'
python 'pypi:python-mimeparse:1.6.0'
python 'pypi:click:6.7'
python 'pypi:schedule:0.4.3'
test 'pypi:pbr:3.1.1'
test 'pypi:pytz:2016.4'
test 'pypi:httpretty:0.8.14'
test 'pypi:responses:0.7.0'
}
// Succesfully running the tests requires a logs folder existing.
task creatFolders {
description = "Create logs and data folders."
doFirst {
mkdir('logs')
// mkdir('data')
}
}
buildPex.dependsOn creatFolders
pytest.dependsOn creatFolders
repositories {
// using a local repository
ivy{
name 'pypi-local'
url "/home/user/pivy/"
layout 'pattern' , {
artifact '[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]'
ivy '[organisation]/[module]/[revision]/[module]-[revision].ivy'
}
}
// using a web repository
ivy{
name 'pypi-remote'
url "$pypiURL"
layout 'pattern' , {
artifact '[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]'
ivy '[organisation]/[module]/[revision]/[module]-[revision].ivy'
}
}
}
release {
failOnCommitNeeded = true
failOnPublishNeeded = true
failOnSnapshotDependencies = true
failOnUnversionedFiles = true
failOnUpdateNeeded = true
revertOnFail = true
tagCommitMessage = '[Gradle Release Plugin] - creating tag: '
tagTemplate = '$name-$version'
scmAdapters = [
net.researchgate.release.GitAdapter
]
git {
requireBranch = 'master'
pushToRemote = 'origin'
pushToBranchPrefix = ''
commitVersionFileOnly = false
signTag = false
}
}
uploadArchives {
repositories {
mavenDeployer {
repository(url: "${artifactRepoURL}") {
authentication(userName: "${artifactRepoUser}", password: "${artifactRepoPassword}")
}
pom.project {
version = "${artifactVersion}"
groupId = "${serviceID}"
description "Provenance Service."
}
}
}
}