0
0

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.

Nomad インストール (->Linux)

Last updated at Posted at 2019-09-05

インストール手順

Installing Nomad - Nomad by HashiCorp

1. 圧縮ファイルをダウンロード

Download Nomad - Nomad by HashiCorp

2. 圧縮ファイルを解凍する

unzip nomad_0.9.5_linux_amd64.zip

3. nomadバイナリファイルをコマンド呼び出し可能なディレクトリへ移す

sudo install nomad /usr/local/bin

Linux 64bit用ダウンロード/インストールスクリプト

引数無し、実行するだけです。
Linux 64bit以外の環境でNomadをインストールしたいなら、手動でやる方が速いです。

# !/bin/sh

###########################################################
# Linux 64bit用
# Nomadバイナリファイルダウンロード/インストールスクリプト
###########################################################

# 以下の変数は適宜変更してください
VERSION="0.9.5"            # Nomadバージョン
DEST_DIR="/usr/local/bin"  # nomadコマンドインストール先ディレクトリパス

ZIP_FILE_NAME="nomad_${VERSION}_linux_amd64.zip"

# 本スクリプト中で使う、インストールされていない可能性があるコマンド群
COMMAND_LIST=`cat <<EOF
curl
unzip
EOF
`

# ダウンロード前のコマンド存在チェック
for USING_COMMAND in $COMMAND_LIST
do
  if ! command -v $USING_COMMAND 1> /dev/null ; then
    echo "Please install [$USING_COMMAND] command."
    exit 1
  fi
done

# Nomadのバイナリ圧縮ファイルをダウンロード
curl -LO https://releases.hashicorp.com/nomad/${VERSION}/${ZIP_FILE_NAME}

# ダウンロードしたNomadの圧縮ファイルを解凍する
unzip ${ZIP_FILE_NAME}
ls -lt ./nomad*

# ホスト共通の実行可能ディレクトリへNomadバイナリを移動する
sudo install nomad ${DEST_DIR}
if [ "$?" -ne 0 ] ; then
  echo "Failed installing nomad to ${DEST_DIR}"
  exit 2
fi

# nomadコマンドが実行可能であるか確認する
if command -v nomad ; then
  echo "Success installing nomad"
else
  echo "Failed installing nomad"
  exit 3
fi
0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?