Skip to content

Commit

Permalink
Update clone_modify_yaml.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
spiritLHLS authored Feb 20, 2024
1 parent e0793cf commit 9ced328
Showing 1 changed file with 35 additions and 7 deletions.
42 changes: 35 additions & 7 deletions clone_modify_yaml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,19 @@ echo "" >> temp.yaml
echo "$insert_content_2" >> temp.yaml
mv temp.yaml rockylinux.yaml

# oracle
rm -rf oracle.yaml
wget https://raw.githubusercontent.com/lxc/lxc-ci/main/images/oracle.yaml
chmod 777 oracle.yaml
# cron 不可用
insert_content_1=" - curl\n - wget\n - bash\n - lsof\n - sshpass\n - openssh-server\n - iptables\n - dos2unix\n - cronie"
sed -i "/- vim-minimal/ a\\$insert_content_1" oracle.yaml
insert_content_2=$(cat /home/runner/work/incus_images/incus_images/bash_insert_content.text)
cat oracle.yaml > temp.yaml
echo "" >> temp.yaml
echo "$insert_content_2" >> temp.yaml
mv temp.yaml oracle.yaml

# archlinux
rm -rf archlinux.yaml
wget https://raw.githubusercontent.com/lxc/lxc-ci/main/images/archlinux.yaml
Expand All @@ -99,18 +112,33 @@ tail -n 2 archlinux.yaml >> temp.yaml
mv temp.yaml archlinux.yaml
sed -i -e '/mappings:/i \ ' archlinux.yaml

# oracle
rm -rf oracle.yaml
wget https://raw.githubusercontent.com/lxc/lxc-ci/main/images/oracle.yaml
chmod 777 oracle.yaml
# gentoo
rm -rf gentoo.yaml
wget https://raw.githubusercontent.com/lxc/lxc-ci/main/images/gentoo.yaml
chmod 777 gentoo.yaml
# cronie 不可用 cron 不可用
insert_content_1=" - curl\n - wget\n - bash\n - lsof\n - openssh-server\n - sshpass\n - iptables\n - dos2unix"
sed -i "/- sudo/ a\\$insert_content_1" gentoo.yaml
insert_content_2=$(cat /home/runner/work/incus_images/incus_images/bash_insert_content.text)
line_number=$(($(wc -l < gentoo.yaml) - 2))
head -n $line_number gentoo.yaml > temp.yaml
echo "$insert_content_2" >> temp.yaml
tail -n 2 gentoo.yaml >> temp.yaml
mv temp.yaml gentoo.yaml
sed -i -e '/mappings:/i \ ' gentoo.yaml

# fedora
rm -rf fedora.yaml
wget https://raw.githubusercontent.com/lxc/lxc-ci/main/images/fedora.yaml
chmod 777 fedora.yaml
# cron 不可用
insert_content_1=" - curl\n - wget\n - bash\n - lsof\n - sshpass\n - openssh-server\n - iptables\n - dos2unix\n - cronie"
sed -i "/- vim-minimal/ a\\$insert_content_1" oracle.yaml
sed -i "/- xz/ a\\$insert_content_1" fedora.yaml
insert_content_2=$(cat /home/runner/work/incus_images/incus_images/bash_insert_content.text)
cat oracle.yaml > temp.yaml
cat fedora.yaml > temp.yaml
echo "" >> temp.yaml
echo "$insert_content_2" >> temp.yaml
mv temp.yaml oracle.yaml
mv temp.yaml fedora.yaml

# alpine
rm -rf alpine.yaml
Expand Down

0 comments on commit 9ced328

Please sign in to comment.