Skip to content

Commit 08bde4e

Browse files
committed
Add Dockerfile and Jenkinsfile.
1 parent 782e680 commit 08bde4e

2 files changed

Lines changed: 95 additions & 0 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM docker.thinnect.net/ci/stretch-build-golang-deb-amd64:20190115
2+
3+
# gcc for cgo
4+
# added checkinstall and lsb-release, when compared to official cgo Dockerfile
5+
RUN apt-get update && apt-get install -y --no-install-recommends \
6+
ruby \
7+
ruby-dev \
8+
&& rm -rf /var/lib/apt/lists/* \
9+
&& gem install ronn
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
pipeline {
2+
// Make it parallel with: https://jenkins.io/blog/2017/09/25/declarative-1/
3+
agent none
4+
stages {
5+
stage('Build deviceparameters on amd64') {
6+
agent {
7+
docker {
8+
// Request for an amd64 agent
9+
image 'docker.thinnect.net/ci/stretch-build-golang-ruby-ronn-deb-amd64:20190128'
10+
registryUrl 'https://docker.thinnect.net'
11+
registryCredentialsId 'docker-pip_ci-agent'
12+
alwaysPull true
13+
}
14+
}
15+
environment {
16+
GOPATH = "$WORKSPACE"
17+
BUILD_TYPE = "debug"
18+
BUILD_ARCH = "amd64"
19+
NEXUS_UPLOAD_CREDS = credentials('nexus_ci-agent-uploader')
20+
}
21+
steps {
22+
// stage('Echo GOPATH')
23+
sh 'echo GOPATH:$GOPATH'
24+
// stage('Build and install')
25+
dir('src/github.com/thinnect/go-devparam/cmd') {
26+
sh './build-deb.sh'
27+
sh 'dpkg -i mist-device-parameters*.deb'
28+
}
29+
// stage('Run executables')
30+
sh 'deviceparameter -V'
31+
sh 'deviceparameters -V'
32+
33+
// Publish artifacts
34+
dir('src/github.com/thinnect/go-devparam/cmd') {
35+
sh \
36+
"""#!/usr/bin/env bash
37+
UPLOAD_FILENAME=(mist-device-parameters*.deb)
38+
echo "Publishing \$UPLOAD_FILENAME"
39+
exec curl -u ${NEXUS_UPLOAD_CREDS} --silent --fail --show-error --upload-file \$UPLOAD_FILENAME https://artifacts.thinnect.net/repository/ci/deviceparameters/build-${BUILD_NUMBER}/${BUILD_ARCH}/
40+
"""
41+
}
42+
}
43+
}
44+
45+
stage('Build deviceparameters on armhf') {
46+
agent {
47+
docker {
48+
// Request for an ARM agent
49+
label 'arm'
50+
image 'docker.thinnect.net/ci/stretch-build-golang-ruby-ronn-deb-armhf:20190128'
51+
registryUrl 'https://docker.thinnect.net'
52+
registryCredentialsId 'docker-pip_ci-agent'
53+
alwaysPull true
54+
}
55+
}
56+
environment {
57+
GOPATH = "$WORKSPACE"
58+
BUILD_TYPE = "debug"
59+
BUILD_ARCH = "armhf"
60+
NEXUS_UPLOAD_CREDS = credentials('nexus_ci-agent-uploader')
61+
}
62+
steps {
63+
// stage('Echo GOPATH')
64+
sh 'echo GOPATH:$GOPATH'
65+
// stage('Build and install')
66+
dir('src/github.com/thinnect/go-devparam/cmd') {
67+
sh './build-deb.sh'
68+
sh 'dpkg -i mist-device-parameters*.deb'
69+
}
70+
// stage('Run executables')
71+
sh 'deviceparameter -V'
72+
sh 'deviceparameters -V'
73+
74+
// Publish artifacts
75+
dir('src/github.com/thinnect/go-devparam/cmd') {
76+
sh \
77+
"""#!/usr/bin/env bash
78+
UPLOAD_FILENAME=(mist-device-parameters*.deb)
79+
echo "Publishing \$UPLOAD_FILENAME"
80+
exec curl -u ${NEXUS_UPLOAD_CREDS} --silent --fail --show-error --upload-file \$UPLOAD_FILENAME https://artifacts.thinnect.net/repository/ci/deviceparameters/build-${BUILD_NUMBER}/${BUILD_ARCH}/
81+
"""
82+
}
83+
}
84+
}
85+
}
86+
}

0 commit comments

Comments
 (0)