Last active
September 25, 2017 13:34
-
-
Save ruanjf/54a26b18ed00a837c2f5c9bcd2848223 to your computer and use it in GitHub Desktop.
git逐个文件夹,提取名称替换变量并提交
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 逐个文件夹,提取名称替换变量并提交 | |
for f in docker-*/; do | |
cd $f | |
echo '' | |
echo '' | |
echo $PWD | |
APP_PKG=`echo service-*.jar` | |
APP_NAME=`echo $APP_PKG | sed -E "s/(.+)-([0-9]+.*)\.jar/\1/g"` | |
APP_VERSION=`echo $APP_PKG | sed -E "s/(.+)-([0-9]+.*)\.jar/\2/g"` | |
cp Dockerfile_template Dockerfile | |
sed -i "s/\${APP_PKG}/${APP_PKG}/g" Dockerfile | |
sed -i "s/\${APP_NAME}/${APP_NAME}/g" Dockerfile | |
sed -i "s/\${APP_VERSION}/${APP_VERSION}/g" Dockerfile | |
git add . | |
git commit -am update | |
git push | |
cd .. | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment