This repository has been archived by the owner on Oct 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
132 lines (113 loc) · 2.92 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
plugins {
id 'com.github.blindpirate.gogradle' version '0.11.4'
id 'nebula.ospackage' version '8.4.1'
}
golang {
packagePath = 'github.com/danopia/kube-pet-node'
goVersion = '1.13.4'
}
goBuild {
targetPlatform = ['linux-amd64']
}
installDependencies.enabled = false
resolveBuildDependencies.enabled = false
resolveTestDependencies.enabled = false
task stripBin(type: Exec) {
workingDir ".gogradle"
commandLine 'strip', 'kube-pet-node-linux-amd64'
}
tasks.stripBin.dependsOn 'goBuild'
apply plugin: 'nebula.deb'
task packageDeb(type: Deb) {
def buildId = System.getenv('BUILD_ID')
if (buildId != null) {
release = buildId
} else {
release = 1
}
arch = 'amd64'
postInstall file('gradle/dist/deb-postInstall.sh')
requires('adduser') // for postinst script
requires('podman')
requires('wget') // for upgrade script
recommends('wireguard')
recommends('systemd')
into '/opt/kube-pet-node'
user 'root'
permissionGroup 'root'
from('.gogradle/kube-pet-node-linux-amd64') {
into 'bin'
}
link('/usr/bin/kube-pet-node',
'/opt/kube-pet-node/bin/kube-pet-node-linux-amd64')
from('gradle/dist/node-upgrade.sh') {
into 'bin'
}
from('gradle/dist/kube-podman.service') {
into '/usr/lib/systemd/system'
fileMode 0664
}
from('gradle/dist/kube-podman.socket') {
into '/usr/lib/systemd/system'
fileMode 0664
}
from('gradle/dist/kube-pet-node.service') {
into '/usr/lib/systemd/system'
fileMode 0664
}
// user 'kube-pet'
// permissionGroup 'kube-pet'
from('gradle/dist/sudoers') {
into 'dist'
fileMode 0440
}
link('/etc/sudoers.d/kube-pet-node',
'/opt/kube-pet-node/dist/sudoers')
}
tasks.packageDeb.dependsOn stripBin
apply plugin: 'nebula.rpm'
task packageRpm(type: Rpm) {
def buildId = System.getenv('BUILD_ID')
if (buildId != null) {
release = buildId
}
os LINUX
arch X86_64
preInstall file('gradle/dist/rpm-preInstall.sh')
postInstall file('gradle/dist/rpm-postInstall.sh')
preUninstall file('gradle/dist/rpm-preUninstall.sh')
postUninstall file('gradle/dist/rpm-postUninstall.sh')
requires('podman')
recommends('wireguard')
recommends('systemd')
into '/opt/kube-pet-node'
user 'root'
permissionGroup 'root'
from('.gogradle/kube-pet-node-linux-amd64') {
into 'bin'
}
link('/usr/bin/kube-pet-node',
'/opt/kube-pet-node/bin/kube-pet-node-linux-amd64')
from('gradle/dist/node-upgrade.sh') {
into 'bin'
}
from('gradle/dist/kube-podman.service') {
into '/usr/lib/systemd/system'
fileMode 0664
}
from('gradle/dist/kube-podman.socket') {
into '/usr/lib/systemd/system'
fileMode 0664
}
from('gradle/dist/kube-pet-node.service') {
into '/usr/lib/systemd/system'
fileMode 0664
}
from('gradle/dist/sudoers') {
into 'dist'
fileMode 0440
}
link('/etc/sudoers.d/kube-pet-node',
'/opt/kube-pet-node/dist/sudoers')
}
tasks.packageRpm.dependsOn stripBin