update readme

This commit is contained in:
zramsay 2025-02-19 11:49:33 -05:00
parent fcb66537b6
commit f0b480d65d

View File

@ -2,30 +2,8 @@
Repository for Laconic's website, hosted on internal infrastructure.
To update it; ensure you have access, ssh in, rebuild the docker image, and redeploy it using stack orchestrator.
To update it; ensure you have access to erasmus and follow the instructions for production, below.
## Access
1) ensure you have a user on `abernathy` (ask Shane),
2) to your `~/.ssh/config` add
```
Host abernathy
Hostname abernathy.vdb.to
Port 12000
User zach
Host dugwaybeds.vdb.to
ProxyJump abernathy
```
then,
```
ssh user@dugwaybeds.vdb.to
```
Next, either deploy to staging or to production (see further below).
## Local development
To build and serve this site on your local machine:
@ -57,20 +35,6 @@ Run the development server
yarn dev
```
## Staging
To run a temporary staging deployment,
- ensure none exists or remove it
- run `laconic-so --stack laconic-dot-com setup-repositories`
- navigate to `~/cerc/laconic.com`
- select the correct branch/commit
- https://laconic-staging.vdb.to points to port 3100 on the server, therefore:
- in the `package.json`, edit this field `"scripts":{ "dev": "next -p 3100",`
- run `export NEXT_PUBLIC_DATOCMS_BYPASS_TYPE="local_json"`
- use `tmux` then `yarn dev`; after a dozen or so seconds, the staging site should be live
- use `ctrl + b, d` to exit `tmux` and `tmux a` to re-enter it
## Production
Uses stack orchestrator. For example:
@ -78,23 +42,40 @@ Uses stack orchestrator. For example:
```
laconic-so --stack laconic-dot-com setup-repositories
laconic-so --stack laconic-dot-com build-containers
laconic-so --stack laconic-dot-com deploy init --output laconic-website-spec.yml --map-ports-to-host localhost-same
laconic-so --stack laconic-dot-com deploy init --output laconic-website-spec.yml
```
Then, edit spec file:
```
stack: laconic-dot-com
deploy-to: k8s
kube-config: /home/.kube/config.yaml
image-registry: container-registry.apps.vaasl.io
network:
ports:
laconic-dot-com:
- '3000'
http-proxy:
- host-name: laconic.apps.vaasl.io
routes:
- path: '/'
proxy-to: laconic-dot-com:3000
```
Create a deployment, push the image, and start the pod:
```
laconic-so --stack laconic-dot-com deploy create --spec-file laconic-website-spec.yml --deployment-dir lx-website
# stop here; remove old deployment
laconic-so deployment --dir lx-website push-images
laconic-so deployment --dir lx-website start
```
For each user, future deployments can omit the `setup-repositories` command. Instead, you can `cd ~/cerc/laconic.com` and pull in the correct commit.
To update the site, right now today, use the above 5 commands, stopping after the 4th to remove the current deployment. It looks like:
To deploy update, go to `/cerc/laconic.com`, pull the correct commit, then:
```
docker ps
laconic-so --stack laconic-dot-com build-containers
laconic-so deployment --dir lx-website push-images
laconic-so deployment --dir lx-website stop
laconic-so deployment --dir lx-website start
```
```
068675f32292 cerc/laconic-dot-com:local "docker-entrypoint.s…" 7 weeks ago Up 5 weeks 127.0.0.1:3000->3000/tcp laconic-ac6c84bb25793c5f943a87eb10b4d918-laconic-dot-com-1
```
To remove it, run `docker rm -f <the_above_container_id>`
Then, run `laconic-so deployment --dir lx-website start` and https://laconic.com should be live with your changes.