#!/bin/bash # 执行命令 current_git_branch_latest_short_id=`git rev-parse --short HEAD` version=$(grep '"version"' package.json | sed -E 's/.*"version": "([^"]+)".*/\1/') project_name=$(grep '"name"' package.json | sed -E 's/.*"name": "([^"]+)".*/\1/') # docker_name="$project_name:$version-$current_git_branch_latest_short_id" docker_name="new_cash_book_node:$version-$current_git_branch_latest_short_id" save_file_name="new_cash_book_node_$version-$current_git_branch_latest_short_id.tar" # 执行命令 cd ./frontEndMobile yarn install --registry=https://registry.npmmirror.com && npm run build rm -rf ../node_expores/public cp -rf ./dist ../node_expores/public cd ../node_expores yarn install --registry=https://registry.npmmirror.com docker build -t $docker_name . cd ../ docker save -o ./$save_file_name $docker_name