StartUp » 履歴 » バージョン 3

aoki yuji, 2015/12/30 13:42

1 1 aoki yuji
h1. StartUp
2 1 aoki yuji
3 2 aoki yuji
h2. GitBucket上での操作
4 2 aoki yuji
5 1 aoki yuji
gitBucketにアクセスし、ログインする(アカウント作成は宮崎さんに依頼する。Redmineと同じアカウントとパスが使えます)
6 1 aoki yuji
7 1 aoki yuji
<pre>https://git.fukurous.org/gitbucket/</pre>
8 1 aoki yuji
9 1 aoki yuji
好きなプロジェクトのURLを開きます。
10 1 aoki yuji
ここではひとまずウィスキー検定用のプロジェクトを例にして説明を続けます。
11 1 aoki yuji
12 1 aoki yuji
<pre>https://git.fukurous.org/gitbucket/g0947424/WhiskyExamination</pre>
13 1 aoki yuji
14 1 aoki yuji
「HTTP clone URL」からクローン用URLをコピーします。
15 1 aoki yuji
16 1 aoki yuji
<pre>https://git.fukurous.org/gitbucket/git/g0947424/WhiskyExamination.git</pre>
17 2 aoki yuji
18 2 aoki yuji
h2. ローカルでの準備
19 2 aoki yuji
20 2 aoki yuji
ローカル端末のホームディレクトリ上で.gitconfigファイルを作成し、以下の内容を記載します。
21 2 aoki yuji
22 2 aoki yuji
<pre>$ touch .gitconfig</pre>
23 2 aoki yuji
<pre>
24 2 aoki yuji
[http]
25 2 aoki yuji
        sslverify = false
26 2 aoki yuji
</pre>
27 2 aoki yuji
28 2 aoki yuji
時端末に開発用ディレクトリを切る
29 2 aoki yuji
オススメは~/fukurouとか
30 2 aoki yuji
31 2 aoki yuji
<pre>$ mkdir ~/fukurou</pre>
32 2 aoki yuji
33 2 aoki yuji
開発用ディレクトリに移動して、下記コマンドで資材をクローンする
34 2 aoki yuji
35 2 aoki yuji
<pre>
36 2 aoki yuji
$ cd ~/fukurou
37 2 aoki yuji
$ git clone 'https://git.fukurous.org/gitbucket/git/g0947424/WhiskyExamination.git'
38 2 aoki yuji
$ git clone 'https://git.fukurous.org/gitbucket/git/g0947424/WhiskyExamination.git'
39 2 aoki yuji
Cloning into 'WhiskyExamination'...
40 2 aoki yuji
remote: Counting objects: 103, done
41 2 aoki yuji
remote: Finding sources: 100% (103/103)
42 2 aoki yuji
remote: Getting sizes: 100% (18/18)
43 2 aoki yuji
remote: Total 103 (delta 57), reused 103 (delta 57)
44 2 aoki yuji
Receiving objects: 100% (103/103), 53.11 KiB, done.
45 2 aoki yuji
Resolving deltas: 100% (57/57), done.
46 2 aoki yuji
</pre>
47 2 aoki yuji
48 2 aoki yuji
====================================================
49 2 aoki yuji
ここまでが共通的なクローン作成手順です。WEProjectはサーバにソースをデプロイする用のシェルが入っているので、その設定をします。
50 2 aoki yuji
51 2 aoki yuji
h2. deploy.shの編集
52 2 aoki yuji
53 2 aoki yuji
<pre>$ open ~/fukurou/WhiskyExamination/deploy.sh</pre>
54 2 aoki yuji
55 2 aoki yuji
14行目以降のユーザ設定に自分のユーザネームを入力する(★のところ)
56 2 aoki yuji
57 2 aoki yuji
<pre>
58 2 aoki yuji
#---------------
59 2 aoki yuji
# User settings
60 2 aoki yuji
#---------------
61 2 aoki yuji
USER_NAME="★"
62 2 aoki yuji
</pre>
63 2 aoki yuji
64 2 aoki yuji
h2. deploy.shの動作確認
65 2 aoki yuji
66 2 aoki yuji
クローン直後はタイムスタンプが変わるので全資材がデプロイされます。
67 2 aoki yuji
68 2 aoki yuji
<pre>
69 2 aoki yuji
~/fukurou/WhiskyExamination $ ./deploy.sh 
70 2 aoki yuji
building file list ... done
71 2 aoki yuji
Question.php
72 2 aoki yuji
QuestionDB.php
73 2 aoki yuji
Questioner.php
74 2 aoki yuji
Questioner_stub.php
75 2 aoki yuji
index.php
76 2 aoki yuji
common/.DS_Store
77 2 aoki yuji
common/common.css
78 2 aoki yuji
common/common.js
79 2 aoki yuji
common/jquery-2.1.4.min.js
80 2 aoki yuji
screens/addQuestion.php
81 2 aoki yuji
screens/entrance.php
82 2 aoki yuji
screens/questionMaintenance.php
83 2 aoki yuji
screens/questionsList.php
84 2 aoki yuji
screens/singleQuestion.php
85 2 aoki yuji
86 2 aoki yuji
sent 3426 bytes  received 1612 bytes  347.45 bytes/sec
87 2 aoki yuji
total size is 143599  speedup is 28.50
88 2 aoki yuji
~/fukurou/WhiskyExamination $ 
89 2 aoki yuji
</pre>
90 2 aoki yuji
91 2 aoki yuji
h2. ウェブページを開いて動作確認する
92 2 aoki yuji
93 2 aoki yuji
以下のURLにアクセスして動作確認します。
94 2 aoki yuji
動作正常であればgitにコミットします。
95 2 aoki yuji
96 2 aoki yuji
<pre>http://www.fukurous.org/projects/hackathon20150504/WhiskyExamination/</pre>
97 2 aoki yuji
98 3 aoki yuji
h2. gitに add, commit, push する
99 3 aoki yuji
100 3 aoki yuji
まず、編集したファイルをaddする
101 3 aoki yuji
102 3 aoki yuji
<pre>
103 3 aoki yuji
~/fukurou/WhiskyExamination $ git add Questioner.php 
104 3 aoki yuji
~/fukurou/WhiskyExamination $ git add screens/addQuestion.php 
105 3 aoki yuji
</pre>
106 3 aoki yuji
107 3 aoki yuji
ローカル上でコミットする
108 3 aoki yuji
109 3 aoki yuji
<pre>
110 3 aoki yuji
~/fukurou/WhiskyExamination $ git commit -m "includeをinclude_onceに変更し、追加時のvar_dumpを削除"
111 3 aoki yuji
[master 9272174] includeをinclude_onceに変更し、追加時のvar_dumpを削除
112 3 aoki yuji
 Committer: Foo Bar <g0946029@MBPRDM.local>
