-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cronjobs: expand script to run stand-alone (#1215)
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: * comment improvements * define USER env by id command (Docker compliant) * replace `~` with env var * do not clone repo within scripts * simplify instructions * compile_addons_git.sh: run 2 make jobs in parallel * accommodate for script path defined in grass-addons-index.sh * README.md: add intro to docker section; make it stand-alone Co-authored-by: Vaclav Petras <[email protected]>
- Loading branch information
1 parent
2070d84
commit fe58963
Showing
10 changed files
with
266 additions
and
185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/bin/sh | ||
|
||
# script to build GRASS GIS new current sources package from the main branch | ||
# script to build GRASS GIS new current sources package from the `release_branch_8_4` branch | ||
# (c) 2002-2024, GPL 2+ Markus Neteler <[email protected]> | ||
# | ||
# GRASS GIS github, https://github.com/OSGeo/grass | ||
|
@@ -10,19 +10,21 @@ | |
# - it updates locally the GRASS source code from github server | ||
# - packages the source code tarball | ||
# | ||
# Preparations, on server (neteler@grasslxd:$): | ||
# mkdir -p ~/src | ||
# cd ~/src | ||
# git clone https://github.com/OSGeo/grass.git release_branch_8_4 | ||
# To be executed on server (neteler@grasslxd:$) | ||
# - install dependencies: | ||
# cd $HOME/src/release_branch_8_4/ && git pull && sudo apt install $(cat .github/workflows/apt.txt) | ||
# - run this script | ||
# | ||
################################################################### | ||
# variables for packaging environment (grass.osgeo.org specific) | ||
MAINDIR=/home/neteler | ||
# variables for src packaging environment (grass.osgeo.org specific) | ||
USER=`id -u -n` | ||
MAINDIR=/home/$USER | ||
PATH=$MAINDIR/bin:/bin:/usr/bin:/usr/local/bin | ||
|
||
# https://github.com/OSGeo/grass/tags | ||
GMAJOR=8 | ||
GMINOR=4 | ||
BRANCH=releasebranch_${GMAJOR}_${GMINOR} | ||
GVERSION=$GMAJOR.$GMINOR.git | ||
DOTVERSION=$GMAJOR.$GMINOR | ||
GSHORTGVERSION=$GMAJOR$GMINOR | ||
|
@@ -33,7 +35,6 @@ set -e | |
################### | ||
# where to find the GRASS sources (git clone): | ||
SOURCE=$MAINDIR/src/ | ||
BRANCH=main | ||
# where to put the resulting .tar.gz file: | ||
TARGETMAIN=/var/www/code_and_data/ | ||
TARGETDIR=$TARGETMAIN/grass${GSHORTGVERSION}/source/snapshot | ||
|
@@ -56,10 +57,12 @@ halt_on_error() | |
# create a source code snapshot: | ||
CWD=`pwd` | ||
|
||
# setup source code repo | ||
mkdir -p $TARGETDIR | ||
cd $SOURCE/$BRANCH/ | ||
date | ||
|
||
# be sure to be on the right branch | ||
git checkout $BRANCH | ||
# clean up from previous run | ||
touch include/Make/Platform.make | ||
$MYMAKE distclean > /dev/null 2>&1 | ||
|
@@ -73,9 +76,6 @@ rm -f config_*.git_log.txt ChangeLog | |
# reset i18N POT files to git, just to be sure | ||
git checkout locale/templates/*.pot | ||
|
||
## hard reset local git repo (just in case) | ||
#git checkout main && git reset --hard HEAD~1 && git reset --hard origin | ||
|
||
echo "git update..." | ||
git fetch --all --prune || halt_on_error "git fetch error!" | ||
# we dont have upstream in this cronjob repo | ||
|
Oops, something went wrong.