-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
96 lines (76 loc) · 2.12 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
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "com.moowork.gradle:gradle-node-plugin:1.1.*"
classpath("com.netflix.nebula:gradle-ospackage-plugin:3.4.0")
}
}
plugins {
id "com.moowork.node" version "1.1.1"
id "nebula.ospackage" version "3.4.0"
}
apply plugin: 'com.moowork.node'
apply plugin: "nebula.ospackage"
node {
version = '12.16.1'
npmVersion = '6.4.1'
download = true
}
def environment = project.hasProperty('env') ? env : 'prod'
task buildapp {}
buildapp.dependsOn npmInstall
buildapp.dependsOn npm_run{args = [environment]}
task cleanapp (type: Delete) {
delete 'dist', 'node_modules', 'build.tar.gz', 'build'
}
task tar(type: Tar) {
extension = 'tar.gz'
baseName = 'build'
compression = Compression.GZIP
into("/") { from "dist/vgr" }
}
tar.dependsOn buildapp
task rpm {}
rpm.dependsOn npmInstall
rpm.dependsOn npm_run{args = [environment]}
rpm.dependsOn buildRpm
task deb {}
deb.dependsOn npmInstall
deb.dependsOn npm_run{args = [environment]}
deb.dependsOn buildDeb
ospackage {
packageName = "build"
// Uses the main project version
version = "v0.0.1"
/* Could be anything - in our production builds,
this is set to the git commit hash */
release = 1
os = LINUX
type = BINARY
arch = X86_64
/* Our install scripts - see the full code for examples.
They usually do simple prep/cleanup tasks */
installUtils = file('scripts/rpm/utils.sh')
preInstall file('scripts/rpm/preInstall.sh')
postInstall file('scripts/rpm/postInstall.sh')
preUninstall file('scripts/rpm/preUninstall.sh')
postUninstall file('scripts/rpm/postUninstall.sh')
// Sets our working directory and permissions, basically
//into "/var/www/test"
// Copy the actual .jar file
from('dist') {
// Strip the version from the jar filename
fileMode 0500
into "/"
}
// Copy the config files
/*from("install/unix/conf") {
fileType CONFIG | NOREPLACE
fileMode 0754
into "conf"
}*/
}