|
|
# Folder structure for deployments
|
|
|
|
|
|
## Capistrano-like structure
|
|
|
```
|
|
|
project_root
|
|
|
├── current -> releases/20150301100000 # this is a symlink to the current release
|
|
|
├── releases
|
|
|
│ ├── 20150301100000
|
|
|
│ ├── 20150228100000
|
|
|
│ └── 20150226100000
|
|
|
└── shared
|
|
|
└── <linked_files and linked_dirs>
|
|
|
```
|
|
|
|
|
|
* **current** is a symlink pointing to the latest release. This symlink is updated at the end of a successful deployment. If the deployment fails in any step the **current** symlink still points to the old release.
|
|
|
|
|
|
* **releases** holds all deployments in a timestamped folder. These folders are the target of the **current** symlink.
|
|
|
|
|
|
* **shared** contains the linked_files and linked_dirs which are symlinked into each release. This data persists across deployments and **releases**. It should be used for things like database configuration files and static and persistent user storage handed over from one release to the next.
|
|
|
|
|
|
We use symlink (mklink in Windows) to point **current** to latest release.
|
|
|
|
|
|
## Example
|
|
|
goMenu-service
|
|
|
```
|
|
|
C:\webGo\goMenu-service
|
|
|
├── current -> C:\webGo\goMenu-service\releases\20200522235933\
|
|
|
│ ├── .env -> C:\webGo\goMenu-service\shared\.env
|
|
|
│ └── public
|
|
|
│ ├── eMenuImages -> C:\webGo\goMenu-service\shared\eMenuImages\
|
|
|
│ └── files -> C:\webGo\goMenu-service\shared\files\
|
|
|
├── releases
|
|
|
│ ├── 20200514105300
|
|
|
│ └── 20200522235933
|
|
|
└── shared
|
|
|
├── .env
|
|
|
├── eMenuImages
|
|
|
└── files
|
|
|
```
|
|
|
|
|
|
|
|
|
# Reference
|
|
|
* https://capistranorb.com/documentation/getting-started/structure/
|
|
|
* https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/mklink
|
|
|
* https://pm2.keymetrics.io/docs/tutorials/capistrano-like-deployments |
|
|
\ No newline at end of file |