-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.gradle
61 lines (48 loc) · 1.81 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
apply plugin: 'nebula.ospackage'
buildscript {
// Repositories from which this build.gradle will get it's dependencies.
repositories {
jcenter()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.netflix.nebula:gradle-ospackage-plugin:4.3.0'
}
}
// Nebula plugin which enable the debian package to be built.
apply plugin: 'nebula.ospackage'
// build directory for gradlew
project.buildDir = 'build/'
// Main gradle taske that builds the artifact.
// Launched by running: ./gradlew buildDeb or ./gradlew buildRpm
// Docs can be found: https://github.com/nebula-plugins/gradle-ospackage-plugin/wiki/Deb-Plugin
ospackage {
// Jenkin's provided env variables
def buildNumber = System.getenv("BUILD_NUMBER") ?: "0"
def branchName = System.getenv("BRANCH_NAME")?.replaceAll("/", "-") ?: "dev"
// this will create a file in build/distributions
// that looks like <packageName>_<version>_<release>_<arch>.deb
packageName = "spinnaker-config"
version = "0.${buildNumber}.0"
release = "h${buildNumber}.${branchName}"
user = 'root'
permissionGroup = 'root'
arch = "all"
// Package requirements
requires('curl')
// where to drop the configuration, artifacts which are created as part of the build
// from -> where the files are present after the build on Jenkins builder
// into -> where the files are expected to be after installing debian package
from('deb-config/spinnaker/compose/') {
into '/opt/spinnaker/compose/'
}
from('deb-config/spinnaker/config/') {
into '/opt/spinnaker/config/'
}
from('deb-config/spinnaker/env/') {
into '/opt/spinnaker/env/'
}
// Things your package may need as root -> for example a system user for the app,
// Log directory creation/permissions, etc.
postInstall file('deb-config/scripts/post-install.sh')
}