Skip to content

Commit

Permalink
šŸ”„ Remove the unused dockerfiles.
Browse files Browse the repository at this point in the history
  • Loading branch information
langyo committed Nov 3, 2023
1 parent d99ce05 commit 0efaa43
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 264 deletions.
101 changes: 1 addition & 100 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,105 +6,6 @@ skip_core_tasks = true
script = '''
#!@duckscript
exec docker-compose -p hikari -f ./tasks/compose.yml build
'''

[tasks.build-native]
script = '''
#!@duckscript
# TODO - Move the wasm build to docker container
# TODO - Check the version of wasm-bindgen-cli, and if it's not 0.2.87, install it
# exec cargo install -f wasm-bindgen-cli --version 0.2.87
exec cargo build --package hikari-web --target wasm32-unknown-unknown --release
exec wasm-bindgen --target no-modules --no-modules-global __wasm_vendor_entry --out-dir ./target/dist --out-name a --no-typescript ./target/wasm32-unknown-unknown/release/hikari_web.wasm
html_raw = set "<body><div id='app' style='width: 100vw; height: 100vh; position: fixed;'><script src='./a.js'></script><script>(async () => {await __wasm_vendor_entry('./a.wasm');(await (new __wasm_vendor_entry.WebHandle())).start();})()</script></div></body>"
writefile ./packages/app/res/index.html ${html_raw}
cp ./target/dist/a.js ./packages/app/res/a.js
cp ./target/dist/a_bg.wasm ./packages/app/res/a.wasm
exec cargo build --package hikari-app
'''

[tasks.up]
script = '''
#!@duckscript
db_username = get_env DB_USERNAME
if is_empty ${db_username}
echo "DB_USERNAME is not set"
exit 1
end
db_password = get_env DB_PASSWORD
if is_empty ${db_password}
echo "DB_PASSWORD is not set"
exit 1
end
set_env DB_DATABASE "hikari"
exec docker-compose -p hikari -f ./tasks/compose.yml up --build -d
'''

[tasks.dev-on-container-reboot]
condition = { profiles = ["docker-inside"] }
script = '''
#!@duckscript
cd /home
while not is_path_exists /home/a
echo "Waiting for build..."
sleep 1000
end
exec /home/a
'''

[tasks.dev-on-container-build]
condition = { profiles = ["docker-inside"] }
script = '''
#!@duckscript
cd /home
if is_path_exists /home/target/Cargo.lock
cp /home/target/Cargo.lock /home/Cargo.lock
end
exec cargo check
cp /home/Cargo.lock /home/target/Cargo.lock
exec cargo build --package hikari-web --target wasm32-unknown-unknown
cd /home/target/wasm32-unknown-unknown/debug
exec wasm-bindgen --out-dir /home/dist --out-name a --target no-modules --no-typescript --no-modules-global __wasm_vendor_entry hikari_web.wasm
cd /home
exec cargo build --package hikari-router
mkdir /home/res
cp /home/packages/router/res/favicon.ico /home/res/favicon.ico
cp /home/packages/router/res/logo.png /home/res/logo.png
mv /home/dist/a_bg.wasm /home/res/a.wasm
mv /home/dist/a.js /home/res/a.js
cp /home/target/debug/hikari-router /home/a
cd /home
exec /home/a
'''

[tasks.dev-preload]
env = { DB_USERNAME = "homo", DB_PASSWORD = "1145141919810", DB_DATABASE = "hikari" }
script = '''
#!@duckscript
exec docker-compose -p hikari-dev -f ./tasks/compose.dev.yml up --build -d
'''

[tasks.dev]
dependencies = [{ name = "dev-preload" }]
watch = { postpone = true, no_git_ignore = true, ignore_pattern = "Cargo.lock", watch = ["./packages/"] }
script = '''
#!@duckscript
exec docker-compose -p hikari-dev -f ./tasks/compose.dev.yml restart dynamic
exec wasm-bindgen --out-dir ./target/wasm32-html --out-name a --target no-modules --no-typescript --no-modules-global __wasm_vendor_entry ./target/wasm32-unknown-unknown/release/hikari_web.wasm
'''
62 changes: 0 additions & 62 deletions tasks/build.dockerfile

This file was deleted.

45 changes: 0 additions & 45 deletions tasks/compose.dev.yml

This file was deleted.

40 changes: 0 additions & 40 deletions tasks/compose.yml

This file was deleted.

17 changes: 0 additions & 17 deletions tasks/dev.dockerfile

This file was deleted.

0 comments on commit 0efaa43

Please sign in to comment.