-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add Jenkinsfile and Dockerfile for sdk-generator
- Loading branch information
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |