0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Puppet Pipelines for ApplicationsでNode.jsサンプルアプリケーションをBuildしてGCEにDeployしてみる

Last updated at Posted at 2019-02-21

Node.jsのサンプルアプリケーションをPuppet Pipelines for ApplicationsでBuild/Deployしてみました。この記事はこちらの原文を参照して作成しています。

前提

  • GitHubのアカウントを持っている
  • PCにgitがインストールされていてgit add, commit, push等基本的な操作を習得している
  • AWS, Azure, GCP等のクラウドプラットフォームを利用できる

準備

Puppet社のSEチームが管理しているNode.jsのサンプルアプリケーションをForkします。

手順

Build

Puppet Pipelines for ApplicationsにChromeでアクセスしてCreate a free accountをクリックしてアカウントを作成します。

GitHubにログインしてPFA_MyApp/distelli-manifest.ymlの1行目をPipelinesのUsernameに書き換えてCommitします。

PipelinesにログインしてNewAppをクリックします。

①〜③でGitHubのリポジトリ・ブランチを設定して④でAdvanced use?xxxチェックボックスを選択してNext Stepを押します。

⑤でAuto Buildチェックボックスを選択して Looks good. Start Build!を押します。

下記の画面が表示されればBuildが正常に開始しています。Go to Buildsを押してBuildの状況を見てみます。

Buildの下にSuccessが表示されて上にReleaseパックができていればBuildは成功です。

Deploy

BuildしたReleaseパックをDeployするサーバ環境を設定します。この記事ではGoogle Compute Engine上にインストールしたCentOS 7を利用しています。Environmentsをクリック、右側の+Create Environmentをクリックします。

Environment Nameに分かりやすい名前を入力してCreateを押します。ここでは開発環境を想定してdevelopmentとしています。

開発環境に紐付けるサーバを設定します。トップバーのServersをクリック、Add Serverを押します。

Add Existing Serverを押してPipelinesのAgentインストール手順に従いAgentをインストールします。インストール完了後、サーバを選択してAdd Environmentsを押します。

$ curl -sSL https://pipelines.puppet.com/download/client | sh
$ sudo /usr/local/bin/distelli agent install
Distelli Email: hisashi.yamaguchi@puppet.com
      Password:

右上のロケットマーク(Deploy Application)をクリック、Environment, Releaseを選択してDeploy Releaseを押します。

緑色の画面が表示されれば成功です。

Chromeでhttp://:3000にアクセスします。Hello Tokyo from Puppet Pipelines. Your Node.js application is working!が表示されれば成功です。

おわりに

この記事ではマニュアルでサンプルアプリケーションをBuild/Deployしていますが、自動的に複数環境にデリバリーするパイプラインを作成することも可能です。追ってご紹介します。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?