-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: #12 support builds with nixpacks
- Loading branch information
1 parent
3ffb58d
commit 73de48c
Showing
2 changed files
with
29 additions
and
18 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
|
||
. "$(dirname "$0")/../lib/validate.sh" | ||
. "$(dirname "$0")/../lib/sync.sh" | ||
|
||
|
||
check_var TARGET_DIR | ||
check_var NIXPACKS_FILE_PATH | ||
check_var IMAGE_NAME | ||
|
||
# Create a temporary build directory | ||
BUILD_DIR=$(mktemp -d) | ||
trap 'rm -rf "$BUILD_DIR"' EXIT | ||
|
||
function copy_files() { | ||
cp -r "$TARGET_DIR"/* "$BUILD_DIR" | ||
} | ||
|
||
with_lock "${TARGET_DIR}" copy_files | ||
|
||
# Change to the build directory | ||
cd "$BUILD_DIR" | ||
|
||
nixpacks build --config "$NIXPACKS_FILE_PATH" --name "$IMAGE_NAME" . | ||
|
||
# Push the image to the registry | ||
docker push "${IMAGE_NAME}" |