Created
June 24, 2016 11:53
-
-
Save yamamoto-febc/f97bf66fcef92094b07e59cd3e050207 to your computer and use it in GitHub Desktop.
[Build/Ship/Run] arukas-shipでプルリク駆動デリバリー ref: http://qiita.com/yamamoto-febc/items/135344bee0d2d5edf412
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# このディレクトリのファイルを元にDockerイメージ作成、testというタグをつけておく | |
$ docker build -t test . | |
# ビルドしたコンテナを実行、80番ポートを開ける | |
$ docker run -d -p 80:80 test | |
# 動作確認 | |
$ open "http://localhost/index.php" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ApacheベースのPHPコンテナを利用 | |
FROM php:apache | |
# contentsディレクトリ配下をドキュメントルートへ配置 | |
ADD contents/ /var/www/html/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ vi Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[控えておいたEndpointのURL]?token=[SHIP_TOKENに設定した文字列]&app=[任意のアプリケーション名] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 作業用ディレクトリ作成 | |
$ mkdir arukas-ship-demo | |
$ cd arukas-ship-demo | |
# 以下先ほどGitHub上に表示されていたコマンドをコピペ | |
$ echo "# arukas-ship-demo" >> README.md | |
$ git init | |
$ git add README.md | |
$ git commit -m "first commit" | |
$ git remote add origin git@github.com:yamamoto-febc/arukas-ship-demo.git | |
$ git push -u origin master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git add . | |
$ git commit -m"デモ用Webアプリ作成" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
date_default_timezone_set('Asia/Tokyo'); | |
echo "arukas-ship/Demo" . "<br />"; | |
echo $_SERVER['SERVER_ADDR'] . "<br />"; | |
echo date("Y/m/d H:i:s"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ mkdir contents | |
$ cat <<-'EOF' > contents/index.php | |
<?php | |
date_default_timezone_set('Asia/Tokyo'); | |
echo "arukas-ship/Demo" . "<br />"; | |
echo $_SERVER['SERVER_ADDR'] . "<br />"; | |
echo date("Y/m/d H:i:s"); | |
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git push origin ship_demo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git checkout -b ship_demo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment