Skip to content

albertyw/albertyw.com

Repository files navigation

Build Status Code Climate Test Coverage Varsnap Status

Personal website

Development

Setup Development Environment

Using python venv

python3.13 -m venv env
pip install -e .[test]
ln -s .env.development .env
npm install

# Install shellcheck
# brew install shellcheck
# sudo apt-get install shellcheck

Spinning up the server

npm run build:dev
python app/serve.py

Running tests

ruff check .
mypy .
shellcheck --exclude=SC1091 bin/*.sh
coverage run -m unittest discover
npm test

CI/CD

This repo uses:

# Setup
pyenv local 3.13
pip install -e .[test]
ln -s .env.development .env

# Test
ruff check .
mypy .
coverage run -m unittest discover
coverage report
codeclimate-test-reporter
npm test

# Deployment
ssh ubuntu@direct.albertyw.com website/bin/deploy.sh

Building and starting the docker container

docker build -t albertyw.com:test .
docker run -t -i -p 127.0.0.1:5000:5000 albertyw.com:test

Production

Setup Production Environment

Run this once on a new server to set up the web app:

bin/setup.sh

Deployment

Run this every time for a new commit to the repository:

bin/deploy.sh