Skip to content

Commit

Permalink
fixed deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
maybeec committed Sep 26, 2021
1 parent eefd892 commit 246de09
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
30 changes: 18 additions & 12 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,19 +121,25 @@ function doRunCommand() {
# check preconditions
if [ "$DEPLOY_UPDATESITE" = "stable" ] && [ -d "../gh-pages" ]
then
cd ../gh-pages
CHANGE_LIST=$(git diff --shortstat && git status --porcelain)
if [ ! -z "$CHANGE_LIST" ]
then
echo "../gh-pages is not clean"
doAskQuestion "Should I cleanup?" # will exit if no
doRunCommand "git reset --hard HEAD"
doRunCommand "git clean -xf"
doRunCommand "git pull"
fi
cd "$SCRIPT_PATH"
cd ../gh-pages
if [[ $(git diff --shortstat && git status --porcelain) ]]
then
echo "../gh-pages is prepared"
else
echo "../gh-pages is not clean"
doAskQuestion "Should I cleanup?" # will exit if no
doRunCommand "git reset --hard HEAD"
doRunCommand "git clean -xf"
doRunCommand "git pull"
fi
cd "$SCRIPT_PATH"
else
echo "Not detected cloned gh-pages branch in ../gh-pages folder."
echo "Not detected cloned gh-pages branch in ../gh-pages folder."
ORIGIN="$(git config --get remote.origin.url)"
case "$ORIGIN" in
*devonfw/cobigen*) doAskQuestion "Should I clone gh-pages from $ORIGIN" && echo "Cloning from $ORIGIN into ../gh-pages ..." && git clone --branch gh-pages $ORIGIN ../gh-pages ;;
*) echo "You are working on a fork, please make sure, you are releasing from devonfw/cobigen#master" && exit 1 ;;
esac
fi

log_step() {
Expand Down
10 changes: 6 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,9 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.0.1</version>
<!-- version errors on win with "no pinentry" -->
<!-- <version>3.0.1</version> -->
<version>1.6</version>
<configuration>
<keyname>${gpg.keyname}</keyname>
</configuration>
Expand Down Expand Up @@ -614,20 +616,20 @@

<distributionManagement>
<repository>
<id>sonartype.releases</id>
<id>ossrh</id>
<name>Sonartype Releases</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
<snapshotRepository>
<id>sonartype.snapshots</id>
<id>ossrh</id>
<name>Sonartype Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
</distributionManagement>

<repositories>
<repository>
<id>sonartype.snapshots</id>
<id>ossrh</id>
<name>OSSRH Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<snapshots>
Expand Down

0 comments on commit 246de09

Please sign in to comment.