-
Notifications
You must be signed in to change notification settings - Fork 2
/
settings.sh
37 lines (32 loc) · 1.04 KB
/
settings.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env bash
# Debian
DEBIAN_VERSION="12"
DEBIAN_VERNAME="bookworm"
DEBIAN_RELEASE="20240507-1740"
DEBIAN_VARIANT="genericcloud-amd64"
DEBIAN_BASEURL="https://cloud.debian.org/images/cloud"
DEBIAN_FILEURL="$DEBIAN_BASEURL/$DEBIAN_VERNAME/$DEBIAN_RELEASE/debian-${DEBIAN_VERSION}-${DEBIAN_VARIANT}-${DEBIAN_RELEASE}.qcow2"
# Image filename
SOURCE_IMGFILE="$(basename $DEBIAN_FILEURL)"
TARGET_IMGFILE="${SOURCE_IMGFILE/genericcloud/$1}"
# GitHub cache
GIT_CACHE_NAME="debian-$DEBIAN_VERSION-$DEBIAN_VARIANT-$DEBIAN_RELEASE"
# GitHub release name
if [[ "${GITHUB_REF_NAME}" == "refs/tags/*" ]]; then
GITHUB_RELEASE="${GITHUB_REF_NAME}"
else
GITHUB_RELEASE="v${DEBIAN_VERSION}-${DEBIAN_RELEASE}"
fi
# Export variables to github workflow
if [[ -f "$GITHUB_ENV" ]]; then
cat >> "$GITHUB_ENV" <<-EOF
DEBIAN_VERSION=$DEBIAN_VERSION
DEBIAN_VERNAME=$DEBIAN_VERNAME
DEBIAN_RELEASE=$DEBIAN_RELEASE
DEBIAN_FILEURL=$DEBIAN_FILEURL
GIT_CACHE_NAME=$GIT_CACHE_NAME
GITHUB_RELEASE=$GITHUB_RELEASE
SOURCE_IMGFILE=$SOURCE_IMGFILE
TARGET_IMGFILE=$TARGET_IMGFILE
EOF
fi