0
1

More than 5 years have passed since last update.

Git(lab)を絡めた開発環境の作成手順備忘録

Last updated at Posted at 2017-10-30

Gitlabでリモートリポジトリを作成する

'New Project'ボタンをクリックして、名前(ここでは"sample.git")を付けて'Create Project'

自分のPCからGitBashでリモートリポジトリの複製をローカルにつくる

方式は2つ

git bashで...
1. sampleフォルダに移動する
2. git clone [方式]

https方式
git clone https://gitlab.com/sample/sample.git

SSH方式
git clone git@gitlab.com:sample/sample.git

ローカルのsampleフォルダにソースを格納する

蛇足①(AWS絡みの備忘録)

AWS lambdaへの転送設定(本項とは関係ない)以下コマンドプロンプトで...
1. sampleフォルダに移動する
2. npm install --dev
3. aws configure

lambda-config.js
AWS Access Key ID:********************
AWS Secret Access Key:****************************************
Default region name:ap-northeast-1
Default output format:json

- PCにつき1度だけ実行すれば良い
- 'Access Key ID'と'Secret Access Key'はAWSのIAMからユーザの認証情報タブで生成する
- 日本は'ap-northeast-1'というregion nameになるらしい

蛇足②(AWS絡みの備忘録)

  1. AWSのIAMにロール(ここでは"lambda_exec_role")を作成する
  2. 作成したロールに対して'AWSLambdaExecute'の'ポリシーをアタッチ'する
  3. lambda-config.jsの内容をIAMの"アカウント番号"と"ロール名"に合わせて編集する
:lambda-config.js
exports.getDeployFile = function(filename){
  filename = filename.replace(/.js/,'');
  return {
    region: 'ap-northeast-1',
    handler: filename + '.handler',
    role: 'arn:aws:iam::************:role/lambda_exec_role',
    functionName: filename,
    timeout: 10,
    runtime: 'nodejs6.10'
  }
}
//'************'部分はAWSのAccount番号

git bashで...

  1. sampleフォルダに移動する
  2. git add .
  3. git commit -m "Add source code"
  4. git push

蛇足③(AWS絡みの備忘録)

AWS lambdaへの転送設定(本項とは関係ない)以下コマンドプロンプトで...
1. sampleフォルダに移動する
2. gulp deploy-lambda

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1