• Stars
    star
    275
  • Rank 145,173 (Top 3 %)
  • Language
    Ruby
  • License
    MIT License
  • Created over 8 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Deploy Docker container

Hako

Gem Version CI

Deploy Docker container.

Installation

Add this line to your application's Gemfile:

gem 'hako'

And then execute:

$ bundle

Or install it yourself as:

$ gem install hako

Usage

% hako deploy examples/hello.jsonnet
I, [2015-10-02T12:51:24.530274 #7988]  INFO -- : Registered task-definition: arn:aws:ecs:ap-northeast-1:XXXXXXXXXXXX:task-definition/hello:29
I, [2015-10-02T12:51:24.750501 #7988]  INFO -- : Uploaded front configuration to s3://nanika/hako/front_config/hello.conf
I, [2015-10-02T12:51:24.877409 #7988]  INFO -- : Updated service: arn:aws:ecs:ap-northeast-1:XXXXXXXXXXXX:service/hello
I, [2015-10-02T12:56:07.284874 #7988]  INFO -- : Deployment completed

% hako deploy examples/hello.jsonnet
I, [2015-10-02T12:56:12.262760 #8141]  INFO -- : Deployment isn't needed

% hako status examples/hello.jsonnet
Load balancer:
  hako-hello-XXXXXXXXXX.ap-northeast-1.elb.amazonaws.com:80 -> front:80
Deployments:
  [PRIMARY] hello:30 desired_count=2, pending_count=0, running_count=2
Tasks:
  [RUNNING]: i-XXXXXXXX (ecs-001)
  [RUNNING]: i-YYYYYYYY (ecs-002)
Events:
  2015-10-05 13:35:53 +0900: (service hello) has reached a steady state.
  2015-10-05 13:35:14 +0900: (service hello) stopped 1 running tasks.

% hako rollback examples/hello.jsonnet
I, [2016-05-02T13:07:12.679926 #10961]  INFO -- : Current task defintion is hello:29. Rolling back to arn:aws:ecs:ap-northeast-1:XXXXXXXXXXXX:task-definition/hello:28
I, [2016-05-02T13:07:12.959116 #10961]  INFO -- : Updated service: arn:aws:ecs:ap-northeast-1:XXXXXXXXXXXX:service/hello
I, [2016-05-02T13:08:27.280686 #10961]  INFO -- : Deployment completed

Run oneshot command.

% hako oneshot examples/hello.jsonnet date
I, [2017-07-18T18:14:06.099763 #6627]  INFO -- : Task definition isn't changed: arn:aws:ecs:ap-northeast-1:XXXXXXXXXXXX:task-definition/hello-oneshot:32
I, [2017-07-18T18:14:06.147062 #6627]  INFO -- : Started task: arn:aws:ecs:ap-northeast-1:XXXXXXXXXXXX:task/01234567-89ab-cdef-0123-456789abcdef
I, [2017-07-18T18:14:06.193860 #6627]  INFO -- : Container instance is arn:aws:ecs:ap-northeast-1:XXXXXXXXXXXX:container-instance/01234567-89ab-cdef-0123-456789abcdef (i-0123456789abcdef0)
I, [2017-07-18T18:14:37.826389 #6627]  INFO -- : Started at 2017-07-18 18:14:37 +0900
I, [2017-07-18T18:14:37.826482 #6627]  INFO -- : Stopped at 2017-07-18 18:14:37 +0900 (reason: Essential container in task exited)
I, [2017-07-18T18:14:37.826520 #6627]  INFO -- : Oneshot task finished
I, [2017-07-18T18:14:37.826548 #6627]  INFO -- : app has stopped with exit_code=0

See also docs/ecs-task-notification.md.

Front image

The front container receives these environment variables.

  • S3_CONFIG_BUCKET and S3_CONFIG_KEY
    • The front container should download configuration file from S3.

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/eagletmt/hako.

More Repositories

1

switch_point

Switching database connection between readonly one and writable one
Ruby
593
star
2

ghcmod-vim

Happy Haskell programming on Vim, powered by ghc-mod
Vim Script
434
star
3

neco-ghc

A completion plugin for Haskell, using ghc-mod
Vim Script
363
star
4

faml

Faster implementation of Haml template language
Ruby
187
star
5

project-euler-c

solutions for Project Euler in C
C
60
star
6

android-repository-history

History of Android repository XML
Rust
29
star
7

guzuta

Custom repository manager for ArchLinux pacman
Rust
27
star
8

eagletmt-recutils

My recutils
Rust
27
star
9

misc

いろいろ
Rust
24
star
10

comic_walker

Client library for ComicWalker
Ruby
23
star
11

aws-lambda-rie-gateway

Convert HTTP request to API Gateway payload for aws-lambda-rie
Rust
15
star
12

libssh-ruby

Ruby binding for libssh
C
14
star
13

envop

Set environment variables from 1Password Secure Notes
Rust
13
star
14

haml_parser

Parser of Haml template language
Ruby
12
star
15

unite-haddock

unite.vim source for haddock
Vim Script
12
star
16

coqtop-vim

Interact with coqtop within Vim
Vim Script
11
star
17

slack-gtk

Native desktop client for slack.com
C++
10
star
18

mitamae-secrets

itamae-secrets for mitamae
Ruby
9
star
19

PKGBUILDs

my PKGBUILDs for Arch Linux
Shell
8
star
20

slack-thread-expander

Expand threaded messages without "Also sent to the channel"
Rust
7
star
21

onlinejudge-vim

enjoy online judges with Vim
Vim Script
6
star
22

kaede

Scheduler for recpt1 recorder using Syoboi Calendar
Ruby
5
star
23

ghci-vim

interact with GHCi
Vim Script
5
star
24

dotfiles

my dotfiles
Vim Script
5
star
25

assert_trait

Macro for static assert that values implements traits.
Rust
5
star
26

barbeque_client-rs

Barbeque client for Rust
Rust
4
star
27

contests

Programming contest is fun
C++
3
star
28

idolmap

Rust
3
star
29

akabei

Custom repository manager for ArchLinux pacman
Ruby
3
star
30

mruby-etc

etc module for mruby
C
3
star
31

django-runner

Run arbitrary Python script within Django environment
Python
3
star
32

dump-tf-schema

Dump schema of Terraform providers
Rust
3
star
33

activerecord-attribute_converter

Transparent conversion for ActiveRecord
Ruby
3
star
34

s3_assets_uploader

Upload Rails assets to S3
Ruby
3
star
35

faraday_middleware-cookiejar

Faraday middleware for managing cookies
Ruby
2
star
36

arch.wanko.cc

http://arch.wanko.cc
Rust
2
star
37

ttcoder

TokyoTechCoder
Ruby
2
star
38

revision_plate-golang

Serve application's REVISION
Go
2
star
39

setup

Ruby
2
star
40

poj-vim

Vim script for POJ
Vim Script
1
star
41

denv-rust

Rust
1
star
42

mitamae-pacman

Provide MItamae::InlineBackends::PacmanBackend for faster package management
C
1
star
43

procon

My submissions
C++
1
star
44

dvb-recpt1

recpt1 for earth-pt1 driver
C++
1
star
45

btrfs-usage

Show detailed btrfs usage in machine-readable format
C
1
star
46

eagletmt.github.com

1
star
47

uim-skk-server-completion

uim-skk で server completion γ§γγ‚‹γ‚ˆγ†γ«γ™γ‚‹
1
star
48

skkserv-rust

Rust
1
star
49

xz-rust

Pure Rust implementation of reading/writing xz files (WIP)
Rust
1
star
50

fastladder-bookwalker

Rust
1
star
51

hako-etcenv

Provide variables from etcenv to hako
Ruby
1
star
52

sentry-notify-hipchat

A Sentry notification plugin for HipChat
Python
1
star
53

sentry-breakdown

Render Sentry project breakdown of usage report (WIP)
Rust
1
star
54

rundeck-simple-slack-notification

Groovy
1
star
55

bf-interp

brainf*ck interpreter written in Haskell
Haskell
1
star
56

ruby-minisat

Ruby binding for MiniSat
Ruby
1
star
57

fastladder-pixiv

Rust
1
star
58

tower-cookie-store

Cookie session store for Tower and Axum
Rust
1
star
59

hako-vault

Provide variables from Vault to hako
Ruby
1
star
60

project-euler-haskell

solutions for Project Euler in Haskell
Haskell
1
star