Added inital Jenkinsfile
The jenkinsfile can build packages for x86_64,aarch64, armhf and armv7 And collect the packages as artifacts in Jenkins
This commit is contained in:
37
ExampleSetupJenkinsChroot.sh
Normal file
37
ExampleSetupJenkinsChroot.sh
Normal file
@@ -0,0 +1,37 @@
|
||||
#!/bin/ash
|
||||
Arch=armv7
|
||||
Name=$Arch
|
||||
chrootDir=/chroot/$Name
|
||||
|
||||
#Setup core
|
||||
apk -X http://192.168.1.3/alpine/v3.18/main -U --allow-untrusted -p ${chrootDir} --arch ${Arch} --initdb add alpine-base git doas doas-sudo-shim alpine-sdk
|
||||
|
||||
#Create required device nodes
|
||||
mknod -m 666 ${chrootDir}/dev/full c 1 7
|
||||
mknod -m 666 ${chrootDir}/dev/ptmx c 5 2
|
||||
mknod -m 644 ${chrootDir}/dev/random c 1 8
|
||||
mknod -m 644 ${chrootDir}/dev/urandom c 1 9
|
||||
mknod -m 666 ${chrootDir}/dev/zero c 1 5
|
||||
mknod -m 666 ${chrootDir}/dev/tty c 5 0
|
||||
|
||||
#Setup DNS
|
||||
cp -L /etc/resolv.conf ${chrootDir}/etc/
|
||||
|
||||
#Setup Repo
|
||||
mkdir -p ${chrootDir}/etc/apk
|
||||
cp -L /etc/apk/repositories ${chrootDir}/etc/apk/repositories
|
||||
|
||||
#Install config files
|
||||
echo "PS1='(Chroot-$Name)Test:\w\$ '" >> ${chrootDir}/etc/profile
|
||||
cp -L -p /etc/doas.d/jenkinsAPKbuilder.conf ${chrootDir}/etc/doas.d/jenkinsAPKbuilder.conf
|
||||
|
||||
#Setup user
|
||||
echo "jenkins:x:1000:1000::/home/jenkins:/bin/sh" >> ${chrootDir}/etc/passwd
|
||||
echo "jenkins:x:1000:" >> ${chrootDir}/etc/group
|
||||
sed -i 's/abuild.*/abuild:x:300:jenkins/' ${chrootDir}/etc/group
|
||||
mkdir -p ${chrootDir}/home/jenkins
|
||||
chown jenkins:jenkins ${chrootDir}/home/jenkins
|
||||
cp -L -r /home/jenkins/.abuild ${chrootDir}/home/jenkins/
|
||||
|
||||
chgrp abuild ${chrootDir}/var/cache/distfiles
|
||||
chmod g+w ${chrootDir}/var/cache/distfiles
|
||||
Reference in New Issue
Block a user