LoginSignup
0
0

More than 3 years have passed since last update.

【FolioLSP】チュートリアル④ローカルでの開発

Posted at

フロントエンドの開発

Stripes CLIを活用する。
詳しくは以下を参照。
- https://github.com/folio-org/stripes-cli

バックエンドの開発

ホストシステム上で稼働しているバックエンドモジュールサービスを、Vagrant VMで稼働しているOkapiシステムで利用できるようにすることができます。
※host-onlyのプライベートネットワークをVirtualBoxに設定し、VMのOkapiを再構成してX-Okapi-URLヘッダーとしてプライベートネットワークIPを利用できるようにする必要があります。

設定方法はこちら:「Running backend modules on your host system」(https://github.com/folio-org/folio-ansible/blob/master/doc/index.md#running-backend-modules-on-your-host-system)

モジュール依存関係グラフ

特定のモジュールの依存関係を決定する方法です。

何もインストールされていない状態で新しいテナントを作成し、確認したいモジュールのインストールをシミュレートして、インストールが必要な他のモジュールを表示します。

#!/usr/bin/env bash

# install a fresh tenant and show dependency graph

MODULE=${1:-"mod-inventory"}

TENANT="depgraph"

OKAPIURL="http://localhost:9130"
CMD_CURL="curl"
CURL="$CMD_CURL -w\n -D - "
PATH_TMP="/tmp/folio-depgraph"

H_TENANT="-HX-Okapi-Tenant:$TENANT"
H_JSON="-HContent-type:application/json"

echo "Pulling updated ModuleDescriptors from registry ..."
$CURL $H_JSON -X POST \
  -d '{ "urls": [ "http://folio-registry.aws.indexdata.com" ] }' \
  $OKAPIURL/_/proxy/pull/modules

echo
echo "Initialise the tenant '$TENANT' ..."
cat >$PATH_TMP-tenant.json << END
{
  "id" : "$TENANT",
  "name" : "Dependency grapher"
}
END
${CMD_CURL} -s -S $H_JSON -X POST \
  -d @$PATH_TMP-tenant.json \
  $OKAPIURL/_/proxy/tenants

echo
echo "Enable Okapi internal module for tenant '$TENANT' ..."
${CMD_CURL} -s -S $H_JSON -X POST \
  -d '{"id":"okapi"}' \
  $OKAPIURL/_/proxy/tenants/$TENANT/modules

echo
echo "Get dependency graph for '$MODULE' ..."
cat >$PATH_TMP-enable.json << END
[{"id":"$MODULE","action":"enable"}]
END
${CMD_CURL} -s -S $H_JSON -X POST \
  -d @$PATH_TMP-enable.json \
  "$OKAPIURL/_/proxy/tenants/$TENANT/install?simulate=true"
echo

参考

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