Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
import argparse
import json
import os
import urllib2
def get_envs(app_name):
resp = request("/apps/{}/env".format(app_name))
#!/bin/bash -e
echo "hello world!"
{
"ImportPath": "github.com/fsouza/go-dockerclient",
"GoVersion": "go1.4.1",
"Deps": [
{
"ImportPath": "github.com/Sirupsen/logrus",
"Comment": "v0.6.0",
"Rev": "6ebb4e7b3c24b9fef150d7693e728cb1ebadf1f5"
},
{
{
"ImportPath": "github.com/fsouza/go-dockerclient",
"GoVersion": "devel +7579867 Fri Apr 24 05:45:36 2015 +0000",
"Deps": [
{
"ImportPath": "github.com/Sirupsen/logrus",
"Comment": "v0.6.0",
"Rev": "6ebb4e7b3c24b9fef150d7693e728cb1ebadf1f5",
"ws": "/Users/f",
"root": "github.com/Sirupsen/logrus",
package main
import (
"fmt"
"github.com/fsouza/go-dockerclient"
)
func main() {
endpoint := "http://192.168.50.4:2375"
mysql_host = get_env("MYSQL_HOST")
if not mysql_host:
mysql_host = "localhost"
mysql_port = get_env("MYSQL_PORT")
if not mysql_port:
mysql_port = 3306
% mongo --quiet -u my_user -p my_password my_host:27017/tsuru --eval 'db.docker_containers.findOne({id: "<container-id>"}).privatekey' > key_file.pem
% chmod 400 key_file.pem
% ssh localhost -p <container-port> -i key_file.pem
remote: Reading package lists...
remote: Building dependency tree...
remote: Reading state information...
remote: The following NEW packages will be installed:
remote: libevent-core-2.0-5 libevent-extra-2.0-5 libevent-openssl-2.0-5
remote: libevent-pthreads-2.0-5
remote: 0 upgraded, 4 newly installed, 0 to remove and 12 not upgraded.
remote: Need to get 154 kB of archives.
remote: After this operation, 488 kB of additional disk space will be used.
remote: Get:1 http://archive.ubuntu.com/ubuntu/ trusty/main libevent-core-2.0-5 amd64 2.0.21-stable-1ubuntu1 [77.9 kB]
remote: ; Loading "cl-async"
remote: [package babel-encodings].........................
remote: [package babel]...................................
remote: ..................................................
remote: [package cffi-sys]................................
remote: [package cffi]....................................
remote: ..................................................
remote: [package cffi-features]...........................
remote: [package libevent2]...............................
remote: [package libevent2.accessors].....................
$ curl -L https://raw.githubusercontent.com/tsuru/now/master/run.bash -o tsuru-now.bash
$ chmod +x tsuru-now.bash
$ ./tsuru-now.bash --tsuru-pkg --without-dashboard