2012/05 | 2012/06 | 2012/07
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

2012年6月 1日

DotCloudをGit serverにしてみる

なんとかして、DotCloudをgitサーバーにしてプライベートなレポジトリにできないかなーと思って考えてるんやけど。これどうや、という方法が見つかったので試してみた。

1つは完全にDotCloudをストレージとして使う方法やけども…これはサーバーがもう1つ必要になるので実のところあんまりやりたくない。そしてもう1つはたまたま見つけたDotCloudでカスタムのNginXを動かすという方法。

DotCloudではもともとNginXが動いてるわけやけど、HTTPベースでgitでアクセスするのにこいつでは設定が不完全になって動かせない、というのがある。http_dav_moduleだと、PROPFINDメソッドに対応してないから動かないという…。しかし、これを克服するのにカスタムのNginXをインストールすることが可能というのを知ってしまい。

nginx-on-dotcloudというのがそれで、そしてさらにnginx-dav-ext-moduleを使えばPROPFINDメソッドにも対応できるようにhttp_dav_moduleを拡張できるという。これは!ということでやってみることに。

$ mkdir nginx-dav-ext-module
$ cd nginx-dav-ext-module/
$ git clone git://github.com/arut/nginx-dav-ext-module.git .

$ mkdir testgit
$ cd testgit/
$ git clone git://github.com/dotcloud/nginx-on-dotcloud.git .

$ vi dotcloud.yml
$ vi nginx/builder
$ vi nginx/nginx.conf.in
$ cp -R $DIR_OF_nginx-dav-ext-module .

これで、必要なモジュールとデプロイ用のファイルの編集を終了。ファイルの内容については、github(gist)で公開中

$ dotcloud push --all testgit
# upload /home/user/dcprojects/testgit ssh://dotcloud@uploader.dotcloud.com:443/testgit
# rsync
Pseudo-terminal will not be allocated because stdin is not a terminal.
building file list ... done
./
.gitignore
README.rst
dotcloud.yml
postinstall
nginx-dav-ext-module/
nginx-dav-ext-module/README
nginx-dav-ext-module/config
nginx-dav-ext-module/ngx_http_dav_ext_module.c
nginx/
nginx/builder
nginx/nginx.conf.in
static/
static/404.html
static/500.html
static/502.html
static/503.html
static/504.html
static/index.html
static/robots.txt

