Skip to content

Commit e22a6da

Browse files
authored
Zipline: Prepare for Version 4.0.0 (#2455)
* Fix: Zipline Installation for V4 * Fix Zipline
1 parent ee84468 commit e22a6da

File tree

2 files changed

+20
-13
lines changed

2 files changed

+20
-13
lines changed

ct/zipline.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ function update_script() {
2626
msg_error "No ${APP} Installation Found!"
2727
exit
2828
fi
29+
if ! command -v pnpm &>/dev/null; then
30+
msg_info "Installing pnpm"
31+
#export NODE_OPTIONS=--openssl-legacy-provider
32+
npm install -g pnpm@latest &>/dev/null
33+
msg_ok "Installed pnpm"
34+
fi
2935
RELEASE=$(curl -s https://api.github.com/repos/diced/zipline/releases/latest | grep "tag_name" | awk '{print substr($2, 3, length($2)-4) }')
3036
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
3137
msg_info "Stopping ${APP}"
@@ -40,8 +46,8 @@ function update_script() {
4046
mv zipline-${RELEASE} /opt/zipline
4147
cd /opt/zipline
4248
mv /opt/.env /opt/zipline/.env
43-
yarn install &>/dev/null
44-
yarn build &>/dev/null
49+
pnpm install &>/dev/null
50+
pnpm build &>/dev/null
4551
echo "${RELEASE}" >/opt/${APP}_version.txt
4652
msg_ok "Updated ${APP}"
4753

@@ -66,4 +72,4 @@ description
6672
msg_ok "Completed Successfully!\n"
6773
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
6874
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
69-
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}"
75+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:3000${CL}"

install/zipline-install.sh

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ msg_ok "Set up Node.js Repository"
3333
msg_info "Installing Node.js"
3434
$STD apt-get update
3535
$STD apt-get install -y nodejs
36-
$STD npm install -g yarn
36+
$STD npm install -g pnpm
3737
msg_ok "Installed Node.js"
3838

3939
msg_info "Setting up PostgreSQL"
@@ -60,13 +60,15 @@ wget -q "https://github.com/diced/zipline/archive/refs/tags/v${RELEASE}.zip"
6060
unzip -q v${RELEASE}.zip
6161
mv zipline-${RELEASE} /opt/zipline
6262
cd /opt/zipline
63-
mv .env.local.example .env
64-
sudo sed -i "s|CORE_SECRET=.*|CORE_SECRET=\"$SECRET_KEY\"|" /opt/zipline/.env
65-
sudo sed -i "s|CORE_RETURN_HTTPS=.*|CORE_RETURN_HTTPS=false|" /opt/zipline/.env
66-
sudo sed -i "s|CORE_DATABASE_URL=.*|CORE_DATABASE_URL=\"postgres://$DB_USER:$DB_PASS@localhost:5432/$DB_NAME\"|" /opt/zipline/.env
63+
cat <<EOF >/opt/zipline/.env
64+
DATABASE_URL=postgres://$DB_USER:$DB_PASS@localhost:5432/$DB_NAME
65+
CORE_SECRET=$SECRET_KEY
66+
CORE_HOSTNAME=0.0.0.0
67+
CORE_PORT=3000
6768
CORE_RETURN_HTTPS=false
68-
$STD yarn install
69-
$STD yarn build
69+
EOF
70+
$STD pnpm install
71+
$STD pnpm build
7072
echo "${RELEASE}" >"/opt/${APPLICATION}_version.txt"
7173
msg_ok "Installed Zipline"
7274

@@ -78,18 +80,17 @@ After=network.target
7880
7981
[Service]
8082
WorkingDirectory=/opt/zipline
81-
ExecStart=/usr/bin/yarn start
83+
ExecStart=/usr/bin/pnpm start
8284
Restart=on-failure
8385
8486
[Install]
8587
WantedBy=multi-user.target
8688
EOF
87-
systemctl enable -q --now zipline.service
89+
systemctl enable -q --now zipline
8890
msg_ok "Created Service"
8991

9092
motd_ssh
9193
customize
92-
9394
msg_info "Cleaning up"
9495
$STD apt-get -y autoremove
9596
$STD apt-get -y autoclean

0 commit comments

Comments
 (0)