Usage
Project Configuration
Create 1build.yaml
configuration file by
1build.yaml
configuration file by1build init --name <your_project_name>
Edit file according to project command list, Example of 1build.yaml
for node project:
1build.yaml
for node project:project: Sample JVM Project Name
commands:
- build: npm run build
- test: npm run test
Running 1build for the above sample project
building the project
1build build
fix the coding guidelines lint and run tests (executing more than one commands at once)
1build lint test
Set new or update existing configuration
Set new command configuration for lint
to eslint server.js
lint
to eslint server.js
1build set lint "eslint server.js"
Unset/Remove existing configuration
Unset command configuration for lint
lint
1build unset lint
Unset multiple commands at once for lint, test, build
lint, test, build
1build unset lint test build
Unset will log missing commands
Running command before and after execution of 1build command
Consider that your project requires some environment variables to set before running any commands and you want to clean up those after running commands. It is a headache to always remember to set those environment variables. What you want is to set env variables automatically when you run the command in the project and remove those when the command is complete. Another example – a project requires Docker
to be up and running or you need to clean up the database after running a test harness.
This is where before
& after
commands are useful. These commands are both optional – you can use one of them, both or neither.
Examples:
Setting env variables and cleaning those up
project: Sample JVM Project Name before: export VARNAME="my value" after: unset VARNAME commands: - build: npm run build
Ensure that
Docker
is up and runningproject: Containerized Project before: ./docker_run.sh commands: - build: npm run build
Clean up database after some commands
project: Containerized Project after: ./clean_database.sh commands: - build: npm run build
See 1build --help
for command usages.
1build --help
for command usages.