sent 10.29K bytes received 328 bytes 1.42K bytes/sec
total size is 27.87K speedup is 2.63
08:34:04 ---> Deploy of "testgit" scheduled for revision rsync-1338539643465 at 2012-06-01 08:34:04
08:34:04 ---> Building the application...
08:34:04 [nginx] Build started for revision rsync-1338539643465 (clean build)
08:34:07 [nginx] I am snapshotsworker_01/bob-1, and I will be your builder today.
08:34:10 [nginx] stdin: is not a tty
08:34:10 [nginx] Get:1 http://us-east-1.ec2.archive.ubuntu.com.s3.amazonaws.com lucid Release.gpg [189B]
08:34:10 [nginx] Ign http://us-east-1.ec2.archive.ubuntu.com.s3.amazonaws.com/ubuntu/ lucid/main Translation-en_US
08:34:10 [nginx] Ign http://us-east-1.ec2.archive.ubuntu.com.s3.amazonaws.com/ubuntu/ lucid/universe Translation-en_US
08:34:10 [nginx] Ign http://us-east-1.ec2.archive.ubuntu.com.s3.amazonaws.com/ubuntu/ lucid/multiverse Translation-en_US
08:34:11 [nginx] Get:2 http://archive.canonical.com lucid Release.gpg [198B]
08:34:11 [nginx] Ign http://archive.canonical.com/ lucid/partner Translation-en_US
08:34:11 [nginx] Get:3 http://us-east-1.ec2.archive.ubuntu.com.s3.amazonaws.com lucid-updates Release.gpg [198B]
08:34:11 [nginx] Ign http://us-east-1.ec2.archive.ubuntu.com.s3.amazonaws.com/ubuntu/ lucid-updates/main Translation-en_US
08:34:11 [nginx] Ign http://us-east-1.ec2.archive.ubuntu.com.s3.amazonaws.com/ubuntu/ lucid-updates/universe Translation-en_US
08:34:11 [nginx] Ign http://us-east-1.ec2.archive.ubuntu.com.s3.amazonaws.com/ubuntu/ lucid-updates/multiverse Translation-en_US
08:34:11 [nginx] Get:4 http://archive.canonical.com lucid Release [8,215B]
08:34:11 [nginx] Get:5 http://us-east-1.ec2.archive.ubuntu.com.s3.amazonaws.com lucid-security Release.gpg [198B]
08:34:11 [nginx] Ign http://us-east-1.ec2.archive.ubuntu.com.s3.amazonaws.com/ubuntu/ lucid-security/main Translation-en_US
08:34:11 [nginx] Get:6 http://archive.canonical.com lucid/partner Packages [12.9kB]
08:34:11 [nginx] Ign http://us-east-1.ec2.archive.ubuntu.com.s3.amazonaws.com/ubuntu/ lucid-security/universe Translation-en_US
08:34:11 [nginx] Ign http://us-east-1.ec2.archive.ubuntu.com.s3.amazonaws.com/ubuntu/ lucid-security/multiverse Translation-en_US
08:34:11 [nginx] Get:7 http://us-east-1.ec2.archive.ubuntu.com.s3.amazonaws.com lucid Release [57.2kB]
08:34:11 [nginx] Get:8 http://us-east-1.ec2.archive.ubuntu.com.s3.amazonaws.com lucid-updates Release [57.3kB]
08:34:11 [nginx] Get:9 http://us-east-1.ec2.archive.ubuntu.com.s3.amazonaws.com lucid-security Release [57.3kB]
08:34:11 [nginx] Get:10 http://us-east-1.ec2.archive.ubuntu.com.s3.amazonaws.com lucid/main Packages [1,383kB]
08:34:11 [nginx] Get:11 http://us-east-1.ec2.archive.ubuntu.com.s3.amazonaws.com lucid/universe Packages [5,430kB]
08:34:11 [nginx] Get:12 http://us-east-1.ec2.archive.ubuntu.com.s3.amazonaws.com lucid/multiverse Packages [176kB]
08:34:12 [nginx] Get:13 http://us-east-1.ec2.archive.ubuntu.com.s3.amazonaws.com lucid-updates/main Packages [614kB]
08:34:12 [nginx] Get:14 http://us-east-1.ec2.archive.ubuntu.com.s3.amazonaws.com lucid-updates/universe Packages [287kB]
08:34:12 [nginx] Get:15 http://us-east-1.ec2.archive.ubuntu.com.s3.amazonaws.com lucid-updates/multiverse Packages [11.3kB]
08:34:12 [nginx] Get:16 http://us-east-1.ec2.archive.ubuntu.com.s3.amazonaws.com lucid-security/main Packages [419kB]
08:34:12 [nginx] Get:17 http://us-east-1.ec2.archive.ubuntu.com.s3.amazonaws.com lucid-security/universe Packages [146kB]
08:34:12 [nginx] Get:18 http://us-east-1.ec2.archive.ubuntu.com.s3.amazonaws.com lucid-security/multiverse Packages [5,345B]
08:34:18 [nginx] Fetched 8,665kB in 7s (1,186kB/s)
08:34:19 [nginx] Reading package lists...
08:34:21 [nginx] stdin: is not a tty
08:34:21 [nginx] Reading package lists...
08:34:21 [nginx] Building dependency tree...
08:34:21 [nginx] Reading state information...
08:34:21 [nginx] Note, selecting libexpat1-dev instead of libexpat-dev
08:34:21 [nginx] libexpat1-dev is already the newest version.
08:34:21 [nginx] The following extra packages will be installed:
08:34:21 [nginx] libpcrecpp0
08:34:21 [nginx] The following NEW packages will be installed:
08:34:21 [nginx] libpcre3-dev libpcrecpp0
08:34:21 [nginx] 0 upgraded, 2 newly installed, 0 to remove and 78 not upgraded.
08:34:21 [nginx] Need to get 362kB of archives.
08:34:21 [nginx] After this operation, 905kB of additional disk space will be used.
08:34:21 [nginx] Get:1 http://us-east-1.ec2.archive.ubuntu.com.s3.amazonaws.com/ubuntu/ lucid/main libpcrecpp0 7.8-3build1 [98.2kB]
08:34:21 [nginx] Get:2 http://us-east-1.ec2.archive.ubuntu.com.s3.amazonaws.com/ubuntu/ lucid/main libpcre3-dev 7.8-3build1 [264kB]
08:34:21 [nginx] Fetched 362kB in 0s (2,981kB/s)
08:34:21 [nginx] Selecting previously deselected package libpcrecpp0.
(Reading database ... 34544 files and directories currently installed.)
08:34:22 [nginx] Unpacking libpcrecpp0 (from .../libpcrecpp0_7.8-3build1_amd64.deb) ...
08:34:29 [nginx] Selecting previously deselected package libpcre3-dev.
08:34:29 [nginx] Unpacking libpcre3-dev (from .../libpcre3-dev_7.8-3build1_amd64.deb) ...
08:34:30 [nginx] Processing triggers for man-db ...
08:35:39 [nginx] Setting up libpcrecpp0 (7.8-3build1) ...
08:35:39 [nginx]
08:35:39 [nginx] Setting up libpcre3-dev (7.8-3build1) ...
08:35:39 [nginx] Processing triggers for libc-bin ...
08:35:39 [nginx] ldconfig deferred processing now taking place
08:35:40 [nginx] --> ./nginx/builder: Step 0: getting ready for build::
08:35:40 [nginx] --> ./nginx/builder: Step 1: install nginx::
08:35:40 [nginx] --> ./nginx/builder: installing Nginx into: /home/dotcloud/nginx
08:35:40 [nginx] --> ./nginx/builder: making directory: /home/dotcloud/nginx
08:35:40 [nginx] --> ./nginx/builder: making directory: /tmp/code/tmp/stage
08:35:40 [nginx] --> ./nginx/builder: downloading nginx from (http://nginx.org/download/nginx-1.0.14.tar.gz) and untaring into (/tmp/code/tmp/stage)
(省略)
08:35:52 [nginx] checking for sysconf(_SC_NPROCESSORS_ONLN) ... found
08:35:52 [nginx] configuring additional modules
08:35:52 [nginx] adding module in ./nginx-dav-ext-module
08:35:52 [nginx] ./configure: error: no ./nginx-dav-ext-module/config was found
08:35:52 [nginx] --> ./nginx/builder: Nginx install failed
08:35:53 [nginx] -- Build failed: "SERVICE_POSTINSTALL='' SERVICE_APPROOT=. SERVICE_SYSTEMPACKAGES="['libpcre3-dev', 'libexpat-dev']" SERVICE_REQUIREMENTS='[]' SERVICE_PROCESSES_NGINX=nginx SERVICE_BUILDSCRIPT=nginx/builder SERVICE_TYPE=custom SERVICE_PORTS_WWW=http ./nginx/builder" failed with return code 1
08:35:53 ---> Aborting due to some build failure

Deployment finished. Your application is available at the following URLs
error: No URL found.

あれ。どうやらnginx-dav-ext-moduleのディレクトリが間違っていたらしい。nginx/builderファイルを修正して再挑戦。

(省略)
09:51:03 [nginx] --> ./nginx/builder: move into /tmp/code/tmp/stage
09:51:03 [nginx] --> ./nginx/builder: trying to compile nginx, and then install it
09:51:03 [nginx] checking for OS
09:51:03 [nginx] + Linux 2.6.38.2-grsec-dotcloud-ec2 x86_64
09:51:03 [nginx] checking for C compiler ... found
09:51:03 [nginx] + using GNU C compiler
09:51:03 [nginx] checking for gcc builtin atomic operations ... found
09:51:03 [nginx] checking for C99 variadic macros ... found
09:51:04 [nginx] checking for gcc variadic macros ... found
09:51:04 [nginx] checking for unistd.h ... found
09:51:04 [nginx] checking for inttypes.h ... found
09:51:04 [nginx] checking for limits.h ... found
09:51:04 [nginx] checking for sys/filio.h ... not found
09:51:04 [nginx] checking for sys/param.h ... found
09:51:04 [nginx] checking for sys/mount.h ... found
09:51:04 [nginx] checking for sys/statvfs.h ... found
09:51:04 [nginx] checking for crypt.h ... found
09:51:04 [nginx] checking for Linux specific features
09:51:04 [nginx] checking for epoll ... found
09:51:04 [nginx] checking for sendfile() ... found
09:51:04 [nginx] checking for sendfile64() ... found
09:51:04 [nginx] checking for sys/prctl.h ... found
09:51:05 [nginx] checking for prctl(PR_SET_DUMPABLE) ... found
09:51:05 [nginx] checking for sched_setaffinity() ... found
09:51:05 [nginx] checking for crypt_r() ... found
09:51:05 [nginx] checking for sys/vfs.h ... found
09:51:05 [nginx] checking for nobody group ... not found
09:51:05 [nginx] checking for nogroup group ... found
09:51:05 [nginx] checking for poll() ... found
09:51:05 [nginx] checking for /dev/poll ... not found
09:51:05 [nginx] checking for kqueue ... not found
09:51:05 [nginx] checking for crypt() ... not found
09:51:05 [nginx] checking for crypt() in libcrypt ... found
09:51:05 [nginx] checking for F_READAHEAD ... not found
09:51:05 [nginx] checking for posix_fadvise() ... found
09:51:05 [nginx] checking for O_DIRECT ... found
09:51:05 [nginx] checking for F_NOCACHE ... not found
09:51:05 [nginx] checking for directio() ... not found
09:51:06 [nginx] checking for statfs() ... found
09:51:06 [nginx] checking for statvfs() ... found
09:51:06 [nginx] checking for dlopen() ... not found
09:51:06 [nginx] checking for dlopen() in libdl ... found
09:51:06 [nginx] checking for sched_yield() ... found
09:51:06 [nginx] checking for SO_SETFIB ... not found
09:51:06 [nginx] checking for SO_ACCEPTFILTER ... not found
09:51:06 [nginx] checking for TCP_DEFER_ACCEPT ... found
09:51:06 [nginx] checking for accept4() ... found
09:51:06 [nginx] checking for int size ... 4 bytes
09:51:06 [nginx] checking for long size ... 8 bytes
09:51:06 [nginx] checking for long long size ... 8 bytes
09:51:06 [nginx] checking for void * size ... 8 bytes
09:51:07 [nginx] checking for uint64_t ... found
09:51:07 [nginx] checking for sig_atomic_t ... found
09:51:07 [nginx] checking for sig_atomic_t size ... 4 bytes
09:51:07 [nginx] checking for socklen_t ... found
09:51:07 [nginx] checking for in_addr_t ... found
09:51:07 [nginx] checking for in_port_t ... found
09:51:07 [nginx] checking for rlim_t ... found
09:51:07 [nginx] checking for uintptr_t ... uintptr_t found
09:51:07 [nginx] checking for system endianess ... little endianess
09:51:07 [nginx] checking for size_t size ... 8 bytes
09:51:07 [nginx] checking for off_t size ... 8 bytes
09:51:07 [nginx] checking for time_t size ... 8 bytes
09:51:07 [nginx] checking for setproctitle() ... not found
09:51:07 [nginx] checking for pread() ... found
09:51:07 [nginx] checking for pwrite() ... found
09:51:08 [nginx] checking for sys_nerr ... found
09:51:08 [nginx] checking for localtime_r() ... found
09:51:08 [nginx] checking for posix_memalign() ... found
09:51:08 [nginx] checking for memalign() ... found
09:51:08 [nginx] checking for mmap(MAP_ANON|MAP_SHARED) ... found
09:51:08 [nginx] checking for mmap("/dev/zero", MAP_SHARED) ... found
09:51:08 [nginx] checking for System V shared memory ... found
09:51:08 [nginx] checking for POSIX semaphores ... not found
09:51:08 [nginx] checking for POSIX semaphores in libpthread ... found
09:51:08 [nginx] checking for struct msghdr.msg_control ... found
09:51:08 [nginx] checking for ioctl(FIONBIO) ... found
09:51:08 [nginx] checking for struct tm.tm_gmtoff ... found
09:51:08 [nginx] checking for struct dirent.d_namlen ... not found
09:51:08 [nginx] checking for struct dirent.d_type ... found
09:51:09 [nginx] checking for sysconf(_SC_NPROCESSORS_ONLN) ... found
09:51:09 [nginx] configuring additional modules
09:51:09 [nginx] adding module in /tmp/code/nginx-dav-ext-module
09:51:09 [nginx] + ngx_http_dav_ext_module was configured
09:51:09 [nginx] checking for PCRE library ... found
09:51:09 [nginx] checking for OpenSSL library ... found
09:51:09 [nginx] checking for zlib library ... found
09:51:09 [nginx] checking for libxslt ... found
09:51:09 [nginx] checking for libexslt ... found
09:51:09 [nginx] checking for GeoIP library ... found
09:51:09 [nginx] creating objs/Makefile
09:51:11 [nginx]
09:51:11 [nginx] Configuration summary
09:51:11 [nginx] + using system PCRE library
09:51:11 [nginx] + using system OpenSSL library
09:51:11 [nginx] + md5: using OpenSSL library
09:51:11 [nginx] + sha1: using OpenSSL library
09:51:11 [nginx] + using system zlib library
09:51:11 [nginx]
09:51:11 [nginx] nginx path prefix: "/home/dotcloud/nginx"
09:51:11 [nginx] nginx binary file: "/home/dotcloud/nginx/sbin/nginx"
09:51:11 [nginx] nginx configuration prefix: "/home/dotcloud/nginx/conf"
09:51:11 [nginx] nginx configuration file: "/home/dotcloud/nginx/conf/nginx.conf"
09:51:11 [nginx] nginx pid file: "/home/dotcloud/nginx/logs/nginx.pid"
09:51:11 [nginx] nginx error log file: "/home/dotcloud/nginx/logs/error.log"
09:51:11 [nginx] nginx http access log file: "/home/dotcloud/nginx/logs/access.log"
09:51:11 [nginx] nginx http client request body temporary files: "client_body_temp"
09:51:11 [nginx] nginx http proxy temporary files: "proxy_temp"
09:51:11 [nginx] nginx http fastcgi temporary files: "fastcgi_temp"
09:51:11 [nginx] nginx http uwsgi temporary files: "uwsgi_temp"
09:51:11 [nginx] nginx http scgi temporary files: "scgi_temp"
09:51:11 [nginx] make -f objs/Makefile
09:51:11 [nginx] make[1]: Entering directory `/tmp/rsync-1338544207217/tmp/stage'
09:51:11 [nginx] gcc -c -O3 -pipe -I src/core -I src/event -I src/event/modules -I src/os/unix -I /usr/include/libxml2 -I objs \
(省略)
09:51:43 [nginx] make[1]: Leaving directory `/tmp/rsync-1338544207217/tmp/stage'
09:51:43 [nginx] --> ./nginx/builder: Successfully compiled and installed nginx
09:51:43 [nginx] --> ./nginx/builder: remove some of the default config files from the nginx config directory that aren't needed
09:51:43 [nginx] --> ./nginx/builder: cleaning up (/tmp/code/tmp) since it is no longer needed.
09:51:43 [nginx] --> ./nginx/builder: change directories back to /tmp/code
09:51:43 [nginx] --> ./nginx/builder: finished installing nginx.
09:51:43 [nginx] --> ./nginx/builder: Step 2: build profile::
09:51:43 [nginx] --> ./nginx/builder: Step 3: install application::
09:51:43 [nginx] --> ./nginx/builder: change directories to /tmp/code
09:51:43 [nginx] --> ./nginx/builder: moving /tmp/code/profile to ~/
09:51:43 [nginx] --> ./nginx/builder: installing application to ~/current/ from /tmp/code
09:51:43 [nginx] sending incremental file list
09:51:43 [nginx] created directory /home/dotcloud/current
09:51:43 [nginx] dotcloud.yml
09:51:43 [nginx] postinstall
09:51:43 [nginx] nginx-dav-ext-module/
09:51:43 [nginx] nginx-dav-ext-module/README
09:51:43 [nginx] nginx-dav-ext-module/config
09:51:43 [nginx] nginx-dav-ext-module/ngx_http_dav_ext_module.c
09:51:43 [nginx] nginx/
09:51:43 [nginx] nginx/builder
09:51:43 [nginx] nginx/nginx.conf.in
09:51:43 [nginx] static/
09:51:43 [nginx] static/404.html
09:51:43 [nginx] static/500.html
09:51:43 [nginx] static/502.html
09:51:43 [nginx] static/503.html
09:51:43 [nginx] static/504.html
09:51:43 [nginx] static/index.html
09:51:43 [nginx] static/robots.txt
09:51:43 [nginx]
09:51:43 [nginx] sent 27538 bytes received 290 bytes 55656.00 bytes/sec
09:51:43 [nginx] total size is 26538 speedup is 0.95
09:51:43 [nginx] --> ./nginx/builder: All done...
09:51:50 [nginx] Build completed successfully. Compiled image size is 26MB
09:51:50 ---> Application build is done
09:51:50 ---> Initializing new services... (This may take a few minutes)
09:51:50 ---> Using default scaling for service nginx (1 instance(s)).
09:51:51 [nginx.0] Initializing...
09:52:02 [nginx.0] Service initialized
09:52:05 ---> All services have been initialized. Deploying code...
09:52:05 [nginx.0] Deploying build revision rsync-1338544207217...
09:52:14 [nginx.0] Running postinstall script...
09:52:18 [nginx.0] Launching...
09:52:20 [nginx.0] Waiting for the instance to become responsive...
09:52:23 [nginx.0] Re-routing traffic to the new build...
09:52:23 [nginx.0] Successfully deployed build revision rsync-1338544207217
09:52:23 ---> Deploy finished
09:52:23 ---> Application fully deployed

Deployment finished. Your application is available at the following URLs
nginx: http://testgit-67yk2h4g.dotcloud.com/

おお、いったっぽい!! 続きは次のエントリーで。

▲top

投稿者 ただ : 23:11 | トラックバック (1) カテゴリー ; プログラミングとか

2012年6月 2日

DotCloudをGit serverにしてみる(2)

前回はGitのサーバーとして動かすのに必要なNginXとDAVモジュール拡張をデプロイするところまでできた。ので、実際にGitレポジトリを入れてみる。

カスタムNginXの設定ファイルでは、ドキュメントルートが/home/dotcloud/current/staticになっているので、staticディレクトリの下にレポジトリを作る。$testgit_dirはdotcloud.ymlがあるディレクトリ。

$ cd $testgit_dir/static
$ mkdir test.git
$ cd test.git
$ git init --bare

これで、http://~/test.git でアクセスできる(予定の)レポジトリができたはず。$testgit_dirに戻って、デプロイするファイルの確認。

$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# new file: static/test.git/HEAD
# new file: static/test.git/config
# new file: static/test.git/description
# new file: static/test.git/hooks/applypatch-msg.sample
# new file: static/test.git/hooks/commit-msg.sample
# new file: static/test.git/hooks/post-commit.sample
# new file: static/test.git/hooks/post-receive.sample
# new file: static/test.git/hooks/post-update.sample
# new file: static/test.git/hooks/pre-applypatch.sample
# new file: static/test.git/hooks/pre-commit.sample
# new file: static/test.git/hooks/pre-rebase.sample
# new file: static/test.git/hooks/prepare-commit-msg.sample
# new file: static/test.git/hooks/update.sample
# new file: static/test.git/info/exclude
#
# Changed but not updated:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: dotcloud.yml
# modified: nginx/builder
# modified: nginx/nginx.conf.in
# modified: static/index.html
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# nginx-dav-ext-module/

よし、これでpushする!

$ dotcloud push --all testgit
# upload /home/user/dcprojects/testgit ssh://dotcloud@uploader.dotcloud.com:443/testgit
# rsync
Pseudo-terminal will not be allocated because stdin is not a terminal.
building file list ... done
./
nginx/
nginx/builder
nginx/nginx.conf.in
static/
static/index.html
static/test.git/
static/test.git/HEAD
static/test.git/config
static/test.git/description
static/test.git/branches/
static/test.git/hooks/
static/test.git/hooks/applypatch-msg.sample
static/test.git/hooks/commit-msg.sample
static/test.git/hooks/post-commit.sample
static/test.git/hooks/post-receive.sample
static/test.git/hooks/post-update.sample
static/test.git/hooks/pre-applypatch.sample
static/test.git/hooks/pre-commit.sample
static/test.git/hooks/pre-rebase.sample
static/test.git/hooks/prepare-commit-msg.sample
static/test.git/hooks/update.sample
static/test.git/info/
static/test.git/info/exclude
static/test.git/objects/
static/test.git/objects/info/
static/test.git/objects/pack/
static/test.git/refs/
static/test.git/refs/heads/
static/test.git/refs/tags/

sent 9.01K bytes received 428 bytes 1.72K bytes/sec
total size is 42.39K speedup is 4.49
14:24:25 ---> Deploy of "testgit" scheduled for revision rsync-1338560664639 at 2012-06-01 14:24:25
14:24:26 ---> Building the application...
(省略)
14:24:51 [nginx.0] Deploying build revision rsync-1338560664639...
14:24:59 [nginx.0] Running postinstall script...
14:25:03 [nginx.0] Launching...
14:25:07 [nginx.0] Waiting for the instance to become responsive...
14:25:11 [nginx.0] Re-routing traffic to the new build...
14:25:11 [nginx.0] Successfully deployed build revision rsync-1338560664639
14:25:11 ---> Deploy finished
14:25:11 ---> Application fully deployed

Deployment finished. Your application is available at the following URLs
nginx: http://testgit-67yk2h4g.dotcloud.com/

さあレポジトリも一緒にデプロイされたし、別のディレクトリから試しに複製してみる。

$ git clone http://testgit-67yk2h4g.dotcloud.com/test.git
Cloning into test...
fatal: http://testgit-67yk2h4g.dotcloud.com/test.git/info/refs not found: did you run git update-server-info on the server?

あれ…なにこのエラー。

Git のリモートリポジトリから HTTP で pull するためのメモ(ref. akihiko’s tech note)

上によると、test.gitディレクトリの下で"git update-server-info"を実行しなければならないらしく(自動化するには、さらにhooks/post-updateを作成して更新が起こるたびに実行されるようにしなければならない)。とりあえず実行してtest.git/info/refsファイルが作成されたことを確認して再度git commit, dotcloud push testgitを実行。

$ git clone http://testgit-67yk2h4g.dotcloud.com/test.git
Cloning into test...
warning: You appear to have cloned an empty repository.
$ ls
test

おお、これでHTTP経由でgitのクローンが作れたぞ!あとはSSHで更新ができたりするようにすればいいんだと思う(多分、普通にdotcloud CLIでpushできてるから同じようにすればいいんだと勝手に思ってるけど、まだこれから試す)。

▲top

投稿者 ただ : 00:26 | トラックバック (0) カテゴリー ; プログラミングとか

2012年6月 3日

伊香保で浸かってうどんを食す

ただひたすら写真を並べて。行った先は群馬・伊香保温泉、大学(生協)時代の友人たちと。みっちぃさんが引越しとともに乗ってきたという車(ナンバープレートがかなり古い!)でまずは前橋で薔薇を見たりなんぞした後に、榛名山へ。榛名山に行く途中で、お昼ご飯を食べようということでここは水沢うどんのお店を選ぶ。御膳ものを注文するよりも、舞茸の天ぷらとうどんを別々で注文するほうがコスパいいんじゃないか?と注文してみたら、思いのほか舞茸が大きくて大きくてびっくりした。

初夏の榛名山は、つつじと八重桜が一緒に咲いていたちょっと不思議な空間やった。榛名山を臨む崖の上から湖を見下ろした後は、榛名神社へ。榛名神社は思いのほか岩がそのままになってたり、山の中にある本当に祀られている場所というような、そんな感じがする場所やった。いろんなものが祀られてたけど、何でトマトのある品種のF1の実が祀られてるのかは不思議やった。

そして夜は伊香保温泉へ。宿があるところの前の道から奥に入ったところに公衆浴場があるというので入ってきた。さて上がって宿に戻ろうか、というときに大雨が降り出してきた。天気が悪くなるっていう話やっけか。夕食は付いてなかったので食べにいくしかなかったんやけど、ここにきても雨が止まない!足元びしょびしょになりながら、台湾風料理の小さな居酒屋っぽいところでご飯食べた。卵焼きとか餃子とか、まぁ家庭料理っぽいけどおいしかった。

翌日は階段を改めて登り降りしたあと赤城山へ。赤城山なかなか涼しいというかちょっと天気がよくなくて寒いぐらい。いい感じの湖(沼)やった。ここでもなにやら名物のうどんがあるということで、忠治切込うどんというのを食べた。平麺で結構しっかりした歯ごたえ。具もたくさんあったしうまかった。

あとは、前橋に戻ってちょっとゆったりしたあと、都内に戻る。途中また雨に降られたりしたけども、石神井で車降りたときには雨降ってなかった。サッカーの時間帯で、サッカーを見ようと目論んで店を探したけれども、結局入った中華料理店ではサッカーの前半までしか料理がもたず(笑)。そのまま解散という流れになり電車で帰路についた。なかなか楽しい旅行やった。

ええ、なんか結果的に見ると1日目も2日目もうどん(2日目朝も宿で水沢うどんが出てきた)やったなぁ。

▲top

投稿者 ただ : 22:49 | トラックバック (0) カテゴリー ; お出かけ

2012年6月 5日

DotCloudをGit serverにしてみる(3)

そういえば、gitでWebDAVが使えるんやったらsshでコミットしなくてもhttpでコミットできるんやんな…と思った。git clone で作ったローカルのレポジトリディレクトリに移動して、ファイルを作ってコミットをするところを確認。

$ git status
# On branch master
#
# Initial commit
#
nothing to commit (create/copy files and use "git add" to track)
$ echo "This is the test file." > test.txt
$ git status
# On branch master
#
# Initial commit
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# test.txt
nothing added to commit but untracked files present (use "git add" to track)

うむ。ちゃんと変更されているファイルを認識している。ではコミットしてみるか。

$ git commit -m 'test.txt commit'
[master (root-commit) 2907ce7] test.txt commit
 Committer: pinmarch <pinmarch@localhost.localdomain>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:

    git config --global user.name "Your Name"
    git config --global user.email you@example.com

If the identity used for this commit is wrong, you can fix it with:

     git commit --amend --author='Your Name <you@example.com>'

 1 files changed, 1 insertions(+), 0 deletions(-)
 create mode 100644 test.txt

コミットはOK。ここまではローカルの話やからできて普通と思う。

で、それを今度はDotCloud上に作ってあるリモートレポジトリに上げる。設定を確認して、push。

$ git config --list
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
remote.origin.url=http://testgit-67yk2h4g.dotcloud.com/test.git
branch.master.remote=origin
branch.master.merge=refs/heads/master
$ git push origin master
error: Cannot access URL http://testgit-67yk2h4g.dotcloud.com/test.git/, return code 22
fatal: git-http-push failed

あれ…エラーでpushできない…。

$ dotcloud logs testgit.nginx
# tail -F /var/log/supervisor/*.log
==> /var/log/supervisor/nginx_access.log <==
192.168.0.1 (-) - - [01/Jun/2012:15:47:13 +0000] "-" 400 0 "-" "-"
0.115.5.72 (::ffff:22.6.15.44) - - [01/Jun/2012:15:47:33 +0000] "GET /test.git/info/refs?service=git-upload-pack HTTP/1.1" 200 0 "-" "git/1.7.3.4"
0.115.5.72 (::ffff:22.6.15.44) - - [01/Jun/2012:15:47:34 +0000] "GET /test.git/HEAD HTTP/1.1" 200 23 "-" "git/1.7.3.4"
0.79.7.178 (::ffff:22.6.15.44) - - [09/Jun/2012:03:51:28 +0000] "GET /test.git/info/refs?service=git-receive-pack HTTP/1.1" 200 0 "-" "git/1.7.3.4"
0.79.7.178 (::ffff:22.6.15.44) - - [09/Jun/2012:03:51:28 +0000] "GET /test.git/HEAD HTTP/1.1" 200 23 "-" "git/1.7.3.4"
0.115.5.72 (::ffff:22.6.15.44) - - [09/Jun/2012:03:53:35 +0000] "GET /test.git/info/refs?service=git-receive-pack HTTP/1.1" 200 0 "-" "git/1.7.3.4"
0.115.5.72 (::ffff:22.6.15.44) - - [09/Jun/2012:03:53:36 +0000] "GET /test.git/HEAD HTTP/1.1" 200 23 "-" "git/1.7.3.4"
0.127.7.84 (::ffff:22.6.15.44) - - [09/Jun/2012:04:14:13 +0000] "GET /test.git/info/refs?service=git-receive-pack HTTP/1.1" 200 0 "-" "git/1.7.3.4"
0.127.7.84 (::ffff:22.6.15.44) - - [09/Jun/2012:04:14:13 +0000] "GET /test.git/HEAD HTTP/1.1" 200 23 "-" "git/1.7.3.4"
0.79.7.178 (::ffff:22.6.15.44) - - [09/Jun/2012:04:14:14 +0000] "PROPFIND /test.git/ HTTP/1.1" 405 173 "-" "git/1.7.3.4"

PROPFINDで405が返ってくる。どういうことやろうか。DAVの設定(受け付けるメソッドのlocation)がおかしいのかと思ってちょっといじってみたりもしたけど、結果は変わらず。

gitのリモートレポジトリへのpushで動作がおかしい(405が出たりcode 22が返ってきてたり)という記事は検索してたらたいていGitHubの内容やったりするから結局SSHの設定に変えたらええやん、ということで終わってることが多くてどうにも目的の記事にありつけない。とりあえずOPTIONSのリクエストを投げてみるといいらしいってことでやってみたけど…。

$ telnet testgit-67yk2h4g.dotcloud.com 80
Trying 0.9.12.15...
Connected to testgit-67yk2h4g.dotcloud.com.
Escape character is '^]'.
OPTIONS /test.git/ HTTP/1.1
Host: testgit-67yk2h4g.dotcloud.com
Content-Length: 0

HTTP/1.1 405 Method Not Allowed
server: nginx/1.0.14
date: Sat, 09 Jun 2012 12:24:58 GMT
content-type: text/html
content-length: 173
connection: close

<html>
<head><title>405 Not Allowed</title></head>
<body bgcolor="white">
<center><h1>405 Not Allowed</h1></center>
<hr><center>nginx/1.0.14</center>
</body>
</html>
Connection closed by foreign host.

Not Allowed…?? どういうことや。設定をよくよく見直してみると、抜けているところがあった。create_full_put_path on; というのと、dav_access group:rw all:rw;というのがいるらしい。ということでnginx/nginx.conf.inを書き換えて、それからsshでDotCloudに入ってtest.gitディレクトリを含むの配下のファイルをchmod 777で権限変更。

それからもう1回pushしてみる…。

$ git push origin master
error: no DAV locking support on http://testgit-67yk2h4g.dotcloud.com/test.git/
fatal: git-http-push failed

あれぇ。

▲top

投稿者 ただ : 22:53 | トラックバック (0) カテゴリー ; プログラミングとか

2012年6月 6日

宇宙兄弟

公開されてからは結構経ったけど、ようやく。本当に月面を歩いたバズ・オルドリンが出てくるというのはアニメじゃできない実写版ならではよなぁと感動した。

▲top

投稿者 ただ : 23:56 | トラックバック (0) カテゴリー ; お出かけ

2012年6月10日

東京タワーを仰いで上り

東京タワー、東京には何回か来たことあったけどこれまで1回も入ったことなかったから行ってきたのです。スカイツリーができて人気があるとは言え、見学の予約が全然できないせいもあってか東京タワーも結構な人やった。

浜松町から出発して、増上寺へ行くルートをまずは通る。初夏の風が気持ちいい。本当なら夜までいたいけど残念ながら夕方から雨が降るという予報のため、夕方には帰らなければならないのが残念。

最初の1時間ぐらいはくまだすさんと2人で寺周辺をうろうろした後、もう1人と合流。昼ご飯を食べていざタワーに上る。なんかライブしてたけど人がいたようでいなかったよう。全然知らない人なんかきょとんとするわな、そりゃ。

タワーは、下の展望台と上の特別展望台両方行っといた。せっかく来たわけやしね。いやあ、テンションが高い子がいると結構楽しい。よかったよかった。

▲top

投稿者 ただ : 22:03 | トラックバック (0) カテゴリー ; お出かけ

2012年6月11日

映画ホタルノヒカリ

これもまたレイトショーで。もはや使ってるPASMOにチャージするために映画を観に行くみたいになってきてるけど気にしない。そういえばイッテQでこの撮影現場が映ってたなぁ。かなり前やったような記憶があるけど。ローマいいな。

残念な点があるとすれば、やはり手越くんの演技ががが・・・

▲top

投稿者 ただ : 23:36 | トラックバック (0) カテゴリー ; お出かけ

2012/05 | 2012/06 | 2012/07