Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions Dockerfile.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#
# Copyright (c) 2019
# Intel
#
# SPDX-License-Identifier: Apache-2.0
#
FROM nexus3.edgexfoundry.org:10004/edgex-golang-base:1.12.6-alpine

COPY --from=docker:latest /usr/local/bin/docker /usr/local/bin/docker

LABEL license='SPDX-License-Identifier: Apache-2.0' \
copyright='Copyright (c) 2019: Intel'

RUN apk add --update --no-cache zeromq-dev

WORKDIR /go/src/github.com/edgexfoundry

COPY go.mod .

RUN go mod download
20 changes: 20 additions & 0 deletions Dockerfile.build-arm64
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#
# Copyright (c) 2019
# Intel
#
# SPDX-License-Identifier: Apache-2.0
#
FROM nexus3.edgexfoundry.org:10004/edgex-golang-base:1.12.6-alpine-arm64

COPY --from=docker:latest /usr/local/bin/docker /usr/local/bin/docker

LABEL license='SPDX-License-Identifier: Apache-2.0' \
copyright='Copyright (c) 2019: Intel'

RUN apk add --update --no-cache zeromq-dev

WORKDIR /go/src/github.com/edgexfoundry

COPY go.mod .

RUN go mod download
128 changes: 128 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
//
// Copyright (c) 2019 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

loadGlobalLibrary()

pipeline {
agent {
label 'centos7-docker-4c-2g'
}

options {
timestamps()
}

stages {
stage('LF Prep') {
steps {
edgeXSetupEnvironment()
edgeXDockerLogin(settingsFile: env.MVN_SETTINGS)
}
}

stage('Multi-Arch Build') {
// fan out
parallel {
stage('Test amd64') {
agent {
dockerfile {
filename 'Dockerfile.build'
label 'centos7-docker-4c-2g'
args '-u 0:0 -v /var/run/docker.sock:/var/run/docker.sock' // needed for go mod cache
}
}
steps {
sh 'make test'
sh 'make build docker'
}
}
stage('Test arm64') {
agent {
dockerfile {
filename 'Dockerfile.build-arm64'
label 'ubuntu18.04-docker-arm64-4c-2g'
args '-u 0:0 -v /var/run/docker.sock:/var/run/docker.sock' // needed for go mod cache
}
}
steps {
sh 'make test'
sh 'make build docker'
}
}
}
}

stage('Semver Init') {
when { expression { edgex.isReleaseStream() } }
steps {
edgeXSemver 'init'
script {
def semverVersion = edgeXSemver()
env.setProperty('VERSION', semverVersion)
}
}
}

stage('Semver Tag') {
when { expression { edgex.isReleaseStream() } }
steps {
sh 'echo v${VERSION}'
sh 'git tag -a v${VERSION} -m "v${VERSION}"'
}
}

stage('Sigul Sign Tag') {
when { expression { edgex.isReleaseStream() } }
steps {
edgeXInfraLFToolsSign(command: 'git-tag', version: 'v${VERSION}')
}
}

stage('Semver Bump Pre-Release Version') {
when { expression { edgex.isReleaseStream() } }
steps {
edgeXSemver('bump pre')
edgeXSemver('push')
}
}
}

post {
failure {
script {
currentBuild.result = "FAILED"
}
}
always {
edgeXInfraPublish()
}
}
}

def loadGlobalLibrary(branch = '*/master') {
library(identifier: 'edgex-global-pipelines@master',
retriever: legacySCM([
$class: 'GitSCM',
userRemoteConfigs: [[url: 'https://github.com/edgexfoundry/edgex-global-pipelines.git']],
branches: [[name: branch]],
doGenerateSubmoduleConfigurations: false,
extensions: [[
$class: 'SubmoduleOption',
recursiveSubmodules: true,
]]]
)
) _
}