Skip to content

Commit

Permalink
Merge pull request #20 from RandomCoderOrg/anchor
Browse files Browse the repository at this point in the history
Anchor for #16
  • Loading branch information
SaicharanKandukuri authored Apr 20, 2023
2 parents 69390fa + dbc1ebd commit cb54bc1
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 11 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
sudo bash build.sh -s jammy -v raw -a all
sudo bash build.sh -s kinetic -v raw -a all
sudo bash build.sh -s lunar -v raw -a all
sudo bash build.sh -s focal -v raw -a all
- name: upload artifacts
uses: actions/upload-artifact@v3
Expand Down
21 changes: 11 additions & 10 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,19 @@ msg() { echo -e "${*} \e[0m" >&2;:;}
# DEFAULTS
ARCH="all"
VARIENT="raw"
UD_ROOT_DIR=$(git rev-parse --show-toplevel)

function build() {
# load suites
_avalible_suites="$(find ./suites -type d ! -name '*-*' | cut -d / -f 3 | awk 'NF' | uniq -u | tr '\n' ' ')"
_avalible_suites="$(find ./suites -maxdepth 1 -type d ! -name '*-*' | cut -d / -f 3 | awk 'NF' | uniq -u | tr '\n' ' ')"

# check is SUITE avalible in ./suites
if [[ ! ${_avalible_suites} =~ $SUITE ]]; then
die "$SUITE not found in ./suites"
fi

# load avalible varients
_avalible_varients=$(find ./suites/"$SUITE" -type f | cut -d / -f 4 | awk 'NF')
_avalible_varients=$(find ./suites/"$SUITE" -type d | cut -d / -f 4 | awk 'NF' | uniq -u | tr '\n' ' ')

# check is varient script avalible
if [[ ! ${_avalible_varients} =~ $VARIENT ]]; then
Expand All @@ -56,19 +57,19 @@ function build() {
msg "SUITE=$SUITE"
msg "Varient=$VARIENT"
msg "ARCH=$ARCH"
cd fs-cook || die "failed to cd ./fs-cook" # script need to executed from fs-cook root directory

# pre-exe task
# copy everything in name $VARIENT-* to fs-cook
cp -r ../suites/"$SUITE"/"$VARIENT"-* ./
bash ../suites/"$SUITE"/"$VARIENT".sh "$ARCH"
cp -r ./suites/$SUITE/$VARIENT/$VARIENT* fs-cook
cd fs-cook || die "Failed to cd.."
bash $VARIENT.sh $ARCH || die "build script failed"
cd $UD_ROOT_DIR || die "Failed fto cd "
rm -rf fs-cook/$VARIENT*
}

function _list() {
for _suite in $(find ./suites -type d ! -name '*-*' | cut -d / -f 3 | awk 'NF' | uniq -u | tr '\n' ' '); do
for _suite in $(find ./suites -maxdepth 1 -type d ! -name '*-*' | cut -d / -f 3 | awk 'NF' | uniq -u | tr '\n' ' '); do
echo "[SUITE] $_suite"
for _varient in $(find ./suites/"$_suite" -type f ! -name '*-*' | cut -d / -f 4 | awk 'NF'); do
echo -e "\t -$_varient" | cut -d . -f 1
for _varient in $(find ./suites/"$_suite" -type d ! -name '*-*' | cut -d / -f 4 | awk 'NF' | uniq -u | tr '\n' ' '); do
echo -e "\t -$_varient"
done
done
}
Expand Down
2 changes: 1 addition & 1 deletion suites/hirsute/raw.sh → suites/focal/raw/raw.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export ENABLE_EXIT
export ENABLE_USER_SETUP
export INCLUDE_PACKAGES

SUITE="hirsute"
SUITE="focal"
frn="out/$SUITE-raw"
OVERRIDER_COMPRESSION_TYPE="gzip"
ENABLE_EXIT=true
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit cb54bc1

Please sign in to comment.