5 changed files with 53 additions and 59 deletions
@ -0,0 +1,43 @@
@@ -0,0 +1,43 @@
|
||||
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 -s -- -l c -b ./build.sh' |
||||
} |
||||
|
||||
currentBuild.result = 'SUCCESS' |
||||
} catch (Exception err) { |
||||
currentBuild.result = 'FAILURE' |
||||
} finally { |
||||
stage('Email') { |
||||
step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: 'admin.jenkins@moparisthebest.com', sendToIndividuals: true]) |
||||
} |
||||
sh './bin/build.sh docker-chown' |
||||
deleteDir() |
||||
} |
||||
} |
@ -1,26 +0,0 @@
@@ -1,26 +0,0 @@
|
||||
language: minimal |
||||
services: docker |
||||
|
||||
matrix: |
||||
include: |
||||
- env: ARCH='amd64' DOCKER_IMAGE='alpine' |
||||
- env: ARCH='aarch64' DOCKER_IMAGE='alpine' |
||||
arch: arm64 |
||||
- env: ARCH='i386' DOCKER_IMAGE='multiarch/alpine:i386-latest-stable' |
||||
# - env: ARCH='x86' DOCKER_IMAGE='multiarch/alpine:x86-latest-stable' |
||||
- env: ARCH='ppc64le' DOCKER_IMAGE='multiarch/alpine:ppc64le-latest-stable' |
||||
# - env: ARCH='armhf' DOCKER_IMAGE='multiarch/alpine:armhf-latest-stable' |
||||
- env: ARCH='armv7' DOCKER_IMAGE='multiarch/alpine:armv7-latest-stable' |
||||
arch: arm64 |
||||
|
||||
script: |
||||
- ./docker_build.sh "$DOCKER_IMAGE" "$ARCH" |
||||
|
||||
deploy: |
||||
api_key: $GITHUB_OAUTH |
||||
file_glob: true |
||||
file: curl* |
||||
on: |
||||
tags: true |
||||
provider: releases |
||||
skip_cleanup: true |
@ -1,21 +0,0 @@
@@ -1,21 +0,0 @@
|
||||
#!/bin/sh |
||||
|
||||
DOCKER_IMAGE="$1" |
||||
shift |
||||
ARCH="$1" |
||||
|
||||
BUILD_DIR=/tmp/static-curl/ |
||||
|
||||
rm -rf "$BUILD_DIR" |
||||
mkdir -p "$BUILD_DIR" |
||||
cp build.sh mykey.asc "$BUILD_DIR" |
||||
|
||||
# if this is a multiarch image, must register binfmt handlers |
||||
echo "$DOCKER_IMAGE" | grep multiarch && docker run --rm --privileged multiarch/qemu-user-static:register --reset |
||||
|
||||
docker run --rm -v "$BUILD_DIR":/tmp "$DOCKER_IMAGE" /tmp/build.sh || exit 1 |
||||
|
||||
mv "$BUILD_DIR"curl "./curl-$ARCH" |
||||
rm -rf "$BUILD_DIR" 2>/dev/null |
||||
|
||||
exit 0 |
Loading…
Reference in new issue