Browse Source

Add ananicy

master
Yonggan 1 year ago
commit
4a05e287c8
  1. 185
      .drone.yml
  2. 50
      .drone.yml.backup
  3. 1
      .gitattributes
  4. 36
      .gitmodules
  5. 1
      ananicy
  6. 103
      buildDrone.sh
  7. 26
      buildjob.txt
  8. 12
      packages.txt

185
.drone.yml

@ -0,0 +1,185 @@
kind: pipeline
type: docker
name: default
steps:
- name: submodules
image: alpine/git
commands:
- git submodule update --recursive --remote
- ls -la
- cd ananicy && ls -la
- name: calamares-git
image: yonggan/docker-makepkg-drone-ci
failure: ignore
volumes:
- name: oblivion
path: /oblivion
environment:
DOCKER_MAKEPKG_PATH: /drone/src/$DRONE_STEP_NAME
DOCKER_OUT_PATH: /oblivion
REPO_API_URL: https://nexus.oblivioncoding.pro/service/rest/v1
- name: ckbcomp
image: yonggan/docker-makepkg-drone-ci
failure: ignore
volumes:
- name: oblivion
path: /oblivion
environment:
DOCKER_MAKEPKG_PATH: /drone/src/$DRONE_STEP_NAME
DOCKER_OUT_PATH: /oblivion
REPO_API_URL: https://nexus.oblivioncoding.pro/service/rest/v1
- name: mkinitcpio-openswap
image: yonggan/docker-makepkg-drone-ci
failure: ignore
volumes:
- name: oblivion
path: /oblivion
environment:
DOCKER_MAKEPKG_PATH: /drone/src/$DRONE_STEP_NAME
DOCKER_OUT_PATH: /oblivion
REPO_API_URL: https://nexus.oblivioncoding.pro/service/rest/v1
- name: pamac-all
image: yonggan/docker-makepkg-drone-ci
failure: ignore
volumes:
- name: oblivion
path: /oblivion
environment:
DOCKER_MAKEPKG_PATH: /drone/src/$DRONE_STEP_NAME
DOCKER_OUT_PATH: /oblivion
REPO_API_URL: https://nexus.oblivioncoding.pro/service/rest/v1
commands:
- pacman -Sy --noconfirm libhandy
- /bin/su -s /bin/sh -c '/run.sh /drone/src/"$DRONE_STEP_NAME" "$OUTPUT_DIR"' notroot
- name: snapd-git
image: yonggan/docker-makepkg-drone-ci
failure: ignore
volumes:
- name: oblivion
path: /oblivion
environment:
DOCKER_MAKEPKG_PATH: /drone/src/$DRONE_STEP_NAME
DOCKER_OUT_PATH: /oblivion
REPO_API_URL: https://nexus.oblivioncoding.pro/service/rest/v1
commands:
- pacman -Sy --noconfirm git go go-tools xfsprogs apparmor squashfs-tools python-docutils
- /bin/su -s /bin/sh -c '/run.sh /drone/src/"$DRONE_STEP_NAME" "$OUTPUT_DIR"' notroot
- name: snapd-glib-git
image: yonggan/docker-makepkg-drone-ci
failure: ignore
volumes:
- name: oblivion
path: /oblivion
environment:
DOCKER_MAKEPKG_PATH: /drone/src/$DRONE_STEP_NAME
DOCKER_OUT_PATH: /oblivion
REPO_API_URL: https://nexus.oblivioncoding.pro/service/rest/v1
- name: ananicy
image: yonggan/docker-makepkg-drone-ci
failure: ignore
volumes:
- name: oblivion
path: /oblivion
environment:
DOCKER_MAKEPKG_PATH: /drone/src/$DRONE_STEP_NAME
DOCKER_OUT_PATH: /oblivion
REPO_API_URL: https://nexus.oblivioncoding.pro/service/rest/v1
- name: nohang
image: yonggan/docker-makepkg-drone-ci
failure: ignore
volumes:
- name: oblivion
path: /oblivion
environment:
DOCKER_MAKEPKG_PATH: /drone/src/$DRONE_STEP_NAME
DOCKER_OUT_PATH: /oblivion
REPO_API_URL: https://nexus.oblivioncoding.pro/service/rest/v1
- name: timeshift
image: yonggan/docker-makepkg-drone-ci
failure: ignore
volumes:
- name: oblivion
path: /oblivion
environment:
DOCKER_MAKEPKG_PATH: /drone/src/$DRONE_STEP_NAME
DOCKER_OUT_PATH: /oblivion
REPO_API_URL: https://nexus.oblivioncoding.pro/service/rest/v1
- name: timeshift-autosnap
image: yonggan/docker-makepkg-drone-ci
failure: ignore
volumes:
- name: oblivion
path: /oblivion
environment:
DOCKER_MAKEPKG_PATH: /drone/src/$DRONE_STEP_NAME
DOCKER_OUT_PATH: /oblivion
REPO_API_URL: https://nexus.oblivioncoding.pro/service/rest/v1
- name: zram-generator
image: yonggan/docker-makepkg-drone-ci
failure: ignore
volumes:
- name: oblivion
path: /oblivion
environment:
DOCKER_MAKEPKG_PATH: /drone/src/$DRONE_STEP_NAME
DOCKER_OUT_PATH: /oblivion
REPO_API_URL: https://nexus.oblivioncoding.pro/service/rest/v1
- name: oblivion-settings-manager
image: yonggan/docker-makepkg-drone-ci
failure: ignore
volumes:
- name: oblivion
path: /oblivion
environment:
DOCKER_MAKEPKG_PATH: /drone/src/$DRONE_STEP_NAME
DOCKER_OUT_PATH: /oblivion
REPO_API_URL: https://nexus.oblivioncoding.pro/service/rest/v1
- name: build-db-and-push
image: archlinux
user: 0
commands:
- pacman -Syu --noconfirm
- cd /oblivion/x86_64
- cd /oblivion/x86_64 && pacman -S wget curl jq --noconfirm
- cd /oblivion/x86_64 && curl -sSL -k -X GET -G $REPO_API_URL/assets?repository=oblivion-os > output
- cd /oblivion/x86_64 && cat output | jq '.items | map(.downloadUrl)' > jq-output
- cd /oblivion/x86_64 && for k in $(jq -r ".[]" jq-output); do wget "$k"; done
- cd /oblivion/x86_64 && cat jq-output && ls -la
- cd /oblivion/x86_64 && rm -rf jq-output output repo.*
- ls -la /oblivion/x86_64
- cd /oblivion/x86_64 && repo-add repo.db.tar.gz *.pkg.tar.*
- cd /oblivion/x86_64 && for filename in /oblivion/x86_64/*; do curl -X DELETE -v -u "$USERNAME:$PASSWORD" $REPO_URL/$(basename $filename) ; done
- cd /oblivion/x86_64 && for filename in /oblivion/x86_64/*; do curl -v -u "$USERNAME:$PASSWORD" -T $filename $REPO_URL/$(basename $filename) ; done
volumes:
- name: oblivion
path: /oblivion/x86_64
environment:
REPO_API_URL: https://nexus.oblivioncoding.pro/service/rest/v1
REPO_URL: https://nexus.oblivioncoding.pro/repository/oblivion-os
USERNAME:
from_secret: nexus_username
PASSWORD:
from_secret: nexus_password
volumes:
- name: oblivion
temp: {}

50
.drone.yml.backup

@ -0,0 +1,50 @@
kind: pipeline
type: docker
name: default
steps:
- name: calamares-git
image: yonggan/docker-makepkg-drone-ci
user: 0
commands:
- /bin/su -s /bin/sh -c '/run.sh /drone/src/calamares-git' notroot
volumes:
- name: repo
path: /repo
environment:
EXPORT_PKG: true
- name: ckbcomp
image: yonggan/docker-makepkg-drone-ci
user: 0
commands:
- /bin/su -s /bin/sh -c '/run.sh /drone/src/ckbcomp' notroot
volumes:
- name: repo
path: /repo
environment:
EXPORT_PKG: true
- name: build-db-and-push
image: yonggan/docker-makepkg-drone-ci
commands:
- ls -la /repo
- FILES=/repo/*
- for f in $FILES
- do
- curl -v --user "$USERNAME:$PASSWORD" --upload-file $f "${REPO_URL}/${f}"
- done
volumes:
- name: repo
path: /repo
environment:
REPO_URL: https://nexus.oblivioncoding.pro/repository/oblivion-os/
USERNAME:
from_secret: nexus_username
PASSWORD:
from_secret: nexus_password
volumes:
- name: repo
temp: {}

1
.gitattributes vendored

@ -0,0 +1 @@
*.tar.* filter=lfs diff=lfs merge=lfs -text

36
.gitmodules vendored

@ -0,0 +1,36 @@
[submodule "ananicy"]
path = ananicy
url = https://aur.archlinux.org/ananicy.git
[submodule "nohang"]
path = nohang
url = https://aur.archlinux.org/nohang.git
[submodule "ckbcomp"]
path = ckbcomp
url = https://aur.archlinux.org/ckbcomp.git
[submodule "mkinitcpio-openswap"]
path = mkinitcpio-openswap
url = https://aur.archlinux.org/mkinitcpio-openswap.git
[submodule "oblivion-settings-manager"]
path = oblivion-settings-manager
url = https://git.oblivioncoding.pro/OblivionOS/oblivion-settings-manager.git
[submodule "pamac-all"]
path = pamac-all
url = https://aur.archlinux.org/pamac-all.git
[submodule "snapd-git"]
path = snapd-git
url = https://aur.archlinux.org/snapd-git.git
[submodule "snapd-glib-git"]
path = snapd-glib-git
url = https://aur.archlinux.org/snapd-glib-git.git
[submodule "timeshift"]
path = timeshift
url = https://aur.archlinux.org/timeshift.git
[submodule "timeshift-autosnap"]
path = timeshift-autosnap
url = https://aur.archlinux.org/timeshift-autosnap.git
[submodule "zram-generator"]
path = zram-generator
url = https://aur.archlinux.org/zram-generator.git
[submodule "calamares-git"]
path = calamares-git
url = https://git.oblivioncoding.pro/OblivionOS/calamares-git.git

1
ananicy

@ -0,0 +1 @@
Subproject commit ae52db66ae3eadcc84b42219593cc7a1b9cc90bf

103
buildDrone.sh

@ -0,0 +1,103 @@
#!/bin/bash
packagesfile=packages.txt
outfile=.drone.yml
buildimage=yonggan/docker-makepkg-drone-ci
volumename=oblivion
volumepath=/oblivion
buildjobfile=buildjob.txt
apiurl=https://nexus.oblivioncoding.pro/service/rest/v1
function registerPackage(){
echo "Registering Package $1"
# Check if custom command
IFS='^' read -ra ADDR <<< "$1"
if [ ${#ADDR[@]} -eq 1 ]; then
# No Commands specified
echo " - name: $1
image: $buildimage
failure: ignore
volumes:
- name: $volumename
path: $volumepath
environment:
DOCKER_MAKEPKG_PATH: /drone/src/"\$DRONE_STEP_NAME"
DOCKER_OUT_PATH: $volumepath
REPO_API_URL: $apiurl
" >> "$outfile"
else
packageName=${ADDR[0]}
echo " - name: $packageName
image: $buildimage
failure: ignore
volumes:
- name: $volumename
path: $volumepath
environment:
DOCKER_MAKEPKG_PATH: /drone/src/\$DRONE_STEP_NAME
DOCKER_OUT_PATH: $volumepath
REPO_API_URL: $apiurl
commands:" >> "$outfile"
for i in "${ADDR[@]}"; do
if [ "$i" != "$packageName" ]
then
echo " - $i" >> "$outfile"
fi
done
echo " - /bin/su -s /bin/sh -c '/run.sh /drone/src/\"\$DRONE_STEP_NAME\" \"\$OUTPUT_DIR\"' notroot" >> "$outfile"
echo "
" >> "$outfile"
fi
}
function header(){
echo "kind: pipeline
type: docker
name: default
clone:
git:
image: plugins/git
recursive: true
steps:
- name: submodules
image: alpine/git
commands:
- git submodule update --recursive --remote
" > "$outfile"
}
function registerBuildStep(){
echo "Registering Build Job"
cat "$buildjobfile" >> "$outfile"
}
function writeVolumes(){
echo "Write Volumes"
echo "
" >> "$outfile"
echo "volumes:
- name: oblivion
temp: {}" >> "$outfile"
}
# Write Header
header
# Read packages.txt
while read line; do
registerPackage "$line"
done <"$packagesfile"
registerBuildStep
writeVolumes

26
buildjob.txt

@ -0,0 +1,26 @@
- name: build-db-and-push
image: archlinux
user: 0
commands:
- pacman -Syu --noconfirm
- cd /oblivion/x86_64
- cd /oblivion/x86_64 && pacman -S wget curl jq --noconfirm
- cd /oblivion/x86_64 && curl -sSL -k -X GET -G $REPO_API_URL/assets?repository=oblivion-os > output
- cd /oblivion/x86_64 && cat output | jq '.items | map(.downloadUrl)' > jq-output
- cd /oblivion/x86_64 && for k in $(jq -r ".[]" jq-output); do wget "$k"; done
- cd /oblivion/x86_64 && cat jq-output && ls -la
- cd /oblivion/x86_64 && rm -rf jq-output output repo.*
- ls -la /oblivion/x86_64
- cd /oblivion/x86_64 && repo-add repo.db.tar.gz *.pkg.tar.*
- cd /oblivion/x86_64 && for filename in /oblivion/x86_64/*; do curl -X DELETE -v -u "$USERNAME:$PASSWORD" $REPO_URL/$(basename $filename) ; done
- cd /oblivion/x86_64 && for filename in /oblivion/x86_64/*; do curl -v -u "$USERNAME:$PASSWORD" -T $filename $REPO_URL/$(basename $filename) ; done
volumes:
- name: oblivion
path: /oblivion/x86_64
environment:
REPO_API_URL: https://nexus.oblivioncoding.pro/service/rest/v1
REPO_URL: https://nexus.oblivioncoding.pro/repository/oblivion-os
USERNAME:
from_secret: nexus_username
PASSWORD:
from_secret: nexus_password

12
packages.txt

@ -0,0 +1,12 @@
calamares-git
ckbcomp
mkinitcpio-openswap
pamac-all^pacman -Sy --noconfirm libhandy
snapd-git^pacman -Sy --noconfirm git go go-tools xfsprogs apparmor squashfs-tools python-docutils
snapd-glib-git
ananicy
nohang
timeshift
timeshift-autosnap
zram-generator
oblivion-settings-manager
Loading…
Cancel
Save