Skip to content

Commit

Permalink
update build.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
b- committed Feb 13, 2024
1 parent b79d94d commit 54b92ea
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ die(){
exit "${exit_code}"
}


INSTALL_CACHIX(){
nix profile install github:nixos/nixpkgs/nixpkgs-unstable#cachix --impure && cachix use $CACHIX_USER
}
Expand All @@ -79,23 +80,22 @@ LIST_RENAME_BUILD_ARTIFACTS(){
}

SAVE_SSH_KEY(){
printenv UPLOAD_SSH_KEY > /tmp/ci-upload.key
<<< "${UPLOAD_SSH_KEY_BASE64}" sed -e 's/ /\n/g' | base64 -d > /tmp/ci-upload.key
}

UPLOAD_ARTIFACTS(){
set -x
chmod 600 /tmp/ci-upload.key
chmod -R 755 build
scp -C -i /tmp/ci-upload.key -oStrictHostKeyChecking=no -oport=222 -oidentitiesonly=true -oPasswordAuthentication=no -oUser="${UPLOAD_USER}" build/* "${UPLOAD_SERVER}":"${DESTDIRS[${FORMAT}]}"
scp -C -i /tmp/ci-upload.key -oStrictHostKeyChecking=no -oport=222 -oidentitiesonly=true -oPasswordAuthentication=no -oUser="${UPLOAD_USER}" build/*."${EXTENSIONS[${FORMAT}]}" "${UPLOAD_SERVER}":"${DESTDIRS[${FORMAT}]}"
}

###
# META TARGETS
###

CLEAN(){
#rm -fR "${ARTIFACTS[@]}"
true #don't clean for now
rm -fR build result
}
# tasks to build an image
BUILD_IMAGE_TASKS(){
Expand All @@ -121,8 +121,11 @@ BUILD_AND_UPLOAD(){
BUILD_IMAGES(){
for FORMAT in "${FORMATS[@]}"; do
for TARGET in "${TARGETS[@]}"; do
echo "TARGET: ${TARGET}"
echo "FORMAT: ${FORMAT}"
echo '{'
echo '"TARGET": '"${TARGET}"
echo '"FORMAT": '"${FORMAT}"
echo '}'
CLEAN
BUILD_AND_UPLOAD
done
done
Expand Down

0 comments on commit 54b92ea

Please sign in to comment.