y12studio / y12io

online service evaluation
Apache License 2.0
4 stars 0 forks source link

dokku test #12

Closed y12studio closed 10 years ago

y12studio commented 10 years ago

ref

y12studio commented 10 years ago
$ git clone https://github.com/heroku/node-js-sample
$ cd node-js-sample
$ git remote add y12test dokku@dokku.y12.tw:node-js-app
$ git push y12test master
[...]
-----> Building runtime environment
-----> Discovering process types
       Procfile declares types -> web
-----> Releasing node-js-app ...
-----> Deploying node-js-app ...
=====> Application deployed:
       http://node-js-app.dokku.y12.tw

To dokku@dokku.y12.tw:node-js-app
 * [new branch]      master -> master

# dokku 
# docker ps
CONTAINER ID        IMAGE                      COMMAND                CREATED             STATUS              PORTS                     NAMES
11b78e3942ac        dokku/node-js-app:latest   /bin/bash -c '/start   43 seconds ago      Up 43 seconds       0.0.0.0:49153->5000/tcp   furious_poincare
y12studio commented 10 years ago

Dart in Dokku

igrigorik/heroku-buildpack-dart

$ git clone https://github.com/igrigorik/heroku-buildpack-dart
$ cp -R heroku-buildpack-dart/test-app /tmp/dart-dokku-hello
$ ls /tmp/dart-dokku-hello/
bin  LICENSE  Procfile  pubspec.yaml  README.md  web
$ cd /tmp/dart-dokku-hello
$ git init
$ git add .
$ git commit -m "hello dart in dokku"
$ git remote add y12test dokku@dokku.y12.tw:dart-dokku-hello
$ git push y12test master
Writing objects: 100% (11/11), 2.23 KiB | 0 bytes/s, done.
Total 11 (delta 0), reused 0 (delta 0)
-----> Cleaning up ...
remote: Cloning into '/tmp/tmp.w7068y0KsG'...
-----> Building dart-dokku-hello ...
remote: warning: You appear to have cloned an empty repository.
remote: done.
remote: HEAD is now at 3ea9b77... dart hello
To dokku@dokku.y12.tw:dart-dokku-hello
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'dokku@dokku.y12.tw:dart-dokku-hello'

issue ref need some hand,. master (pre-receive hook declined) · Issue #497 · progrium/dokku

sudo wget -O /etc/init/docker.conf https://raw.github.com/dotcloud/docker/master/contrib/init/upstart/docker.conf
sudo service docker restart

git push again

remote: Cloning into '/tmp/tmp.YLL29SNAbn'...
-----> Building dart-dokku-hello ...
remote: warning: You appear to have cloned an empty repository.
remote: done.
remote: HEAD is now at 3ea9b77... dart hello
       Dart app detected
-----> Welcome, this machine is: Linux 3fed2559e040 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
ERROR: you must specify DART_SDK_URL to a Dart SDK for Linux. See README for this buildpack.
To dokku@dokku.y12.tw:dart-dokku-hello
 ! [remote rejected] master -> master (pre-receive hook declined)

set .env

$ cat .env
export DART_SDK_URL=http://storage.googleapis.com/dart-archive/channels/stable/release/latest/sdk/dartsdk-linux-x64-release.zip
$ git commit 
$ git push y12test master
...
remote: HEAD is now at e5234a7... url fixed
remote:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
remote:                                  Dload  Upload   Total   Spent    Left  Speed
remote:   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--remote:   0 11.7M    0 13498    0     0  43863      0  0:04:40 --:--:--  0:04:40 51915gzip: stdin has more than one entry--rest ignored
remote: tar: Child died with signal 13
remote: tar: Error is not recoverable: exiting now

ref

y12studio commented 10 years ago

Dart in Dokku

selkhateeb/heroku-vagrant-dart-build

$ cat .env
export DART_SDK_URL=https://github.com/selkhateeb/heroku-vagrant-dart-build/releases/download/latest/dart-sdk.tar
$ git push y12test master
....
Took 0:00:08.967593 to compile basic_http_server|web/index.dart.
Built 5 files to "build".
total
-----> Discovering process types
       Procfile declares types -> web
-----> Releasing dart-dokku-hello ...
-----> Deploying dart-dokku-hello ...
=====> Application deployed:
       http://dart-dokku-hello.dokku.y12.tw

To dokku@dokku.y12.tw:dart-dokku-hello

browser to http://dart-dokku-hello.dokku.y12.tw but 404 NotFound.

server side output

root@0:~# dokku run dart-dokku-hello /app/dart-sdk/bin/dart --version
Dart VM version: 1.3.0 (Tue Apr 15 03:03:20 2014) on "linux_x64"
root@0:~# dokku run dart-dokku-hello env
HOSTNAME=b23973eff018
TERM=xterm
OLDPWD=/
PATH=/app/bin:/usr/local/bin:/usr/bin:/bin
PWD=/app
SHLVL=1
HOME=/app
_=/usr/bin/env

curl fail.

y12studio commented 10 years ago

modify dart code

$ cat bin/basic_http_server.dart
import 'package:bloodless/server.dart' as app;

@app.Route("/")
helloWorld() => "Hello, World!";

main() {
  app.setupConsoleLog();
  app.start(port:5000);
}
$ cat pubspec.yaml
name: basic_http_server
author: Seth Ladd <sethladd@gmail.com>
version: 0.0.1
homepage: https://github.com/sethladd/dart-basic-http-server
description: A sample command-line application
dependencies:
  browser: any
  http_server: any
  bloodless: ">=0.3.0 <0.4.0"
$ git commit
$ git push y12test master

curl hello world.