ここでデプロイスキームを完成させて空白を描画します。この質問を投稿した後:VCSがまったくない本番サイトをGitに移行すると、ローカルリポジトリにデプロイする要点がわかります。
私のローカル開発サーバーには、プッシュできるgit-flowリポジトリがあり、外部ワークツリーを更新します。
リポジトリをgit-flowで設定しましたが、オリジンリモートは次のようになります。
$ git remote show origin
* remote origin
Fetch URL: ssh://user@host/var/git/dev/repo.git
Push URL: ssh://user@host/var/git/dev/repo.git
HEAD branch (remote HEAD is ambiguous, may be one of the following):
develop
master
Remote branches:
develop tracked
master tracked
Local branch configured for 'git pull':
master merges with remote master
Local refs configured for 'git push':
develop pushes to develop (up to date)
master pushes to master (up to date)
私がやろうとしたのは、2つの疑似環境を設定することでした。1つはステージング用で、もう1つは本番用です。私はそれらを次のように動作させたいです:
git push staging #pushes to remote staging repo with a post-receive hook "git checkout develop -f"
git push production #pushes to remote production repo with a post-receive hook "git checkout master -f"
このようにして、ローカルで開発し、小さな内部開発サーバーにプッシュして、すべての履歴を取得できます。次に、ステージング/本番環境が明確になったら、適切なブランチをプッシュします。
開発サーバーで行ったように(投稿の冒頭にある私のリンクを参照)、個別の作業ツリーを使用してベアリポジトリを作成しようとしました。
git push staging develop
git push production master
そして、ここにそれぞれリモートがあります:
$ git remote show staging
* remote staging
Fetch URL: ssh://user@host/var/git/dev/staging.git
Push URL: ssh://user@host/var/git/dev/staging.git
HEAD branch: develop
Remote branch:
develop tracked
Local ref configured for 'git push':
develop pushes to develop (up to date)
$ git remote show production
* remote produdction
Fetch URL: ssh://user@host/var/git/dev/production.git
Push URL: ssh://user@host/var/git/dev/production.git
HEAD branch: master
Remote branch:
master tracked
Local ref configured for 'git push':
master pushes to master (up to date)
したがって、理論的には、内部でgit-flowを使用し、開発ブランチを追跡して、他の部門が表示/QAできるようにプッシュすることができます。次に、内部でリリースを実行し、変更をステージングにプッシュしてから、マスターブランチを本番環境にプッシュするだけです。
私の質問は-私はこれを正しい方法で行っているのだろうか?gitとgit-flowに関しては、私は真の初心者です。私は利用可能なすべてのリソースを精査しましたが、これは私がこれまでに思いついた中で最高のものです。
多段階展開でgit-flowを使用している人々からの洞察をいただければ幸いです。