forked from spesmilo/electrum
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathJenkinsfile
More file actions
106 lines (82 loc) · 5.44 KB
/
Jenkinsfile
File metadata and controls
106 lines (82 loc) · 5.44 KB
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
def project = 'electrum-vault'
def project_type = 'python'
def project_ext = 'bin'
def git_branch = env.BRANCH_NAME
def prefix_branch = env.BRANCH_NAME.replaceAll("/", "_")
def GitUrl = 'https://github.com/bitcoinvault/'+project+'.git'
def file_extension= '.txt'
def already_released_version=false
def force_release = false
def nexus_url = 'nexus.cloudbestenv.com:8443'
node('local-docker') {
def docker_linux
def docker_wine
stage('Clone repository') {
/* Let's make sure we have the repository cloned to our workspace */
git url: GitUrl, branch: git_branch
}
stage('Build linux image') {
/* This builds the actual image; synonymous to
* docker build on the command line */
docker_linux = docker.build("electrum-appimage-builder-cont","./contrib/build-linux/appimage")
}
stage('Upload linux binary') {
withEnv(["GIT_COMMITTER_NAME=Jenkins", "GIT_COMMITTER_EMAIL=jenkins@minebest.com"]) {
/* Ideally, we would run a test framework against our image.
* For this example, we're using a Volkswagen-type approach ;-) */
docker_linux.inside {
sh 'cd contrib/build-linux/appimage && ./build.sh'
}
tag = sh(script: "git describe --tags --abbrev=7 --dirty --always",returnStdout:true,).trim()
nexusArtifactUploader artifacts: [[artifactId: "${project}-${project_type}", classifier: '', file: "dist/electrum-${tag}-x86_64.AppImage", type: "${project_ext}"]], credentialsId: 'jenkins-rw-nexus', groupId: '', nexusUrl: "${nexus_url}", nexusVersion: 'nexus3', protocol: 'https', repository: 'miningcityv2', version: "${tag}"
}
}
stage('Build wine image') {
/* This builds the actual image; synonymous to
* docker build on the command line */
sh 'sudo chown -R jenkins ./contrib/build-wine'
docker_wine = docker.build("electrum-wine-builder-img","./contrib/build-wine")
}
stage('Upload windows binary') {
withEnv(["GIT_COMMITTER_NAME=Jenkins", "GIT_COMMITTER_EMAIL=jenkins@minebest.com","PYTHONIOENCODING=UTF-8","LC_ALL=C.UTF-8", "LANG=C.UTF-8"]) {
/* Ideally, we would run a test framework against our image.
* For this example, we're using a Volkswagen-type approach ;-) */
pwd = sh(script: "pwd",returnStdout:true,).trim()
sh 'docker run --rm -t -u 0 -v /var/run/docker.sock:/var/run/docker.sock -v $(which docker):/bin/docker -w /opt/wine64/drive_c/electrum/contrib/build-wine -v $(pwd):/opt/wine64/drive_c/electrum:rw electrum-wine-builder-img ./build.sh'
tag = sh(script: "git describe --tags --abbrev=9 --dirty --always",returnStdout:true,).trim()
nexusArtifactUploader artifacts: [[artifactId: "${project}-${project_type}", classifier: '', file: "contrib/build-wine/dist/electrum-${tag}.exe", type: "exe"]], credentialsId: 'jenkins-rw-nexus', groupId: '', nexusUrl: "${nexus_url}", nexusVersion: 'nexus3', protocol: 'https', repository: 'miningcityv2', version: "${tag}"
nexusArtifactUploader artifacts: [[artifactId: "${project}-${project_type}", classifier: '', file: "contrib/build-wine/dist/electrum-${tag}-portable.exe", type: "exe"]], credentialsId: 'jenkins-rw-nexus', groupId: '', nexusUrl: "${nexus_url}", nexusVersion: 'nexus3', protocol: 'https', repository: 'miningcityv2', version: "${tag}"
nexusArtifactUploader artifacts: [[artifactId: "${project}-${project_type}", classifier: '', file: "contrib/build-wine/dist/electrum-${tag}-setup.exe", type: "exe"]], credentialsId: 'jenkins-rw-nexus', groupId: '', nexusUrl: "${nexus_url}", nexusVersion: 'nexus3', protocol: 'https', repository: 'miningcityv2', version: "${tag}"
//add information about git
sh "echo $project,$tag,$prefix_branch > $project-$prefix_branch-latest.txt"
nexusArtifactUploader artifacts: [[artifactId: "${project}-${project_type}", classifier: '', file: "${project}-${prefix_branch}-latest.txt", type: "txt"]], credentialsId: 'jenkins-rw-nexus', groupId: 'Global', nexusUrl: "${nexus_url}", nexusVersion: 'nexus3', protocol: 'https', repository: 'miningcityv2', version: "${tag}"
cleanWs();
}
}
}
node('mac-jenkins') {
stage('Clone repository') {
/* Let's make sure we have the repository cloned to our workspace */
git url: GitUrl, branch: git_branch
}
stage('build macos binary') {
withEnv(["PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"]){
sh '''
git submodule update --init
find contrib/osx/
pushd contrib/osx/CalinsQRReader; xcodebuild; popd
cp -r contrib/osx/CalinsQRReader/build prebuilt_qr
./contrib/osx/make_osx
'''
}
}
stage('Upload macos binary') {
withEnv(["GIT_COMMITTER_NAME=Jenkins", "GIT_COMMITTER_EMAIL=jenkins@minebest.com"]) {
/* Ideally, we would run a test framework against our image.
* For this example, we're using a Volkswagen-type approach ;-) */
tag = sh(script: "git describe --tags --abbrev=9 --dirty --always",returnStdout:true,).trim()
nexusArtifactUploader artifacts: [[artifactId: "${project}-${project_type}", classifier: '', file: "dist/electrum-${tag}.dmg", type: "dmg"]], credentialsId: 'jenkins-rw-nexus', groupId: '', nexusUrl: "${nexus_url}", nexusVersion: 'nexus3', protocol: 'https', repository: 'miningcityv2', version: "${tag}"
cleanWs();
}
}
}