#!/bin/bash

# maven-scm-publish-plugin feeds sh too many arguments, so we have to
# do this ourselves

site_dir=$1
tmp_dir=$2
version=$3

git clone git@github.com:wildfly-swarm/wildfly-swarm.git $tmp_dir
cd $tmp_dir
git checkout gh-pages
rsync -avz $site_dir/ $tmp_dir
git add $version
git commit -m "CI generated API documentation for $version"
git push origin gh-pages

#!/bin/bash

# maven-scm-publish-plugin feeds sh too many arguments, so we have to
# do this ourselves

site_dir=$1
tmp_dir=$2
version=$3

git clone git@github.com:wildfly-swarm/wildfly-swarm.git $tmp_dir
cd $tmp_dir
git checkout gh-pages
rsync -avz $site_dir/ $tmp_dir
git add $version

if grep -q $version _data/versions.yml; then
    echo "$version exists in _data/versions.yml"
else
    echo -e "\n- $version" >> _data/versions.yml
    git add _data/versions.yml
fi
 
git commit -m "CI generated API documentation for $version"
git push origin gh-pages

Add the version to versions.yml when building javadocs
Add the version to versions.yml when building javadocs [SWARM-10]

We use jekyll to build an index page for the javadocs, and it needs to
know the versions to link, so we add the currently built version to the
version list (if it isn't there already).
