# SPT Items
## Notes
* This project assumes that the target OS is ubuntu
* This project has been tested on Ubuntu 20.04
* This project assumes that nginx is already installed on the target machine
* You can use either of the two drone pipeline types:
* [docker](../.drone-docker.yml)
* [kubernetes](../.drone-kubernetes.yml)
* Some enhancement ideas can be found [here](#some-enhancement-ideas)
## The pipeline summary
1. Each push will:
1. Builds the frontend
1. Move the build frontend in the backend `public` folder
1. IF Promoted to production, deploys to the server
## 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_hostname | The remote server where to deploy
used by Ansible SSH | my.server.com |
| deploy_username | The default username on the remote server
used by Ansible SSH
This user must have sudo rights | myuser |
| 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----- |
## The pipeline walkthrough
see [Walkthrough.md](./docs/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