forked from ayufan-rock64/linux-build
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
192 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,9 @@ | ||
/build | ||
/simpleimage/*.img | ||
/simpleimage/*.fex | ||
/simpleimage/*.bin | ||
/simpleimage/releases | ||
/u-boot-postprocess/out | ||
/lichee | ||
/u-boot-pine64 | ||
/arm-trusted-firmware-pine64 | ||
/sunxi-pack-tools | ||
/mkbootimg | ||
/linux | ||
/kernel/*.img | ||
/kernel/initrd.gz | ||
/kernel/*.dtb | ||
/kernel/uEnv.txt | ||
/kernel/releases | ||
/busybox | ||
/blobs/*.dtb | ||
*.snap | ||
/snappy/releases | ||
/snappy/*.img | ||
/snappy/*/stage | ||
/snappy/*/prime | ||
/snappy/*/parts | ||
/snappy/gadget/uboot.env | ||
/snappy/gadget/uboot.conf | ||
/snappy/gadget/boot-assets | ||
/boot-tools/ | ||
/*.deb | ||
|
||
/kernel | ||
/out | ||
/rkbin | ||
/u-boot | ||
/.repo | ||
*.img | ||
*.img.xz | ||
*.deb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
/** | ||
properties([ | ||
parameters([ | ||
string(defaultValue: '1.0', description: 'Current version number', name: 'VERSION'), | ||
text(defaultValue: '', description: 'A list of changes', name: 'CHANGES'), | ||
booleanParam(defaultValue: false, description: 'If build should be marked as pre-release', name: 'PRERELEASE'), | ||
string(defaultValue: 'ayufan-rock64', description: 'GitHub username or organization', name: 'GITHUB_USER'), | ||
string(defaultValue: 'linux-build', description: 'GitHub repository', name: 'GITHUB_REPO'), | ||
]) | ||
]) | ||
*/ | ||
|
||
node('docker && linux-build') { | ||
timestamps { | ||
wrap([$class: 'AnsiColorBuildWrapper', colorMapName: 'xterm']) { | ||
stage "Environment" | ||
checkout scm | ||
|
||
def environment = docker.build('build-environment:build-rock64-image', 'environment') | ||
|
||
environment.inside("--privileged -u 0:0") { | ||
withEnv([ | ||
"USE_CCACHE=true", | ||
"RELEASE_NAME=$VERSION", | ||
"RELEASE=$BUILD_NUMBER" | ||
]) { | ||
stage 'Prepare' | ||
sh '''#!/bin/bash | ||
set +xe | ||
export CCACHE_DIR=$WORKSPACE/ccache | ||
ccache -M 0 -F 0 | ||
git clean -ffdx -e ccache | ||
''' | ||
|
||
stage 'Sources' | ||
sh '''#!/bin/bash | ||
set -xe | ||
export HOME=$WORKSPACE | ||
export USER=jenkins | ||
repo init -u https://github.com/ayufan-rock64/manifests -b default --depth=1 | ||
repo sync -j 20 -c --force-sync | ||
''' | ||
|
||
stage 'U-boot' | ||
sh '''#!/bin/bash | ||
set +xe | ||
export CCACHE_DIR=$WORKSPACE/ccache | ||
make u-boot | ||
''' | ||
|
||
stage 'Kernel' | ||
sh '''#!/bin/bash | ||
set +xe | ||
export CCACHE_DIR=$WORKSPACE/ccache | ||
make kernel | ||
''' | ||
|
||
stage 'Images' | ||
sh '''#!/bin/bash | ||
set +xe | ||
export CCACHE_DIR=$WORKSPACE/ccache | ||
make | ||
''' | ||
} | ||
|
||
withEnv([ | ||
"VERSION=$VERSION", | ||
"CHANGES=$CHANGES", | ||
"PRERELEASE=$PRERELEASE", | ||
"GITHUB_USER=$GITHUB_USER", | ||
"GITHUB_REPO=$GITHUB_REPO" | ||
]) { | ||
stage 'Freeze' | ||
sh '''#!/bin/bash | ||
# use -ve, otherwise we could leak GITHUB_TOKEN... | ||
set -ve | ||
shopt -s nullglob | ||
export HOME=$WORKSPACE | ||
export USER=jenkins | ||
repo manifest -r -o manifest.xml | ||
''' | ||
|
||
stage 'Release' | ||
sh '''#!/bin/bash | ||
set -xe | ||
shopt -s nullglob | ||
github-release release \ | ||
--tag "${VERSION}" \ | ||
--name "$VERSION: $BUILD_TAG" \ | ||
--description "${CHANGES}\n\n${BUILD_URL}" \ | ||
--draft | ||
github-release upload \ | ||
--tag "${VERSION}" \ | ||
--name "manifest.xml" \ | ||
--file "manifest.xml" | ||
for file in *.xz *.deb; do | ||
github-release upload \ | ||
--tag "${VERSION}" \ | ||
--name "$(basename "$file")" \ | ||
--file "$file" & | ||
done | ||
wait | ||
if [[ "$PRERELEASE" == "true" ]]; then | ||
github-release edit \ | ||
--tag "${VERSION}" \ | ||
--name "$VERSION: $BUILD_TAG" \ | ||
--description "${CHANGES}\n\n${BUILD_URL}" \ | ||
--pre-release | ||
else | ||
github-release edit \ | ||
--tag "${VERSION}" \ | ||
--name "$VERSION: $BUILD_TAG" \ | ||
--description "${CHANGES}\n\n${BUILD_URL}" | ||
fi | ||
''' | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
FROM ubuntu:xenial | ||
|
||
RUN apt-get update -y | ||
RUN apt-get install -y python git-core gnupg flex bison gperf build-essential \ | ||
zip curl zlib1g-dev libc6-dev-i386 \ | ||
lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache \ | ||
libgl1-mesa-dev libxml2-utils xsltproc unzip mtools u-boot-tools \ | ||
htop iotop sysstat iftop pigz bc device-tree-compiler lunzip \ | ||
dosfstools gcc-aarch64-linux-gnu g++-aarch64-linux-gnu \ | ||
gcc-arm-linux-gnueabi g++-arm-linux-gnueabi ccache \ | ||
sudo cpio nano vim kmod kpartx wget bsdtar qemu-user-static \ | ||
pxz ruby-dev debootstrap multistrap | ||
|
||
RUN gem install fpm | ||
|
||
RUN curl -L https://github.com/aktau/github-release/releases/download/v0.6.2/linux-amd64-github-release.tar.bz2 | tar -C /tmp -jx && \ | ||
mv /tmp/bin/linux/amd64/github-release /usr/local/bin/ | ||
|
||
RUN which github-release | ||
|
||
ENV USER=root \ | ||
HOME=/root |