Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
chifu1234 committed Sep 18, 2023
1 parent 7d2ccdb commit 2f1c9e1
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 5 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: ci

on:
push:
tags:
- "v*"

jobs:
qemu:
Expand All @@ -16,4 +18,10 @@ jobs:
run: sudo apt update && sudo apt install -y genisoimage qemu-system-x86 gzip jq qemu-utils qemu
-
name: run ./build.sh
run: ./build.sh
run: ./build.sh
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.TOKEN }}"
prerelease: false
files: |
./build/*.gz
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ do
rm ./tmp -rf
text="new version for ${i%/} in version ${tversion}"
release_id=$(curl -X POST -H "Authorization: Bearer $token" -H "X-GitHub-Api-Version: 2022-11-28" -H "Accept: application/vnd.github+json" --data "$(post_data)" "https://api.github.com/repos/$repo_full_name/releases" | jq .id)
curl --data-binary @${build_dir}/${version}.qcow2.gz -H "Authorization: Bearer $token" -H "Content-Type: application/octet-stream" "https://uploads.github.com/repos/$repo_full_name/releases/$release_id/assets?name=${version}.qcow2.gz&access_token=$token"
sudo rm -rf @${build_dir}/
#curl --data-binary @${build_dir}/${version}.qcow2.gz -H "Authorization: Bearer $token" -H "Content-Type: application/octet-stream" "https://uploads.github.com/repos/$repo_full_name/releases/$release_id/assets?name=${version}.qcow2.gz&access_token=$token"
#sudo rm -rf @${build_dir}/
git fetch --all --tags
fi
done
Expand Down
7 changes: 5 additions & 2 deletions debian/debian.json.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,12 @@ source "qemu" "autogenerated_1" {
# https://www.packer.io/docs/templates/hcl_templates/blocks/build
build {
sources = ["source.qemu.autogenerated_1"]

provisioner "file" {
source = "debian/machine-id.service"
destination = "/tmp/machine-id.service"
}
provisioner "shell" {
inline = ["sudo apt update && sudo apt -y install open-iscsi", "sudo apt install qemu-guest-agent -y && sudo systemctl enable qemu-guest-agent", "ls -lah /etc/udev/rules.d/", "sudo su -c 'echo owner @{PROC}/@{pid}/task/[0-9]*/comm rw, >> /etc/apparmor.d/sbin.dhclient'", "echo 'reset cloud-init' && sudo cloud-init clean"]
inline = ["sudo apt update && sudo apt -y install open-iscsi", "sudo apt install qemu-guest-agent -y && sudo systemctl enable qemu-guest-agent", "echo 'reset cloud-init' && sudo su -c 'echo -n > /etc/machine-id' && sudo cloud-init clean"]
}

}
11 changes: 11 additions & 0 deletions debian/machine-id.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[Unit]
After=systemd-remount-fs.service
Before=systemd-sysusers.service systemd-vconsole-setup.service sysinit.target first-boot-complete.target shutdown.target
ConditionPathExists=!/etc/machine-id

[Service]
Type=oneshot
ExecStart=/usr/bin/systemd-machine-id-setup
StandardOutput=tty
StandardInput=tty
StandardError=tty

0 comments on commit 2f1c9e1

Please sign in to comment.