Coder Social home page Coder Social logo

walter's Introduction

Walter

wercker status

Walter is a tiny deployment pipeline template.

Overview

Walter automates the deployment process of applications or servers from configuration to software deployment.

Getting Started

Requirements

  • Go 1.3 or greater
  • Mercurial 2.9 or greater

How to Build

You can build Walter with the following commands.

$git clone [email protected]:walter-cd/walter.git
$cd walter
$./build

How to contribute

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

Configuration setting

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.

Pipeline setting

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 setting

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

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

Shell script stage

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

Reporting function

Walter supports to submits the messages to messaging services.

Report configuration

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

Report types

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

Report configuration

To activate the report function, we need to specify the properties for messenger type. The needed properties are different in each messenger type.

hipchat and hipchat2

Property Name meaning
room_id Room name
token HipChat token
from Account name

slack

Property Name meaning
channel Channel name
username User name

Service coordination

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

Service configuration

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

Embedding Environment Variables

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

walter's People

Contributors

takahi-i avatar ainoya avatar ciarand avatar mizzy avatar herveleclerc avatar

Watchers

Yukihiko SAWANOBORI avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.