Cloud Source Repositoriesを使ってみた
概要
- GCP勉強中。今回はCloud Source Repositoriesを触った
前提
- 基本的にこちらの記事に則って手を動かしています
- 記事が書かれた頃に存在していた「Developers」が今はなくなっており、「Cloud Source Repositories」に変わっていたのでメモ
作業手順
- 既存の内容を外からコピー
$ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git $ cp -rf appengine/standard/flask/hello_world hello_world $ cd hello_world $ git init . $ git add . $ git commit -m “Initial Commit”
ここまで記事のまま
- 「Developers」の代わりにCloud Shell Repositoriesのリファレンスをもとに作業
cd [REPO_DIRECTORY] git config --global credential.'https://source.developers.google.com'.helper gcloud.sh gcloud source repos create [CLOUD_SOURCE_REPOSITORY_NAME] git remote add google \ https://source.developers.google.com/p/[PROJECT_ID]/r/[CLOUD_SOURCE_REPOSITORY_NAME]
あたりの作業を進める
- GCPとローカルが行き来できるようになったので、手元のGitをPush
git push --all google
- ブラウザ上、GCPホーム画面左側のメニューにある「Source Repositories」を選択
- GitっぽいアイコンのSource Repositoriesタブが新しく開き、その中でSourceが確認できる
メモ
- 途中からリファレンスに頼ってしまったけど、ブラウザからある程度操作ができたのかも??