summaryrefslogtreecommitdiff
path: root/Jenkinsfile
blob: df7614fd02aee3264f09d68d268b296bae6672ba (plain)
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
pipeline {
  agent none
  stages {
    stage('build-package') {
      parallel {
        stage('Build package amd64') {
          agent {
            docker {
              label 'jessie-amd64'
              args '--privileged --sysctl net.ipv6.conf.lo.disable_ipv6=0 -e GOSU_UID=1006 -e GOSU_GID=1006'
              image 'higebu/vyos-build:current'
            }

          }
          steps {
            sh '''#!/bin/bash
git clone --single-branch --branch $GIT_BRANCH $GIT_URL $BUILD_NUMBER
cd $BUILD_NUMBER
sudo apt-get -o Acquire::Check-Valid-Until=false update
sudo mk-build-deps -i -r -t \'apt-get --no-install-recommends -yq\' debian/control
dpkg-buildpackage -b -us -uc -tc
mv ../*.deb .'''
          }
        }
        stage('Build package armhf') {
          agent {
            docker {
              label 'jessie-amd64'
              image 'vyos-build-armhf:current'
              args '--privileged --sysctl net.ipv6.conf.lo.disable_ipv6=0 -e GOSU_UID=1006 -e GOSU_GID=1006'
            }

          }
          steps {
            sh '''#!/bin/bash
git clone --single-branch --branch $GIT_BRANCH $GIT_URL $BUILD_NUMBER
cd $BUILD_NUMBER
sudo apt-get -o Acquire::Check-Valid-Until=false update
sudo mk-build-deps -i -r -t \'apt-get --no-install-recommends -yq\' debian/control
dpkg-buildpackage -b -us -uc -tc
mv ../*.deb .'''
          }
        }
        stage('Build package arm64') {
          agent {
            docker {
              label 'jessie-amd64'
              args '--privileged --sysctl net.ipv6.conf.lo.disable_ipv6=0 -e GOSU_UID=1006 -e GOSU_GID=1006'
              image 'vyos-build-arm64:current'
            }

          }
          steps {
            sh '''#!/bin/bash
git clone --single-branch --branch $GIT_BRANCH $GIT_URL $BUILD_NUMBER
cd $BUILD_NUMBER
sudo apt-get -o Acquire::Check-Valid-Until=false update
sudo mk-build-deps -i -r -t \'apt-get --no-install-recommends -yq\' debian/control
dpkg-buildpackage -b -us -uc -tc
mv ../*.deb .'''
          }
        }
      }
    }
    stage('Deploy package') {
      parallel {
        stage('Deploy package amd64') {
          agent {
            node {
              label 'jessie-amd64'
            }

          }
          steps {
            sh '''#!/bin/bash
cd $BUILD_NUMBER
mv *.deb ../
/var/lib/vyos-build/pkg-build.sh $GIT_BRANCH'''
          }
        }
        stage('Deploy package armhf') {
          agent {
            node {
              label 'jessie-amd64'
            }

          }
          steps {
            sh '''#!/bin/bash
cd $BUILD_NUMBER
mv *.deb ../
/var/lib/vyos-build/pkg-build.sh $GIT_BRANCH'''
          }
        }
        stage('Deploy package arm64') {
          agent {
            node {
              label 'jessie-amd64'
            }

          }
          steps {
            sh '''#!/bin/bash
cd $BUILD_NUMBER
mv *.deb ../
/var/lib/vyos-build/pkg-build.sh $GIT_BRANCH'''
          }
        }
      }
    }
    stage('Cleanup') {
      parallel {
        stage('Cleanup amd64') {
          agent {
            node {
              label 'jessie-amd64'
            }

          }
          steps {
            cleanWs()
          }
        }
        stage('Cleanup armhf') {
          agent {
            node {
              label 'jessie-amd64'
            }

          }
          steps {
            cleanWs()
          }
        }
        stage('Cleanup arm64') {
          agent {
            node {
              label 'jessie-amd64'
            }

          }
          steps {
            cleanWs()
          }
        }
      }
    }
  }
}