Skip to content

Commit 9d17d7e

Browse files
Initial commit
0 parents  commit 9d17d7e

File tree

12 files changed

+1947
-0
lines changed

12 files changed

+1947
-0
lines changed

.ci/Jenkinsfile

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
properties(
2+
[
3+
disableConcurrentBuilds()
4+
]
5+
)
6+
7+
node('linux && docker') {
8+
try {
9+
stage('Checkout') {
10+
//branch name from Jenkins environment variables
11+
echo "My branch is: ${env.BRANCH_NAME}"
12+
13+
// this doesn't grab tags pointing to this branch
14+
//checkout scm
15+
// this hack does... https://issues.jenkins.io/browse/JENKINS-45164
16+
checkout([
17+
$class: 'GitSCM',
18+
branches: [[name: 'refs/heads/'+env.BRANCH_NAME]],
19+
extensions: [[$class: 'CloneOption', noTags: false, shallow: false, depth: 0, reference: '']],
20+
userRemoteConfigs: scm.userRemoteConfigs,
21+
])
22+
sh '''
23+
set -euxo pipefail
24+
git checkout "$BRANCH_NAME" --
25+
git reset --hard "origin/$BRANCH_NAME"
26+
'''
27+
}
28+
29+
stage('Build + Deploy') {
30+
sh '''
31+
mkdir -p release
32+
cp xmpp-proxy.toml release
33+
curl --compressed -sL https://code.moparisthebest.com/moparisthebest/self-ci/raw/branch/master/build-ci.sh | bash
34+
'''
35+
}
36+
37+
currentBuild.result = 'SUCCESS'
38+
} catch (Exception err) {
39+
currentBuild.result = 'FAILURE'
40+
} finally {
41+
stage('Email') {
42+
step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: '[email protected]', sendToIndividuals: true])
43+
}
44+
deleteDir()
45+
}
46+
}

.ci/build.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/bin/bash
2+
set -exo pipefail
3+
4+
echo "starting build for TARGET $TARGET"
5+
6+
export CRATE_NAME=xmpp-proxy
7+
8+
SUFFIX=""
9+
10+
echo "$TARGET" | grep -E '^x86_64-pc-windows-gnu$' >/dev/null && SUFFIX=".exe"
11+
12+
# ring fails to compile here
13+
echo "$TARGET" | grep -E '^(s390x|powerpc|mips|riscv64gc|.*solaris$)' >/dev/null && echo "$TARGET not supported in rustls" && exit 0
14+
# mio fails to link here
15+
echo "$TARGET" | grep -E '^x86_64-unknown-netbsd$' >/dev/null && echo "$TARGET not supported in mio" && exit 0
16+
17+
# build binary
18+
cross build --target $TARGET --release
19+
20+
# to check how they are built
21+
file "target/$TARGET/release/${CRATE_NAME}$SUFFIX"
22+
23+
# if this commit has a tag, upload artifact to release
24+
strip "target/$TARGET/release/${CRATE_NAME}$SUFFIX" || true # if strip fails, it's fine
25+
mkdir -p release
26+
cp "target/$TARGET/release/${CRATE_NAME}$SUFFIX" "release/${CRATE_NAME}-$TARGET$SUFFIX"
27+
28+
echo 'build success!'
29+
exit 0

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/target/
2+
**/*.rs.bk
3+
.idea
4+
**/*.kate-swp

.rustfmt.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
max_width = 200

0 commit comments

Comments
 (0)