113 3 aoki yuji
Your name and email address were configured automatically based
114 3 aoki yuji
on your username and hostname. Please check that they are accurate.
115 3 aoki yuji
You can suppress this message by setting them explicitly:
116 3 aoki yuji
117 3 aoki yuji
    git config --global user.name "Your Name"
118 3 aoki yuji
    git config --global user.email you@example.com
119 3 aoki yuji
120 3 aoki yuji
After doing this, you may fix the identity used for this commit with:
121 3 aoki yuji
122 3 aoki yuji
    git commit --amend --reset-author
123 3 aoki yuji
124 3 aoki yuji
 2 files changed, 3 insertions(+), 3 deletions(-)
125 3 aoki yuji
</pre>
126 3 aoki yuji
127 3 aoki yuji
gitサーバに反映する(push)
128 3 aoki yuji
129 3 aoki yuji
<pre>
130 3 aoki yuji
~/fukurou/WhiskyExamination $ git push origin master
131 3 aoki yuji
Username for 'https://git.fukurous.org': ★アカウントを入力★
132 3 aoki yuji
Password for 'https://g0946029@git.fukurous.org':  ★パスワードを入力★
133 3 aoki yuji
Counting objects: 9, done.
134 3 aoki yuji
Delta compression using up to 8 threads.
135 3 aoki yuji
Compressing objects: 100% (5/5), done.
136 3 aoki yuji
Writing objects: 100% (5/5), 539 bytes, done.
137 3 aoki yuji
Total 5 (delta 4), reused 0 (delta 0)
138 3 aoki yuji
remote: Resolving deltas: 100% (4/4)
139 3 aoki yuji
remote: Updating references: 100% (1/1)
140 3 aoki yuji
To https://git.fukurous.org/gitbucket/git/g0947424/WhiskyExamination.git
141 3 aoki yuji
   7a9d0cd..9272174  master -> master
142 3 aoki yuji
~/fukurou/WhiskyExamination $ 
143 3 aoki yuji
</pre>