This commit is contained in:
commit
d1e91c1995
2 changed files with 39 additions and 0 deletions
17
.drone.yml
Normal file
17
.drone.yml
Normal file
|
@ -0,0 +1,17 @@
|
|||
kind: pipeline
|
||||
type: docker
|
||||
name: default
|
||||
|
||||
steps:
|
||||
- name: Update repo
|
||||
image: archlinux
|
||||
commands:
|
||||
- '/drone/src/build.sh'
|
||||
volumes:
|
||||
- name: isos
|
||||
path: /iso
|
||||
|
||||
volumes:
|
||||
- name: isos
|
||||
host:
|
||||
path: /mnt/user/files/repos/archlinux/iso/
|
22
build.sh
Normal file
22
build.sh
Normal file
|
@ -0,0 +1,22 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
pacman -Sy archiso git --noconfirm
|
||||
git clone https://git.blendos.co/blendOS/image-builder.git
|
||||
cd image-builder
|
||||
sudo mkarchiso -v -w workdir/ -o out/ .
|
||||
|
||||
cd ./out/
|
||||
filename=$(find . -mindepth 1 -maxdepth 1 -name "blendOS-*.iso")
|
||||
date=${filename%-*}
|
||||
date=${date#*-}
|
||||
mkdir /iso/$date/
|
||||
cp -r $filename /iso/$date/
|
||||
|
||||
cd /iso/
|
||||
num=$(find . -mindepth 1 -maxdepth 1 -name 'blendOS-*' -type d | wc -l)
|
||||
echo $num
|
||||
if [ $(($num - 3)) -ge 1 ]; then
|
||||
rm -rf $(find . -mindepth 1 -maxdepth 1 -name 'blendOS-*' -type d | tail -n $(($num - 3)))
|
||||
fi
|
||||
|
||||
ln -sf /iso/latest/ $(find . -mindepth 1 -maxdepth 1 -name 'blendOS-*' -type d | head -n 1)
|
Loading…
Reference in a new issue