mirror of
https://github.com/sp-tarkov/db-website.git
synced 2025-02-08 02:30:45 -05:00
2.9 KiB
2.9 KiB
SPT Items
Required secrets
secret name | description | example |
---|---|---|
spt_items_hostname | The remote server where spt-items-finder will be reachable used for the frontend resolution |
spt-items.my.server.com |
deploy_path | The path to deploy to in the remote machine | /var/www/html/aki/Website/items |
deploy_hostname | The remote server where to deploy used by Ansible SSH |
my.server.com |
deploy_username | The default username to use on the remote server used by Ansible SSH |
www-data |
deploy_user_group | The default user group to use on the remote server used to set permission on the website folder |
www-data |
deploy_ssh_key | The content of the ssh private key used to connect to the remote server The key needs to be in RSA in "RSA PRIVATE KEY" format The ssh publick key needs to already be in the user used in the remote server ~/.ssh/authorized_keys |
-----BEGIN RSA PRIVATE KEY----- The key -----END RSA PRIVATE KEY----- |
deploy_ssh_key_passphrase | The passphrase to decrypt the SSH private key | test |
⚠ Important notes for the deployment ⚠
- Add all required secrets in Drone
- Server permissions:
- The server must be able to use
apt
package manager - The deploy_usernam must exists, be part of the group deploy_user_group and be able to SSH into the server
- If the parent folder of deploy_path already exists, deploy_username must have read and write permissions on it
- The server must be able to use
- PHP:
php8.0-fpm
and all its dependencies must already be installedphp8.0-fpm
must be configured to use deploy_username (to ensure the cache created by Laravel can be deleted before every new deployment)
- Nginx:
- Nginx must be using uses the user group deploy_user_group
- Nginx must be configured to use HTTPS
- Nginx must be configured to listen to spt_items_hostname and to point to the deploy_path
The pipeline summary
- The Drone pipeline is based on Docker: .drone-docker.yml
- Some enhancement ideas can be found here
- Each push will:
- Test the frontend
- IF on
development
ormaster
/main
branch- Builds the frontend
- IF pushed from
master
ormain
main branch- Move the build frontend in the backend
public
folder - Deploys to the server
- Move the build frontend in the backend
The pipeline walkthrough
see Walkthrough.md
Some enhancement ideas
- Store the build so that it is not rebuilt on any
promote
event - Use a volume or a cache for Yarn install
Thanks
- CWX
Cache refresh workaround
- Navigate to
/var/www/html/aki/db-website/items/storage/framework/cache/data
- Delete each cache folder
- Use the site to search for an item
- New cache should be generated for the DB