https://github.com/alexdodonov/builder
https://github.com/alexdodonov/builder
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/alexdodonov/builder
- Owner: alexdodonov
- Created: 2021-05-27T05:44:07.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-05-27T06:13:44.000Z (over 4 years ago)
- Last Synced: 2025-06-23T16:39:52.516Z (3 months ago)
- Language: Python
- Size: 21.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# builder
Micro framework for creating building and deployment scripts
## Installation:
Download builder.py and put in your PYTHONPATH. That's it! )
## First script
Create deploy.json file with the content in the example below:
```
{
"deploy" : {
"host" : "your-ftp-host" , "user" : "your-ftp-user" ,
"password" : "your-ftp-password" , "path" : "path-on-your-ftp-server"
} ,
"order" : [
{ "step" : "deploy" , "type" : "ftp" }
]
}
```Then create script deploy.py with the below code:
```
import builder
builder.run()
```When you run this script - it will deploy all the files from the directory in wich it was run
It is also possible to deploy on multiple servers:
```
{
"deploy1" : {
"host" : "your-ftp-host-1" , "user" : "your-ftp-user-1" ,
"password" : "your-ftp-password-1" , "path" : "path-on-your-ftp-server-1"
} ,
"deploy2" : {
"host" : "your-ftp-host-2" , "user" : "your-ftp-user-2" ,
"password" : "your-ftp-password-2" , "path" : "path-on-your-ftp-server-2"
} ,
"order" : [
{ "step" : "deploy1" , "type" : "ftp" } ,
{ "step" : "deploy2" , "type" : "ftp" }
]
}
```The config above tells Builder that it is necessary to deploy project on two servers via FTP.
## Running tests
Builder allows you tu run PHPUnit tests. To do this just create another JSON config test.json:
```
{
"tests": [
"--filter PlugServiceTest ./tests"
]
}
```And then create test.py with the same content as deploy.py in the above example. Then run test.py and rest )
## Deploy and test
You can prepend and postpend your deploy command with testing section. If tests will fail, then deploy will not be run. See the deploy script below:
```
{
"predeploy-tests" : [
"./tests/local"
] ,
"deploy" : {
"host" : "your-ftp-host" , "user" : "your-ftp-user" ,
"password" : "your-ftp-password" , "path" : "path-on-your-ftp-server"
} ,
"afterdeploy-tests" : [
"./tests/prod"
] ,
"order" : [
{ "step" : "predeploy-tests" , "type" : "tests" } ,
{ "step" : "deploy" , "type" : "ftp" } ,
{ "step" : "afterdeploy-tests" , "type" : "tests" }
]
}
```If you have any questions or advises - feel free to contact with the author by email [alexey@dodonov.pro](mailto:alexey@dodonov.pro)