[go: nahoru, domu]

Skip to content

Commit

Permalink
ci: add Jenkinsfile and Dockerfile for sdk-generator
Browse files Browse the repository at this point in the history
  • Loading branch information
shahruk10 committed Mar 25, 2021
1 parent 533e568 commit bc867fe
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
38 changes: 38 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!groovy
// Copyright (2021) Cobalt Speech and Language Inc.

// Keep only 10 builds on Jenkins
properties([
buildDiscarder(logRotator(
artifactDaysToKeepStr: '', artifactNumToKeepStr: '', daysToKeepStr: '', numToKeepStr: '10'))
])

if (env.CHANGE_ID) {
// Building a pull request
node {
try {
timeout(time: 30, unit: 'MINUTES'){
checkout scm
def sdkGenImage = docker.build("sdk-generator", "./ci")
sdkGenImage.inside('-u root') {
stage("validate") {
try {
commit.setBuildStatus("validate-built-artifacts", "PENDING", "Validating generated artifacts.")
sh 'make'
sh "git diff --exit-code"
} finally {
// Allow Jenkins to cleanup workspace
sh "chown -R 1000:1000 ."
}
}
}
commit.setBuildStatus("validate-built-artifacts", "SUCCESS", "Successfully validated.")
}
} catch(err) {
commit.setBuildStatus("validate-built-artifacts", "ERROR", "Validation failed.")
throw err
} finally {
deleteDir()
}
}
}
8 changes: 8 additions & 0 deletions ci/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Copyright (2021) Cobalt Speech and Language Inc.

# Dockerfile to setup base system for building protoc/grpc code

FROM debian:10
RUN apt-get update && apt-get install -y clang git libcurl4 libpython2.7 libpython2.7-dev libtinfo5 libncurses5 make python-virtualenv python3 python3-pip sudo unzip wget
RUN wget https://dl.google.com/go/go1.16.2.linux-amd64.tar.gz -O - | tar xz && mv go /usr/share/go
ENV PATH=/usr/share/go/bin:$PATH

0 comments on commit bc867fe

Please sign in to comment.