Hello world
Zero to 'hello world' in five minutes:
#
Step 1: create your projectCreate a new folder for your project.
Download the latest version of
batect
andbatect.cmd
from the releases page, and copy these scripts into your project folder.Note that you only need the scripts - you don't need to download
batect.jar
.If you're on Linux or macOS, make sure the script is executable: run
chmod +x batect
.
#
Step 2: define your environment and tasksCreate a file called
batect.yml
and add this container definition:batect.ymlThis container defines the environment our task will run in. In this case, we're using an Alpine Linux image.
After that container definition, add a task:
batect.ymlThis task defines what to do when the task is run. In this case, it'll just print a "Hello world!" message.
#
Step 3: run the taskOpen a terminal, change to the project folder and run
./batect --list-tasks
. You should see output similar to the following:"$ ./batect --list-tasks--list-tasks
is available in every Batect project, and makes it easy for your team to discover what tasks are available to them.Now let's run the task with
./batect say-hello
. You should see output similar to the following:$ ./batect say-hello
#
Where next?- The tutorial introduces the main concepts of Batect through a simple sample application
- The sample projects show Batect in a number of real-world scenarios