-
Notifications
You must be signed in to change notification settings - Fork 152
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
cronjobs: expand script to run stand-alone #1215
base: grass8
Are you sure you want to change the base?
Conversation
With this PR instructions to set up the source code repo have been turned into executable script chunks. Hence, if the scripts are executed on a new server, the GitHub repo cloning is done as well as needed directories are created. Furthermore, some minor script tuning.
FYI: Installation of dependencies on grass.osgeo.org:
Due to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for looking into this. I didn't get far in a Docker container (just guessing what the setup needs to be):
docker run -it ubuntu bash
apt update
apt install git
git clone https://github.com/neteler/grass-addons.git
cd grass-addons/
git switch cron_standalone_scripts
cd ..
git clone https://github.com/OSGeo/grass
apt install $(cat grass/.github/workflows/apt.txt)
grass-addons/utils/cronjobs_osgeo_lxd/cron_grass_current_stable_build_binaries.sh
grass-addons/utils/cronjobs_osgeo_lxd/cron_grass_current_stable_build_binaries.sh: 141: cd: can't cd to /home//src//releasebranch_8_4/
Perhaps, you can try to get just one of these run in a Docker container and, if that still runs on the lxd server, you can then sync the other ones too.
# - Install PROJ incl Datum shift grids | ||
# - Install GDAL | ||
# - Install apt-get install texlive-latex-extra python3-sphinxcontrib.apidoc | ||
# - install further dependencies: | ||
# cd $HOME/src/releasebranch_8_4/ && git pull && sudo apt install $(cat .github/workflows/apt.txt) | ||
# - run this script | ||
# - one time only: cross-link code into web space on grasslxd server: | ||
# cd /var/www/html/ | ||
# ln -s /var/www/code_and_data/grass84 . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this relate to instructions in the comment in the PR? A single clear place is needed, maybe in readme, but here is good if it needs to be different for different scripts. (But is it?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is partially different due to the different versions.
I'll try to clean this up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do have different branches in the main repo and this is already using them, so perhaps that's one way how to make it different, yet same on the level of these scripts. In grass-addons we also have different branches, so other things can be resolved through that if needed, but that seems less applicable right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And instructions simplified in cbdf786
utils/cronjobs_osgeo_lxd/cron_grass_current_stable_build_binaries.sh
Outdated
Show resolved
Hide resolved
mkdir -p $SOURCE $TARGETDIR | ||
|
||
# fetch repo if needed | ||
cd "$SOURCE/" | ||
# Check if the repository is already cloned | ||
if [ -d "$BRANCH" ]; then | ||
echo "The GRASS GIS repository <$BRANCH> has already been cloned. Continuing..." | ||
else | ||
echo "Cloning the GRASS GIS repository <$BRANCH> first..." | ||
git clone https://github.com/OSGeo/grass.git $BRANCH | ||
if [ $? -eq 0 ]; then | ||
echo "Repository successfully cloned." | ||
else | ||
echo "Error: Failed to clone the repository." | ||
exit 1 | ||
fi | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand what this is here for. I already had to get grass and grass-addons repos just to get the script running. Maybe this is needed too, but that's not clear to me right now from the setup instructions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea was to automatically check out the code. Of course, a lot of lines for little gain, since this should be done beforehand. But then the script is no longer standalone.
Question: Is it safe to assume that the repo has already been cloned? If so, then I can happily shrink this part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My point is that the script and your existing instructions (apt and the /home/src dir) required to have the grass repo downloaded beforehand, so there is no point in downloading it in the script. (Unless your idea was to remove the requirement.) The current instructions look good, so that seems to me like removing the code here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. I have removed this part in 2477630
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be addressed in 250c4a8 I got this running:
|
Instructions added to |
@wenzeslaus any objections to merge this PR? |
With this PR instructions to set up the source code repo have been turned into executable script chunks. Hence, if the scripts are executed on a new server, the GitHub repo cloning is done as well as needed directories are created.
Furthermore, some minor script tuning.