-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDeployInstructions.sh
More file actions
81 lines (66 loc) · 2.68 KB
/
DeployInstructions.sh
File metadata and controls
81 lines (66 loc) · 2.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/bash
Hola
# Deployment script for Infinity Task Protocol on local ICP environment
# Based on the provided deployment instructions.
# Exit immediately if a command exits with a non-zero status.
set -e
echo "Starting Infinity Task Protocol local deployment process..."
echo "1. Cloning the Infinity Task Protocol repository..."
#
git clone https://github.com/Infinity-Task-Protocol/Infinity-task-protocol.git
echo " Repository cloned."
# Navigate to the project directory
PROJECT_DIR="Infinity-task-protocol"
if [ ! -d "$PROJECT_DIR" ]; then
echo "Error: Directory $PROJECT_DIR was not cloned correctly. Ensure Git is installed and you have repository access."
exit 1
fi
echo "2. Navigating to the project directory: $PROJECT_DIR"
#
cd "$PROJECT_DIR"
echo " Current location: $(pwd)"
echo "3. Starting DFX in clean background mode..."
#
dfx start --clean --background
echo " DFX started. This might take a few seconds..."
echo "4. Generating backend code (Candid Rust/TypeScript)..."
#
dfx generate backend
echo " Backend code generated."
echo "5. Pulling DFX dependencies..."
#
dfx deps pull
echo " DFX dependencies pulled."
echo "6. Initializing Internet Identity dependency (for user authentication)..."
#
dfx deps init internet_identity
echo " Internet Identity initialized."
echo "7. Initializing ICP Ledger dependency for local environment..."
# The argument is on a single line and correctly quoted for the shell.
dfx deps init icp_ledger --argument "(variant { Init = record { minting_account = \"$(dfx ledger account-id)\"; initial_values = vec {}; send_whitelist = vec {}; transfer_fee = opt record { e8s = 10_000 : nat64; }; token_symbol = opt \"LICP\"; token_name = opt \"Local ICP\"; } })"
echo " ICP Ledger initialized."
echo "8. Deploying dependencies (Internet Identity and ICP Ledger)..."
#
dfx deps deploy
echo " Dependencies deployed."
echo "9. Deploying the main backend canister (main.mo)..."
#
dfx deploy backend
echo " Backend deployed."
echo "10. Navigating to the frontend directory to build the web application..."
#
cd src/frontend
echo " Changed to frontend directory: $(pwd)"
echo "11. Installing Node.js dependencies for the frontend..."
#
npm install
echo " Frontend dependencies installed."
echo "12. Building the frontend application for production..."
#
npm run build
echo " Frontend application built."
echo "--------------------------------------------------------"
echo "Infinity Task Protocol local deployment process completed successfully."
echo "The Dapp should now be accessible via DFX's local port."
echo "You can stop DFX anytime using the 'dfx stop' command from the project root."
echo "--------------------------------------------------------"