Skip to content

Commit 8134b4e

Browse files
committed
Update deployment steps: added staging environment
1 parent d936867 commit 8134b4e

File tree

1 file changed

+31
-5
lines changed

1 file changed

+31
-5
lines changed

README.md

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,17 @@ JWT_PRIVATE_KEY=<PrivateKeyBase64>
7070
```
7171

7272
### Recreate DB on fly.io
73+
74+
#### Stop backend app
7375
```shell
7476
flyctl scale count 0
77+
flyctl scale count 0 --config fly.staging.toml
78+
```
79+
80+
#### (Optional) Drop postgres schema
7581

82+
Production:
83+
```shell
7684
flyctl postgres connect -a pump-fun-backend-db
7785

7886
\l
@@ -86,14 +94,32 @@ drop database pump_fun_backend;
8694
create database pump_fun_backend;
8795

8896
\q
97+
```
8998

90-
Set new env variables if needed:
91-
flyctl secrets set <secret_name> <secret_value>
99+
Staging:
100+
```shell
101+
flyctl postgres connect -a pump-fun-backend-staging-db
92102

93-
flyctl deploy --ha=false
103+
SELECT pg_terminate_backend(pid)
104+
FROM pg_stat_activity
105+
WHERE pid <> pg_backend_pid() AND datname = 'pump_fun_backend_staging';
106+
107+
drop database pump_fun_backend_staging;
108+
109+
create database pump_fun_backend_staging;
110+
111+
\q
94112
```
95113

96-
Updating staging backend:
114+
#### (Optional) Set new env variables
115+
97116
```shell
98-
flyctl deploy --config fly.staging.toml --ha=false
117+
flyctl secrets set TOKEN_FACTORY_ADDRESS=0xEa5CE8534c4a1462C56Ef82a0a82B7770c0c29ea
118+
flyctl secrets set TOKEN_FACTORY_ADDRESS=0xEa5CE8534c4a1462C56Ef82a0a82B7770c0c29ea --config fly.staging.toml
119+
```
120+
121+
#### Deploy backend update
122+
```shell
123+
flyctl deploy --ha=false
124+
flyctl deploy --ha=false --config fly.staging.toml
99125
```

0 commit comments

Comments
 (0)