- Project have to be node/npm project (its only requirement to allow this automation be run)
- Scripts (if needed) should save output files in one directory which is easly accessible for manager
- Also should have some scripts to be run
- Pull API
git clone https://github.com/autonomous-node-projects/manager-api.git
- Pull UI
git clone https://github.com/autonomous-node-projects/manager-ui.git
- Edit
manager-api/env/.env.prod
andmanager-ui/src/environments/environment.prod.ts
- Go to
./manager-api/docker
directory and edit.env
file - In the same directory run both
docker-compose build
anddocker-compose up -d
- Access ANPM from web browser under given host
- Create mongo database for
Autonomous node projects manager
- Pull project to local directory
- Run
npm install
- Edit environment file accordingly to your needs under -
./env/.env.prod
(or while developing app -./env/.env.dev
)
API_PORT=3000
PROJECTS_FILES='data/projects_files'
TMP_FILES='data/tmp_files'
DB_URL='mongodb://localhost:27017'
DB_DB='ANPM'
- Create TAR archive of your node root files (those among package.json)
- Upload this TAR archive file to projects_files directory via
${API_IP}/projects
(eg. http://localhost:3000/projects) endpoint - Schedule any script you want to run by via
${API_IP}/schedules?id={projectId}
(eg. http://localhost:3000/schedules?id=608d79d77a728a50231001ac) endpoint using body:
[
{
"scriptName": "start",
"every": {
"value": 2,
"timeType": "hours"
},
"exitAfter": 5
}
]
Keys values:
scriptName
- script which will be runevery.value
- amount of time used as intervalevery.timeType
- type of time used as intervalexitAfter
- amount of how many times script should be run and then terminated
- Download output data via
${API_IP}/output?type=download
endpoint
There is swagger viewer of Open API documentation under ${API_IP}/swagger
.