Add a simple Jenkinsfile

This commit is contained in:
R Tyler Croy 2024-04-21 15:31:36 +00:00
parent a5c501665e
commit f922e93d30
6 changed files with 69 additions and 3 deletions

View File

@ -26,8 +26,7 @@ jobs:
repo: cargo-lambda/cargo-lambda
platform: linux # Other valid options: 'windows' or 'darwin'
arch: x86_64 # Other valid options for linux: 'aarch64'
# Add your build steps below
- name: Build
run: cargo lambda build
run: ./ci/build.sh
- name: Run tests
run: cargo test --verbose
run: ./ci/test.sh

41
Jenkinsfile vendored Normal file
View File

@ -0,0 +1,41 @@
/*
* This Jenkinsfile is for internal use
*/
pipeline {
agent {
label 'rust'
}
stages {
stage('Checkout') {
steps {
checkout scm
}
}
stage('Prepare') {
steps {
sh './ci/setup.sh'
}
}
stage('Build') {
steps {
sh './ci/build.sh'
}
}
stage('Test') {
steps {
sh './ci/test.sh'
}
}
stage('Release') {
steps {
sh './ci/build-release.sh'
archiveArtifacts artifacts: 'target/lambda/**/*.zip', fingerprint: true, onlyIfSuccessful: true
}
}
}
}
// vim: ft=groovy sw=2 ts=2 et

4
ci/build-release.sh Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
cargo lambda build --release --output-format zip

3
ci/build.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
cargo lambda build

16
ci/setup.sh Executable file
View File

@ -0,0 +1,16 @@
#!/usr/bin/env bash
which cargo-lambda
if [ $? -ne 0 ]; then
cargo install cargo-lambda
fi;
which virtualenv
if [ $? -ne 0 ]; then
echo ">> Virtualenv is required in order to setup cargo-lambda here!"
exit 1;
fi;
virtualenv venv

3
ci/test.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
cargo test --verbose