Walter is a tiny deployment pipeline template.
Walter automates the deployment process of applications or servers from configuration to software deployment.
- Go 1.3 or greater
- Mercurial 2.9 or greater
You can build Walter with the following commands.
$git clone [email protected]:walter-cd/walter.git
$cd walter
$./build
We welcome any contributions through Github pull requests. When you make changes such as new features and the add the tests, please run test before throw the pull request. You can run test with the test.sh script.
$sh test.sh
Walter has one configuration file, which specifies a set of tasks needed to build or deploy target application or service. More specifically, users specify the order of the tasks for the deployment. Each task is called as stage, and the flow is called pipeline in Walter.
The configuration format of Walter is Yaml. The yaml configuration file need to have one pipeline block, which has more than one stage element.
The following is a sample configuration of Walter.
pipeline:
- name: command_stage_1
type: command
command: echo "hello, world"
- name: command_stage_2
type: command
command: echo "hello, world, command_stage_2"
- name: command_stage_3
type: command
command: echo "hello, world, command_stage_3"
As we see, the pipeline block has three stages and the stage type is command, each of which run echo command and has the stage name (such as command_stage_1). User can name arbitrary name of each stage. The commands are executed with the same order as the pipeline configuration.
Stage in pipeline has three elements, name, type and configurations. configuration elements are optional. The elements of configurations depend on the type. For example command_stage type has command configuration, which specify the shell command run in the stage. The following is the table on the type and the parameters.
Command stage executes one command. Users specify Command stage adding command in type.
The following is the parameter of Command stage.
Configuration | Optional | meaning |
---|---|---|
command | false | shell command run in the stage |
only_if | true | run specified command on when the condition written in only_if is satisfied |
directory | true | the directory where walter runs the specified command |
Command stage executes specified shell script file. Users specify Command stage adding shell in type.
The following is the parameter of Command stage.
Configuration | Optional | meaning |
---|---|---|
file | false | shell script file run in the stage |
Walter supports to submits the messages to messaging services.
To submit a message, users need to add a messenger block into the configuration file. The following is a sample of the yaml block with HipChat.
messenger:
type: hipchat
room_id: ROOM_ID
token: TOKEN
from: USER_NAME
To report the result to the specified messenger service added with the above setting, users add message attribute with true into the stage they want to know the results.
pipeline:
- name: command_stage_1
type: command
command: echo "hello, world"
message: true
- name: command_stage_2
type: command
command: echo "hello, world, command_stage_2"
message: true
Walter supports HipChat API v1 and v2 as the messenger type.
Messenger Type | meaning |
---|---|
hipchat | HipChat (API v1) |
hipchat2 | HipChat (API v2) |
slack | Slack Incoming Webhook integration |
To activate the report function, we need to specify the properties for messenger type. The needed properties are different in each messenger type.
Property Name | meaning |
---|---|
room_id | Room name |
token | HipChat token |
from | Account name |
Property Name | meaning |
---|---|
channel | Channel name |
username | User name |
Walter provides a coordination function to a project hosting service, GitHub. Specifically the service function provides two roles
- Check if a new commit or pull requests from the repository
- Run pipeline to the latest commit and pull requests when there are newer ones than the last update
To activate service coordination function, we add a "service" block to the Walter configuration file. "service" block contains several elements (type, token, repo, from, update).
service:
type: github
token: ADD_YOUR_KEY
repo: YOUR_REPOSITORY_NAME
from: YOUR_ACCOUNT_OR_GROUP_NAME
update: UPDATE_FILE_NAME
The following shows the description of each element.
Element | description |
---|---|
type | Service type (currently Walter supports github only) |
token | GitHub token |
repo | Repository name |
from | Account or organization name (if the repository is own by a organization) |
update | Update file which contains the result and time of the last execution |
Users add environment variables in Walter configuration files. The names of environment variables are expanted into the the values of environment variables. Environment variables in the configuration files are valuable when we need to write the sensitive information such as tokens of messenger service or passwords of a external systems.
The following is the format of embedding of the environment variables.
$ENV_NAME
We write the envrionment variable into ENV_NAME. The following configuration file specify the GitHub Token by embedding the environment variable, GITHUB_TOKEN.
service:
type: github
token: $GITHUB_TOKEN
repo: my-service-repository
from: service-group
update: .walter