diff --git a/.github/workflows/test-and-publish.yml b/.github/workflows/test-and-publish.yml index d62357e..6555f4a 100644 --- a/.github/workflows/test-and-publish.yml +++ b/.github/workflows/test-and-publish.yml @@ -107,6 +107,9 @@ jobs: - name: 🗄 Upload Executables to S3 run: | - aws s3 cp --acl public-read ./hyper-copy s3://hyperland + echo "aliasing latest linux binary to 'hyper-copy'" + cp ./build/hyper-copy-x86_64-unknown-linux-gnu ./build/hyper-copy + echo "copying binaries to hyperland s3 ⚡️" + aws s3 cp --acl public-read --recursive ./build s3://hyperland \ No newline at end of file diff --git a/.gitignore b/.gitignore index 6b24714..5f6e0a4 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -hyper-copy \ No newline at end of file +hyper-copy +build \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..3aefb86 --- /dev/null +++ b/Makefile @@ -0,0 +1,22 @@ +clean: + @rm -rf ./build + +compile-linux: + @deno compile --target=x86_64-unknown-linux-gnu \ + --allow-net --unstable --no-check \ + --output ./build/hyper-copy-x86_64-unknown-linux-gnu mod.js + +compile-apple: + @deno compile --target=x86_64-apple-darwin \ + --allow-net --unstable --no-check \ + --output ./build/hyper-copy-x86_64-apple-darwin mod.js + +compile-arch-apple: + @deno compile --target=aarch64-apple-darwin \ + --allow-net --unstable --no-check \ + --output ./build/hyper-copy-aarch64-apple-darwin mod.js + +compile-windows: + @deno compile --target=x86_64-pc-windows-msvc \ + --allow-net --unstable --no-check \ + --output ./build/hyper-copy-x86_64-pc-windows-msvc mod.js diff --git a/README.md b/README.md index 023c8bc..8b067e7 100644 --- a/README.md +++ b/README.md @@ -21,24 +21,34 @@ ## Quick Start +`hyper-copy` is a standalone executable to copy documents from a source [hyper `Data` `Service`](https://docs.hyper.io/docs/api-reference/rest/data.html) to a target [hyper `Data` `Service`](https://docs.hyper.io/docs/api-reference/rest/data.html). `hyper-copy` is great for copying data across hyper `Data` `Services` without having to interact with the underlying tech powering the service, the power of [Ports and Adapters](https://docs.hyper.io/docs/concepts/clean-cloud-architecture.html). + > First, make sure you've > [created your destination hyper `Data` `Service`](https://docs.hyper.io/docs/api-reference/rest/data.html#create-a-data-service) ```sh +# Linux curl -O https://hyperland.s3.amazonaws.com/hyper-copy + +# Apple x86_64 +curl -O https://hyperland.s3.amazonaws.com/hyper-copy-x86_64-apple-darwin + +# Apple aarch64 (M1) +curl -O https://hyperland.s3.amazonaws.com/hyper-copy-aarch64-apple-darwin + +# Windows +curl -O https://hyperland.s3.amazonaws.com/hyper-copy-x86_64-pc-windows-msvc.exe + +# Make it executable if needed chmod +x hyper-copy + +# Copy your documents hyper-copy [SRC_CONNECTION_STRING] [TARGET_CONNECTION_STRING] ``` `hyper-copy` will copy documents from `SRC_CONNECTION_STRING` to `TARGET_CONNECTION_STRING`, `1000` at a time, until all documents have been copied. -## Requirements - -- Linux x64 Environment - -> If there is interest in creating binaries for other enviroments, please submit an issue. - ## Example ## Contributing diff --git a/deno.json b/deno.json index 3c7dbbe..58c50ec 100644 --- a/deno.json +++ b/deno.json @@ -3,7 +3,7 @@ "description": "Copy documents from one hyper Data Service to another hyper Data Service", "tasks": { "cache": "deno cache --lock=deno.lock --lock-write ./deps.js", - "compile": "deno compile --allow-net --unstable --no-check --output hyper-copy mod.js", + "compile": "make clean compile-linux compile-apple compile-arch-apple compile-windows", "prepare": "deno run -A --no-lock npm:husky@^9", "staged": "deno run -A --no-lock npm:lint-staged@^15", "test": "deno lint && deno test --no-lock -A"