Sequence is a versatile automation framework designed to seamlessly integrate and orchestrate scripts and code snippets written in various languages. It serves as a powerful tool to connect disparate sequences of code, enabling the creation of sophisticated, cohesive automation workflows. If it can run in the terminal, you can sequence it!
go install github.com/yourusername/your-repo-name/cmd/cli@latest
sequence --workflow workflow.yaml
Note
Prefer to build it? Check out the Getting Started section.
- Job Execution: Execute a series of jobs defined in a structured YAML file.
- Error Handling: Specify error handlers for each job, providing robust control over error management.
- Conditional Execution: Define dependencies among jobs, ensuring that certain jobs run only after their dependencies have executed successfully.
- Job Skipping: Flexibly skip certain jobs without removing them from the configuration, allowing for dynamic adjustments of the job sequence.
- Exit Control: Control the continuation or termination of the sequence when a job fails, based on the
exit_on_error
attribute.
- Go (version 1.15 or later)
-
Clone the repository:
git clone https://github.com/arivictor/sequence.git
-
Navigate to the repository directory:
cd sequence
-
Build the application:
go build -o sequence ./cmd/cli
Define your jobs and their properties in a YAML file. Below is a template of how the configuration should look:
jobs:
- name: "Say Hello"
command: "echo 'Hello World!' && exit 1"
exit_on_error: false # quits the process on error
success_hook: "some handler"
error_hook: "some handler"
skip: false
- name: "Run JavaScript"
command: "node hello_world.js"
depends_on: ["Job 1"] # Won't run, depends on the first job
hooks:
- name: "some handler"
command: "echo 'handling success..'"
Note
See example.yaml for a more verbose example..
To execute the jobs as per your configuration file (e.g., config.yaml
), use the following command:
./sequence --workflow workflow.yaml
Note
- Filepaths defined in jobs are executed relative from where the command is executed.
- Workflows will move to the next job even if the job fails, you must explicity set
exit_on_error
totrue
if you wish the workflow to fail hard.
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.