Files
QuickShop-Reremake/site.sh
T
Ghost_chu 10ec1a6fb1 SNAPSHOT
Former-commit-id: 38314b1a6141e43a19ceddb65d652719075d6e46
2020-03-02 12:50:36 +08:00

33 lines
1.0 KiB
Bash

#!/bin/sh
basedir='C:\Users\Administrator\'
workdir=$(
cd $(dirname $0)
pwd
)
proj_id=$(mvn -q -N -Dexec.executable="echo" -Dexec.args='${project.artifactId}' org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
proj_version=$(mvn -q -N -Dexec.executable="echo" -Dexec.args='${project.version}' org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
repo_path=$basedir'akarin-repo/repository/'
(
if [ ! -d $basedir'akarin-repo' ]; then
echo '[Deploy] Synchronizing remote..'
cd $basedir
git clone 'https://github.com/Akarin-project/Akarin-repo.git'
echo '[Deploy] Synchronized remote!'
fi
echo '[Deploy] Deploy to local repository..'
cd $workdir && cd ..
mvn deploy -DaltDeploymentRepository=akarin-repo::default::file:$repo_path
echo '[Deploy] Deployed to local repository successfully'
cd $repo_path && cd ..
echo '[Deploy] Synchronizing remote..'
commit="git commit -m '[Deploy] Update "$proj_id" "$proj_version"'"
git pull && git add . && eval $commit && git push
echo '[Deploy] Deployed to Akarin-repo successfully!'
)