Abandon travis-ci for jenkins
moparisthebest/adjective-adjective-animal/pipeline/head This commit looks good Details

This commit is contained in:
Travis Burtrum 2020-11-23 21:07:20 -05:00
parent 7b19b9e91b
commit ea80cdd34a
4 changed files with 78 additions and 17 deletions

42
.ci/Jenkinsfile vendored Normal file
View File

@ -0,0 +1,42 @@
properties(
[
disableConcurrentBuilds()
]
)
node('linux && docker') {
try {
stage('Checkout') {
//branch name from Jenkins environment variables
echo "My branch is: ${env.BRANCH_NAME}"
// this doesn't grab tags pointing to this branch
//checkout scm
// this hack does... https://issues.jenkins.io/browse/JENKINS-45164
checkout([
$class: 'GitSCM',
branches: [[name: 'refs/heads/'+env.BRANCH_NAME]],
extensions: [[$class: 'CloneOption', noTags: false, shallow: false, depth: 0, reference: '']],
userRemoteConfigs: scm.userRemoteConfigs,
])
sh '''
set -euxo pipefail
git checkout "$BRANCH_NAME" --
git reset --hard "origin/$BRANCH_NAME"
'''
}
stage('Build + Deploy') {
sh 'curl --compressed -sL https://code.moparisthebest.com/moparisthebest/self-ci/raw/branch/master/build-ci.sh | bash'
}
currentBuild.result = 'SUCCESS'
} catch (Exception err) {
currentBuild.result = 'FAILURE'
} finally {
stage('Email') {
step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: 'admin.jenkins@moparisthebest.com', sendToIndividuals: true])
}
deleteDir()
}
}

35
.ci/build.sh Executable file
View File

@ -0,0 +1,35 @@
#!/bin/bash
set -exo pipefail
echo "starting build for TARGET $TARGET"
export CRATE_NAME=adjective_adjective_animal
DISABLE_TESTS=${DISABLE_TESTS:-0}
SUFFIX=""
echo "$TARGET" | grep -E '^x86_64-pc-windows-gnu$' >/dev/null && SUFFIX=".exe"
# build library
cross build --target $TARGET --release
# build example binary
cross build --target $TARGET --release --manifest-path cli/Cargo.toml
# build docs
cross doc --target $TARGET
# to check how they are built
file "target/$TARGET/release/aaa$SUFFIX"
if [ $DISABLE_TESTS -ne 1 ]
then
cross test --target $TARGET
fi
# if this commit has a tag, upload artifact to release
strip "target/$TARGET/release/aaa$SUFFIX" || true # if strip fails, it's fine
mkdir -p release
cp "target/$TARGET/release/aaa$SUFFIX" "release/aaa-$TARGET$SUFFIX"
echo 'build success!'
exit 0

View File

@ -1,16 +0,0 @@
language: rust
rust:
- stable
- beta
- nightly
matrix:
allow_failures:
- rust: nightly
script:
- cargo build --verbose
- cargo test --verbose
- cargo doc --verbose
- "(cd cli && cargo build --verbose)"

View File

@ -1,6 +1,6 @@
# adjective_adjective_animal
[![Build Status](https://travis-ci.org/moparisthebest/adjective-adjective-animal.svg?branch=master)](https://travis-ci.org/moparisthebest/adjective-adjective-animal) [![license](http://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/moparisthebest/adjective-adjective-animal/blob/master/LICENSE-MIT)
[![Build Status](https://ci.moparisthe.best/job/moparisthebest/job/adjective-adjective-animal/job/master/badge/icon%3Fstyle=plastic)](https://ci.moparisthe.best/job/moparisthebest/job/adjective-adjective-animal/job/master/) [![license](http://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/moparisthebest/adjective-adjective-animal/blob/master/LICENSE-MIT)
Rust library to generate suitably random and reasonably unique human readable (and fairly adorable) ids,
ala GiphyCat