2
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?

issg shoestringを githubから installする!リポジトリ branche指定可

Last updated at Posted at 2025-06-11

Install-Symbol-Shoestring-from Github
 
環境毎に shoestringのバージョンをインストール出来る
環境は $HOME/envsに格納する
githubの productのバージョンは $HOME/shoestring-gitに shoestring-[自分で設定する名前]として格納する
image.png
 
 
本家版/ccHarvestasya版の両方に対応
自動で日本語 messages.poをgithub.com/ccHarvestasya/product/raw/refs/heads/shoestring/japanese_lang_support_bootstrap_import/tools/shoestring/shoestring/lang/ja/LC_MESSAGES/messages.poからダウンロード、導入する
 
 
実行後の手順
①env名をenv[任意名]として設定する
②ディレクトリ名をshoestring-[任意名]として設定する
③brancheを入力 入力が無い場合は branch指定無しでダウンロードする
各brancheのshoestringのバージョンを使用する際には、
対応したenv環境を使用するのでenv名はbrancheと似た名前で設定する事が望ましい
本家版/ccHarvestasya版の切り替えは108/109行目にあるコメントアウトした行の切り替えにて行う

 
 

 
issgの動作には venvとライブラリのインストールが必要

venvのインストール

sudo apt update
version=$(python3 -V | sed 's/^P/p/; s/ //g' | sed 's/\.[^\.]*$//')
sudo apt install -y $version-venv

 
 
ライブラリのインストール

sudo apt-get install -y libssl-dev
sudo apt install -y build-essential python3-dev
sudo apt install -y gettext

 
 
nodeの実行には別途 dockerと docker-composeのインストールが必要
以下はインストールscript
一行ずつ実行でも可

#!/bin/bash
sudo curl https://get.docker.com | sh
sudo usermod -aG docker $USER
sudo systemctl start docker
sudo systemctl enable docker
docker -v
sudo curl -L https://github.com/docker/compose/releases/download/v2.29.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose -v
sudo systemctl restart docker
#
#以上の shoellscriptを実行後に
#sudo su
#sudo ユーザー名
#で権限が適用される
#

 
 
issg本体

#!/bin/bash
#
#issgの動作には venvと ライブラリの インストールが必要
#
#venvインストール
#sudo apt update
#version=$(python3 -V | sed 's/^P/p/; s/ //g' | sed 's/\.[^\.]*$//')
#sudo apt install -y $version-venv
#
#
#ライブラリのインストール
#sudo apt-get install -y libssl-dev
#sudo apt install -y build-essential python3-dev
#sudo apt install -y gettext
#
#
#実行方法
#chmod +x issg
#./issg
#
#
#実行後
#env名を入力
#shoestring-"の後に続く directory名を入力
#branche名を入力(入力が無い場合は branche無し)
#
#
#
#
#作成した nodeの動作には dockerと docker-composeが必要
#以下はインストールスクリプト
#!/bin/bash
#sudo curl https://get.docker.com | sh
#sudo usermod -aG docker $USER
#sudo systemctl start docker
#sudo systemctl enable docker
#docker -v
#sudo curl -L https://github.com/docker/compose/releases/download/v2.29.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
#sudo chmod +x /usr/local/bin/docker-compose
#docker-compose -v
#sudo systemctl restart docker
#
#ログアウトして再ログイン後に権限が適用される
#sudo su
#su ユーザ名
#以上の操作で権限が適用される
#
#
#

cd
mkdir ~/envs
cd ~/envs
echo $(pwd) && ls

echo -e '\e[41m'
echo '"env"の後に続く env名を入力して下さい' && read envName
echo -e '\e[0m'

if [ -d "env$envName" ]; then
  echo -e '\e[41m'
  echo $(pwd) && ls
  echo 'すでに同じ名前の "env'$envName'" があります'
  echo '作業を終了します'
  echo -e '\e[0m'
  exit 1
fi

python3 -m venv env$envName
source ~/envs/env$envName/bin/activate
echo -e '\e[41m'
echo $(pwd) && ls
echo '環境:~/envs/env'$envName' が作成されました'
echo -e '\e[0m'

cd && mkdir shoestring-git
cd shoestring-git
echo $(pwd) && ls
echo -e '\e[41m'
echo 'shoestring-"の後に続く directory名を入力して下さい' && read directoryName
echo -e '\e[0m'

if [ -d "shoestring-$directoryName" ]; then
  echo -e '\e[41m'
  echo $(pwd) && ls
  echo 'すでに同じ名前の "'shoestring-$directoryName'" があります'
  echo '今回の作業で作成された環境: ~/envs/env'$envName' を削除し 作業を終了します'
  echo -e '\e[0m'
  rm -rf ~/envs/env$envName
  exit 1
fi

mkdir shoestring-$directoryName
echo -e '\e[41m'
echo $(pwd) && ls
echo 'directory: ~/shoestring-git/shoestring-'$directoryName' が作成されました'

cd shoestring-$directoryName
echo 'branche名を入力して下さい ' && read brancheName
echo -e '\e[0m'

branche=' -b '$brancheName && echo $branche
if [ -z "$brancheName" ]; then
    branche=""
fi

#★ ★ ★ 本家/ccHarvestasyaの切り替えあり★ ★ ★
#githubUrl='https://github.com/symbol/product.git'
githubUrl='https://github.com/ccHarvestasya/product.git'


echo -e '\e[41m'
echo 'git clone '$githubUrl$branche' を実行します'
echo -e '\e[0m'

git clone $githubUrl$branche

echo -e '\e[41m'
echo $(pwd) && ls
echo '~/shoestring-git/shoestring-'$directoryName' に product branche: '$brancheName' がダウンロードされました'
echo -e '\e[0m'

pip install -e product/tools/shoestring
pip install -r product/tools/shoestring/requirements.txt


#強制日本語導入
cd product/tools/shoestring/shoestring/lang/ja/LC_MESSAGES
rm -f messages.po
wget https://github.com/ccHarvestasya/product/raw/refs/heads/shoestring/japanese_lang_support_bootstrap_import/tools/shoestring/shoestring/lang/ja/LC_MESSAGES/messages.po

msgfmt messages.po -o messages.mo
cd ../../en/LC_MESSAGES
msgfmt messages.po -o messages.mo

echo -e '\e[41m'
echo 'product branche: '$brancheName' がインストールされました'
echo '~/shoestring-git/shoestring-'$directoryName' の product branche: '$brancheName' を使用するには'
echo 'source ~/envs/env'$envName'/bin/activate'
echo 'と命令して下さい'

pip list|grep shoestring
echo -e '\e[0m'
2
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
2
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?