Skip to content

msaperst/saperstone-studios

Repository files navigation

Saperstone Studios Website

Something about how awesome this is

Development

Retouch

When creating new thumbs for retouch:

  • first create 90 (short side) thumbs: convert -resize x90 EmilyAfter.jpg Emily.jpg OR convert -resize 90x EmilyAfter.jpg Emily.jpg
  • then crop it: convert Emily.jpg -gravity center -crop 90x90+0+0 +repage Emily.jpg

Deploying

Everything is orchestrated with Docker and docker compose

Locally

To build and deploy locally, simply run

docker compose up --build

Pipeline

Certificate

The ssl certificate is done with certbot for letsencrypt and the certs themselves live on the host machine. Used this blog post for basic setup, and this page for jamming in certbot into our php container

To update the cert, install certbot according to the above instructions, or use the below. docker exec into the php container and then run the below commands:

apt update
apt upgrade
apt install -y python3 python3-venv libaugeas0
python3 -m venv /opt/certbot/
/opt/certbot/bin/pip install --upgrade pip
/opt/certbot/bin/pip install certbot certbot-apache
ln -s /opt/certbot/bin/certbot /usr/bin/certbot
certbot renew --dry-run

If you get an error about Error Parsing variable: ${SERVER_NAME}, go into the apache conf files and update ${SERVER_NAME} on the first 4 lines to saperstonestudios.com and then re-run the dry-run command. If all of the above works, finally run the below command:

certbot renew

Testing

All the testing is managed by composer. To run tests, ensure composer is installed, then run the desired commands from below

Running Unit Tests

composer unit-test

This will not only run the unit tests, but also calculate the code coverage for the unit tests. The most useful results are displayed on the commandline, but if you want something for the record, the below reports are generated:

  • junit: reports/ut-junit.xml
  • testdox: reports/ut-results.html
  • clover coverage: reports/ut-coverage/index.html

Running Integration Tests

Before you can run the integration tests, a database must be stood up to run against. If the application is deployed, that will work, otherwise, stand up a database for testing with the below:

composer integration-pre-test

One you have a database stood up to run tests against, simply run the integration tests

composer integration-test

This will not only run the integration tests, but also calculate the code coverage for the integration tests. The most useful results are displayed on the commandline, but if you want something for the record, the below reports are generated:

  • junit: reports/it-junit.xml
  • testdox: reports/it-results.html
  • clover coverage: reports/it-coverage/index.html

Running Code Coverage

Running API Tests

Launch the app

docker compose up --build -d

Setup local environment variables

set -a
source .env
set +a
export DB_HOST=localhost

Ensure the api tools are built

composer clean
composer install --prefer-dist --no-progress --no-suggest

Ensure the app is up

curl --retry 50 -f --retry-all-errors --retry-delay 5  -s -o /dev/null "http://localhost:90/"

Run the tests

COMPOSER_PROCESS_TIMEOUT=1200 composer api-test

Running UI Tests

Code Management

When email issue pop, it's possible that the oauth token has expire. If you need a new credentials.json file, instructions are here: https://developers.google.com/gmail/api/quickstart/js. When updating the credentials.json file, delete the token.json file and then run a test from the commandline. When it pauses, hit enter to get the correct prompts. Be sure to update the secrets in GHA.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages