Browse Source

Implement jenkins builds

master
Travis Burtrum 7 months ago
parent
commit
5a71229c50
4 changed files with 363 additions and 269 deletions
  1. +46
    -0
      .ci/Jenkinsfile
  2. +24
    -0
      .ci/build.sh
  3. +291
    -267
      Cargo.lock
  4. +2
    -2
      Cargo.toml

+ 46
- 0
.ci/Jenkinsfile View File

@ -0,0 +1,46 @@
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 '''
mkdir -p release
cp sendxmpp.toml release
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()
}
}

+ 24
- 0
.ci/build.sh View File

@ -0,0 +1,24 @@
#!/bin/bash
set -exo pipefail
echo "starting build for TARGET $TARGET"
export CRATE_NAME=sendxmpp
SUFFIX=""
echo "$TARGET" | grep -E '^x86_64-pc-windows-gnu$' >/dev/null && SUFFIX=".exe"
# build binary
cross build --target $TARGET --release
# to check how they are built
file "target/$TARGET/release/${CRATE_NAME}$SUFFIX"
# if this commit has a tag, upload artifact to release
strip "target/$TARGET/release/${CRATE_NAME}$SUFFIX" || true # if strip fails, it's fine
mkdir -p release
cp "target/$TARGET/release/${CRATE_NAME}$SUFFIX" "release/${CRATE_NAME}-$TARGET$SUFFIX"
echo 'build success!'
exit 0

+ 291
- 267
Cargo.lock
File diff suppressed because it is too large
View File


+ 2
- 2
Cargo.toml View File

@ -21,8 +21,8 @@ serde = "1.0.85"
gumdrop = "0.5.0"
gumdrop_derive = "0.5.0"
dirs = "1.0.4"
tokio-xmpp = "1.0.0"
tokio-xmpp = "1.0.1"
futures = "0.1"
tokio = "0.1"
xmpp-parsers = "0.12.2"
xmpp-parsers = "0.15"
die = "0.2.0"

Loading…
Cancel
Save