Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add update script for rstan submodule #37

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions jenkins/create-rstan-pull-request.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#!/bin/bash

trap 'abort' 0

set -e

git checkout develop
git pull origin
git submodule update --init --recursive
pushd StanHeaders/inst/include/upstream > /dev/null
git checkout develop
git pull origin
popd > /dev/null
git submodule update --init --recursive

original_commit_hash=$(cd StanHeaders/inst/include/upstream && git rev-parse --short HEAD)
stan_commit_hash=$(cd StanHeaders/inst/include/upstream && git rev-parse --short origin/develop)


if [ "$original_commit_hash" == "$stan_commit_hash" ]; then
echo "------------------------------------------------------------"
echo ""
echo " No need to update. "
echo " Submodule at: ${original_commit_hash}."
echo " Update to: ${stan_commit_hash}."
echo ""
echo "------------------------------------------------------------"
echo ""
trap : 0
exit 0
fi

pushd StanHeaders/inst/include/upstream > /dev/null
git checkout ${stan_commit_hash}
popd > /dev/null
git add StanHeaders/inst/include/upstream
git commit -m "Updates the Stan submodule to ${stan_commit_hash}." stan
git push origin develop

trap : 0

echo "------------------------------------------------------------"
echo ""
echo " Success updating stan submodule to ${stan_commit_hash}"
echo ""
echo "------------------------------------------------------------"
echo ""

exit 0