Move to files/
This commit is contained in:
@@ -1,55 +0,0 @@
|
||||
# Custom scripts
|
||||
|
||||
You can add custom scripts to this directory and declare them to be run at build time in the `scripts:` section of `recipe.yml`. Custom scripts can be run at either the `pre:` execution phase right after the custom repositories are added, or at the `post:` phase after all of the automatic build steps.
|
||||
|
||||
Your scripts will be given exactly one argument when they are executed, which specifies its precise execution phase (`pre` or `post`). The primary purpose of this argument is to streamline the reuse of scripts for multiple stages. This argument is provided for both manually declared scripts and scripts ran by `autorun.sh`.
|
||||
|
||||
## Creating a script
|
||||
|
||||
Look at `example.sh` for an example shell script. You can rename and copy the file for your own purposes. In order for the script to be executed, either move it to `scripts/pre/` or `scripts/post/` (if using `autorun.sh`) or declare it in the `recipe.yml`.
|
||||
|
||||
All commands from RPMs you've declared in the `recipe.yml` should be available when running scripts at the `post` execution phase.
|
||||
|
||||
When creating a script, please make sure
|
||||
|
||||
- ...its filename ends with `.sh`.
|
||||
- This follows convention for (especially bash) shell scripts.
|
||||
- `autorun.sh` only executes files that match `*.sh`.
|
||||
- ...it starts with a [shebang](<https://en.wikipedia.org/wiki/Shebang_(Unix)>) like `#!/usr/bin/env bash`.
|
||||
- This ensures the script is ran with the correct interpreter / shell.
|
||||
- ...it contains the command `set -oue pipefail` near the start.
|
||||
- This will make the image build fail if your script fails. If you do not care if your script works or not, you can omit this line.
|
||||
|
||||
## `autorun.sh`
|
||||
|
||||
`autorun.sh` is a script that automatically runs all scripts in the folders `scripts/pre/` and `scripts/post/` at the correct execution phases. It is enabled by default, but you can disable it by removing it from `recipe.yml`. Manually listed scripts can be combined with `autorun.sh`.
|
||||
|
||||
There are a few rules, which aim to simplify your script management:
|
||||
|
||||
- `autorun.sh` will only execute scripts at the FIRST level within the directory, which
|
||||
means that anything stored in e.g. `scripts/pre/deeperfolder/` will NOT execute.
|
||||
This is intentional, so that you can store libraries and helper scripts
|
||||
within subdirectories.
|
||||
- You script directories and the scripts within them can be symlinks, to allow
|
||||
easy reuse of scripts. For example, if you want the same scripts to execute
|
||||
during both the `pre` and `post` stages, you could simply symlink individual
|
||||
scripts or the entire `pre` and `post` directories to each other. However,
|
||||
remember to only use RELATIVE symlinks, to ensure that the links work
|
||||
properly. For example, `ln -s ../pre/foo.sh scripts/post/foo.sh`.
|
||||
- All scripts execute in a numerically and alphabetically sorted order, which
|
||||
allows you to easily control the execution order of your scripts. If it's
|
||||
important that they execute in a specific order, then you should give them
|
||||
appropriate names. For example, `05-foo.s` would always execute before
|
||||
another script named `99-bar.sh`. It's recommended to use zero-padded,
|
||||
numerical prefixes when you want to specify the execution order.
|
||||
- The manually listed scripts in `recipe.yml` should
|
||||
be stored directly within `scripts/`, or in a custom subdirectory that
|
||||
doesn't match any of the execution phases. For example, you could
|
||||
set the `pre:` section of `recipe.yml` to execute both `autorun.sh`
|
||||
and `fizzwidget/something.sh`, and then place a bunch of auto-executed
|
||||
scripts under `scripts/pre/` for the autorunner. This makes it very simple
|
||||
to reuse common scripts between multiple different `recipe.yml` files,
|
||||
while also having some scripts be specific to different `recipe.yml`s.
|
||||
- You can safely specify `autorun.sh` as a script in `recipe.yml`,
|
||||
even if the special directories don't exist or don't contain any
|
||||
scripts. It will gracefully skip the processing if there's nothing to do.
|
||||
@@ -1,4 +0,0 @@
|
||||
#/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
systemctl enable crond
|
||||
@@ -1,17 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
cd /usr/bin/
|
||||
|
||||
curl -L "https://github.com/vadimcn/vscode-lldb/releases/download/v1.7.0/codelldb-x86_64-linux.vsix" -o "codelldb-x86_64-linux.zip"
|
||||
|
||||
unzip "codelldb-x86_64-linux.zip" "extension/adapter/*" "extension/lldb/*" > /dev/null
|
||||
|
||||
rm -f "codelldb-x86_64-linux.zip"
|
||||
|
||||
mv extension/ codelldb_adapter
|
||||
|
||||
ln -s $(pwd)/codelldb_adapter/adapter/codelldb /usr/bin/codelldb
|
||||
|
||||
codelldb -h > /dev/null
|
||||
@@ -1,8 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
VERSION=v0.7.23
|
||||
|
||||
wget -q https://github.com/earthly/earthly/releases/download/$VERSION/earthly-linux-amd64 -O /usr/bin/earthly
|
||||
chmod +x /usr/bin/earthly
|
||||
@@ -1,30 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eou pipefail
|
||||
|
||||
# Version number
|
||||
VERSION="2023.1.2"
|
||||
|
||||
# Download https://download.jetbrains.com/idea/ideaIC-${VERSION}.tar.gz
|
||||
curl -L -o /tmp/ideaIC-${VERSION}.tar.gz https://download.jetbrains.com/idea/ideaIC-${VERSION}.tar.gz
|
||||
|
||||
# Extract to /usr/opt
|
||||
mkdir -p /usr/opt
|
||||
tar -xzf /tmp/ideaIC-${VERSION}.tar.gz -C /usr/opt
|
||||
|
||||
# Find the full path to the IntelliJ directory
|
||||
IDEA_PATH=$(ls -d /usr/opt/idea-IC-*)
|
||||
|
||||
# Create .desktop file
|
||||
cat > /tmp/intellij.desktop <<EOL
|
||||
[Desktop Entry]
|
||||
Version=1.0
|
||||
Type=Application
|
||||
Name=IntelliJ IDEA Community Edition
|
||||
Icon=$IDEA_PATH/bin/idea.png
|
||||
Exec="$IDEA_PATH/bin/idea.sh" %f
|
||||
Terminal=false
|
||||
Categories=Development;IDE;
|
||||
EOL
|
||||
|
||||
# Make the application available to all users
|
||||
sudo mv /tmp/intellij.desktop /usr/share/applications/
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
curl -JLO "https://dl.filippo.io/mkcert/latest?for=linux/amd64"
|
||||
chmod +x mkcert-v*-linux-amd64
|
||||
cp mkcert-v*-linux-amd64 /usr/bin/mkcert
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -oue pipefail
|
||||
|
||||
rpm -i https://ftp.postgresql.org/pub/pgadmin/pgadmin4/yum/pgadmin4-fedora-repo-2-1.noarch.rpm
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eou pipefail
|
||||
|
||||
# Version number
|
||||
VERSION="2023.1.2"
|
||||
|
||||
# Download https://download.jetbrains.com/ruby/RubyMine-2023.1.2.tar.gz
|
||||
curl -L -o /tmp/RubyMine-${VERSION}.tar.gz https://download.jetbrains.com/ruby/RubyMine-${VERSION}.tar.gz
|
||||
|
||||
# Extract to /usr/opt
|
||||
mkdir -p /usr/opt
|
||||
tar -xzf /tmp/RubyMine-${VERSION}.tar.gz -C /usr/opt
|
||||
|
||||
# Find the full path to the RubyMine directory
|
||||
RUBYMINE_PATH=$(ls -d /usr/opt/RubyMine-*)
|
||||
|
||||
# Create .desktop file
|
||||
cat > /tmp/rubymine.desktop <<EOL
|
||||
[Desktop Entry]
|
||||
Version=1.0
|
||||
Type=Application
|
||||
Name=RubyMine
|
||||
Icon=$RUBYMINE_PATH/bin/rubymine.png
|
||||
Exec="$RUBYMINE_PATH/bin/rubymine.sh" %f
|
||||
Terminal=false
|
||||
Categories=Development;IDE;
|
||||
EOL
|
||||
|
||||
# Make the application available to all users
|
||||
sudo mv /tmp/rubymine.desktop /usr/share/applications/
|
||||
@@ -1,46 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -oue pipefail
|
||||
|
||||
VERSION="v1.27.1"
|
||||
BASE_URL="https://github.com/syncthing/syncthing/releases/download"
|
||||
FILENAME="syncthing-linux-amd64-${VERSION}.tar.gz"
|
||||
EXTRACTED_DIR="syncthing-linux-amd64-${VERSION}"
|
||||
|
||||
# Download the file
|
||||
wget --quiet "${BASE_URL}/${VERSION}/${FILENAME}"
|
||||
|
||||
# Extract the file
|
||||
tar xf "${FILENAME}"
|
||||
|
||||
# Move the binary to /usr/local/bin
|
||||
mv "${EXTRACTED_DIR}/syncthing" /usr/bin
|
||||
|
||||
# Move .desktop files
|
||||
mv "${EXTRACTED_DIR}/etc/linux-desktop/"*.desktop /usr/share/applications/
|
||||
|
||||
# Move the systemd service file
|
||||
cp "${EXTRACTED_DIR}/etc/linux-systemd/user/syncthing.service" /etc/systemd/system/
|
||||
|
||||
# Enable the systemd service
|
||||
systemctl enable syncthing
|
||||
|
||||
# Verify the installation
|
||||
if command -v syncthing &> /dev/null
|
||||
then
|
||||
echo "Syncthing command is found in PATH."
|
||||
else
|
||||
echo "Syncthing command not found in PATH."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Verify that syncthing --version works
|
||||
if syncthing --version &> /dev/null
|
||||
then
|
||||
echo "Syncthing --version executes successfully."
|
||||
else
|
||||
echo "Syncthing --version did not execute successfully."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Cleanup
|
||||
rm -rf "${EXTRACTED_DIR}"
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -oue pipefail
|
||||
|
||||
cat <<EOF | tee /etc/yum.repos.d/kubernetes.repo
|
||||
[kubernetes]
|
||||
name=Kubernetes
|
||||
baseurl=https://pkgs.k8s.io/core:/stable:/v1.29/rpm/
|
||||
enabled=1
|
||||
gpgcheck=1
|
||||
gpgkey=https://pkgs.k8s.io/core:/stable:/v1.29/rpm/repodata/repomd.xml.key
|
||||
EOF
|
||||
@@ -1,9 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# Download udev rules file
|
||||
wget https://openrgb.org/releases/release_0.9/60-openrgb.rules -O /tmp/60-openrgb.rules
|
||||
|
||||
# Move udev rules file to udev rules directory
|
||||
mv /tmp/60-openrgb.rules /usr/lib/udev/rules.d
|
||||
@@ -1,15 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# https://docs.gitlab.com/runner/install/docker.html#selinux
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
git clone https://github.com/dpw/selinux-dockersock.git /tmp/selinux-dockersock
|
||||
|
||||
pushd /tmp/selinux-dockersock
|
||||
|
||||
make dockersock.pp
|
||||
|
||||
semodule -i dockersock.pp
|
||||
|
||||
popd
|
||||
@@ -1,6 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -oue pipefail
|
||||
|
||||
rpm --import https://packages.microsoft.com/keys/microsoft.asc
|
||||
sh -c 'echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/vscode.repo'
|
||||
Reference in New Issue
Block a user