2018-08-14 18:09:52 +00:00
|
|
|
common = load 'ci/common.groovy'
|
|
|
|
|
|
|
|
packageFolder = './StatusImPackage'
|
2018-08-21 15:17:25 +00:00
|
|
|
|
2018-08-14 18:09:52 +00:00
|
|
|
def cleanupBuild() {
|
2018-08-30 12:56:45 +00:00
|
|
|
sh 'make clean'
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
def cleanupAndDeps() {
|
|
|
|
cleanupBuild()
|
|
|
|
sh 'cp .env.jenkins .env'
|
|
|
|
sh 'lein deps'
|
|
|
|
common.installJSDeps('desktop')
|
|
|
|
}
|
|
|
|
|
|
|
|
def slackNotify(message, color = 'good') {
|
|
|
|
slackSend(
|
|
|
|
color: color,
|
|
|
|
channel: '#jenkins-desktop',
|
|
|
|
message: "develop (${env.CHANGE_BRANCH}) ${message} ${env.BUILD_URL}"
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
def buildClojureScript() {
|
2018-09-13 09:44:33 +00:00
|
|
|
sh 'make prod-build-desktop'
|
|
|
|
sh './scripts/build-desktop.sh buildClojureScript'
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
def uploadArtifact(filename) {
|
|
|
|
def domain = 'ams3.digitaloceanspaces.com'
|
|
|
|
def bucket = 'status-im-desktop'
|
|
|
|
withCredentials([usernamePassword(
|
|
|
|
credentialsId: 'digital-ocean-access-keys',
|
|
|
|
usernameVariable: 'DO_ACCESS_KEY',
|
|
|
|
passwordVariable: 'DO_SECRET_KEY'
|
|
|
|
)]) {
|
|
|
|
sh """
|
|
|
|
s3cmd \\
|
|
|
|
--acl-public \\
|
|
|
|
--host='${domain}' \\
|
|
|
|
--host-bucket='%(bucket)s.${domain}' \\
|
|
|
|
--access_key=${DO_ACCESS_KEY} \\
|
|
|
|
--secret_key=${DO_SECRET_KEY} \\
|
|
|
|
put ${filename} s3://${bucket}/
|
|
|
|
"""
|
|
|
|
|
|
|
|
}
|
|
|
|
def url = "https://${bucket}.${domain}/${filename}"
|
|
|
|
return url
|
|
|
|
}
|
|
|
|
|
|
|
|
/* MAIN --------------------------------------------------*/
|
|
|
|
|
|
|
|
def prepDeps() {
|
|
|
|
common.doGitRebase()
|
|
|
|
cleanupAndDeps()
|
|
|
|
}
|
2018-08-28 14:09:22 +00:00
|
|
|
|
2018-09-13 09:44:33 +00:00
|
|
|
def compile() {
|
|
|
|
sh './scripts/build-desktop.sh compile'
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
2018-08-28 14:09:22 +00:00
|
|
|
|
2018-11-06 21:29:16 +00:00
|
|
|
def bundleWindows(type = 'nightly') {
|
|
|
|
def pkg
|
|
|
|
|
|
|
|
sh './scripts/build-desktop.sh bundle'
|
|
|
|
dir(packageFolder) {
|
2018-11-05 09:40:11 +00:00
|
|
|
pkg = common.pkgFilename(type, 'exe')
|
|
|
|
sh "mv ../Status-x86_64-setup.exe ${pkg}"
|
2018-11-06 21:29:16 +00:00
|
|
|
}
|
|
|
|
return "${packageFolder}/${pkg}".drop(2)
|
|
|
|
}
|
|
|
|
|
2018-08-23 12:56:19 +00:00
|
|
|
def bundleLinux(type = 'nightly') {
|
|
|
|
def pkg
|
2018-08-14 18:09:52 +00:00
|
|
|
|
2018-09-13 09:44:33 +00:00
|
|
|
sh './scripts/build-desktop.sh bundle'
|
2018-08-14 18:09:52 +00:00
|
|
|
dir(packageFolder) {
|
2018-08-23 12:56:19 +00:00
|
|
|
pkg = common.pkgFilename(type, 'AppImage')
|
2018-10-19 15:50:35 +00:00
|
|
|
sh "mv ../Status-x86_64.AppImage ${pkg}"
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
2018-08-23 12:56:19 +00:00
|
|
|
return "${packageFolder}/${pkg}".drop(2)
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
|
|
|
|
2018-08-23 12:56:19 +00:00
|
|
|
def bundleMacOS(type = 'nightly') {
|
|
|
|
def pkg = common.pkgFilename(type, 'dmg')
|
2018-09-13 09:44:33 +00:00
|
|
|
sh './scripts/build-desktop.sh bundle'
|
2018-08-14 18:09:52 +00:00
|
|
|
dir(packageFolder) {
|
2018-09-08 16:08:24 +00:00
|
|
|
withCredentials([
|
|
|
|
string(credentialsId: 'desktop-gpg-outer-pass', variable: 'GPG_PASS_OUTER'),
|
|
|
|
string(credentialsId: 'desktop-gpg-inner-pass', variable: 'GPG_PASS_INNER'),
|
|
|
|
string(credentialsId: 'desktop-keychain-pass', variable: 'KEYCHAIN_PASS')
|
|
|
|
]) {
|
|
|
|
sh '../scripts/sign-macos-pkg.sh Status.app ../deployment/macos/macos-developer-id.keychain-db.gpg'
|
|
|
|
sh "../node_modules/appdmg/bin/appdmg.js ../deployment/macos/status-dmg.json ${pkg}"
|
|
|
|
sh "../scripts/sign-macos-pkg.sh ${pkg} ../deployment/macos/macos-developer-id.keychain-db.gpg"
|
|
|
|
}
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
2018-08-23 12:56:19 +00:00
|
|
|
return "${packageFolder}/${pkg}".drop(2)
|
2018-08-14 18:09:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return this
|