mirror of
https://git.gfz-potsdam.de/naaice/iphreeqc.git
synced 2025-12-15 16:18:22 +01:00
updated build script versioning
This commit is contained in:
parent
549d2625b2
commit
7758af6646
@ -1,27 +1,44 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
#
|
||||||
# set DATE
|
# set DATE
|
||||||
|
#
|
||||||
if [ -z "$DATE" ]; then
|
if [ -z "$DATE" ]; then
|
||||||
DATE=$(date "+%x")
|
DATE=$(date "+%x")
|
||||||
fi
|
fi
|
||||||
DATE=$(date -d $DATE "+%Y-%m-%d")
|
DATE=$(date -d $DATE "+%Y-%m-%d")
|
||||||
|
|
||||||
|
#
|
||||||
# set VER
|
# set VER
|
||||||
|
#
|
||||||
if [ -z "$VER" ]; then
|
if [ -z "$VER" ]; then
|
||||||
wget https://cran.r-project.org/package=phreeqc -O index.xhtml 2> /dev/null
|
###wget https://cran.r-project.org/package=phreeqc -O index.xhtml 2> /dev/null
|
||||||
VER=`xmlstarlet sel -t -m "/_:html/_:body/_:table[1]/_:tr[1]/_:td[2]" -v . -n index.xhtml 2> /dev/null`
|
###VER=`xmlstarlet sel -t -m "/_:html/_:body/_:table[1]/_:tr[1]/_:td[2]" -v . -n index.xhtml 2> /dev/null`
|
||||||
ver_major=`echo $VER | cut -d '.' -f 1`
|
VER=$(curl https://raw.githubusercontent.com/usgs-coupled/phreeqc-version/main/phreeqc-version.txt)
|
||||||
ver_minor=`echo $VER | cut -d '.' -f 2`
|
ver_major=$(echo "$VER" | cut -d '.' -f 1)
|
||||||
ver_patch=`echo $VER | cut -d '.' -f 3`
|
ver_minor=$(echo "$VER" | cut -d '.' -f 2)
|
||||||
|
ver_patch=$(echo "$VER" | cut -d '.' -f 3)
|
||||||
ver_patch=$((ver_patch+1))
|
ver_patch=$((ver_patch+1))
|
||||||
VER="${ver_major}.${ver_minor}.${ver_patch}"
|
else
|
||||||
|
ver_major=$(echo "$VER" | cut -d '.' -f 1)
|
||||||
|
ver_minor=$(echo "$VER" | cut -d '.' -f 2)
|
||||||
|
ver_patch=$(echo "$VER" | cut -d '.' -f 3)
|
||||||
fi
|
fi
|
||||||
if [ "$REL" = 'HEAD' ]; then
|
if [ -z "$ver_major" ] || [ -z "$ver_minor" ] || [ -z "$ver_patch" ]; then
|
||||||
HEAD=13021
|
exit 1
|
||||||
|
fi
|
||||||
|
VER="${ver_major}.${ver_minor}.${ver_patch}"
|
||||||
|
export VER
|
||||||
|
|
||||||
|
#
|
||||||
|
# set REL
|
||||||
|
#
|
||||||
|
curl https://raw.githubusercontent.com/usgs-coupled/phreeqc-version/main/ver.py -o ver.py
|
||||||
|
HEAD=$(python ver.py)
|
||||||
|
if [ -z "$REL" ]; then
|
||||||
REL="$HEAD"
|
REL="$HEAD"
|
||||||
fi
|
fi
|
||||||
if [ -z "$REL" ]; then
|
|
||||||
REL=13021
|
|
||||||
fi
|
|
||||||
export VER
|
|
||||||
# sed files
|
# sed files
|
||||||
/bin/sh jenkins-dist.sh -v ${VER} -r ${REL} -d ${DATE} -pr ${TAG}
|
/bin/sh jenkins-dist.sh -v ${VER} -r ${REL} -d ${DATE} -pr ${TAG}
|
||||||
cd R
|
cd R
|
||||||
|
|||||||
@ -4,12 +4,18 @@
|
|||||||
# Sysinternals. The -UseBasicParsing flag may also be required.
|
# Sysinternals. The -UseBasicParsing flag may also be required.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
#
|
||||||
# set DATE
|
# set DATE
|
||||||
|
#
|
||||||
if ([string]::IsNullOrEmpty($Env:DATE)) {
|
if ([string]::IsNullOrEmpty($Env:DATE)) {
|
||||||
$Env:DATE = date +%x
|
$Env:DATE = date +%x
|
||||||
}
|
}
|
||||||
|
$Env:DATE = date -d $Env:DATE +%x
|
||||||
$Env:RELEASE_DATE = date -d $Env:DATE "+%B %e, %G"
|
$Env:RELEASE_DATE = date -d $Env:DATE "+%B %e, %G"
|
||||||
|
|
||||||
|
#
|
||||||
# set VER
|
# set VER
|
||||||
|
#
|
||||||
if ([string]::IsNullOrEmpty($Env:VER)) {
|
if ([string]::IsNullOrEmpty($Env:VER)) {
|
||||||
$request = Invoke-WebRequest https://raw.githubusercontent.com/usgs-coupled/phreeqc-version/main/phreeqc-version.txt -UseBasicParsing
|
$request = Invoke-WebRequest https://raw.githubusercontent.com/usgs-coupled/phreeqc-version/main/phreeqc-version.txt -UseBasicParsing
|
||||||
$v = ($request.Content) -split "\."
|
$v = ($request.Content) -split "\."
|
||||||
@ -22,13 +28,28 @@ if ([string]::IsNullOrEmpty($Env:VER)) {
|
|||||||
$Env:ver_patch = $v[2]
|
$Env:ver_patch = $v[2]
|
||||||
$Env:VER = $v -join "."
|
$Env:VER = $v -join "."
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
$v = ($Env:VER) -split "\."
|
||||||
|
$Env:ver_major = $v[0]
|
||||||
|
$Env:ver_minor = $v[1]
|
||||||
|
$Env:ver_patch = $v[2]
|
||||||
|
}
|
||||||
|
if ([string]::IsNullOrEmpty($v[0]) -or [string]::IsNullOrEmpty($v[1]) -or [string]::IsNullOrEmpty($v[2])) {
|
||||||
|
throw "Bad VER"
|
||||||
|
}
|
||||||
|
|
||||||
|
#
|
||||||
# set REL
|
# set REL
|
||||||
|
#
|
||||||
Invoke-WebRequest https://raw.githubusercontent.com/usgs-coupled/phreeqc-version/main/ver.py -OutFile ver.py -UseBasicParsing
|
Invoke-WebRequest https://raw.githubusercontent.com/usgs-coupled/phreeqc-version/main/ver.py -OutFile ver.py -UseBasicParsing
|
||||||
$HEAD=$(python ver.py)
|
$HEAD=$(python ver.py)
|
||||||
if ([string]::IsNullOrEmpty($Env:REL)) {
|
if ([string]::IsNullOrEmpty($Env:REL)) {
|
||||||
$Env:REL = $HEAD
|
$Env:REL = $HEAD
|
||||||
}
|
}
|
||||||
# duplicate build/dist.sh
|
|
||||||
|
#
|
||||||
|
# replace strings
|
||||||
|
#
|
||||||
$sed_files=@('phreeqc3-doc/RELEASE.TXT', `
|
$sed_files=@('phreeqc3-doc/RELEASE.TXT', `
|
||||||
'src/Version.h', `
|
'src/Version.h', `
|
||||||
'src/IPhreeqc.h')
|
'src/IPhreeqc.h')
|
||||||
@ -45,13 +66,18 @@ foreach ($file in $sed_files) {
|
|||||||
} | Set-Content $file
|
} | Set-Content $file
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#
|
||||||
# doxygen
|
# doxygen
|
||||||
cd doc
|
#
|
||||||
|
Set-Location doc
|
||||||
doxygen
|
doxygen
|
||||||
|
|
||||||
|
#
|
||||||
# hhc seems to return 1 on success and 0 (zero) on failure
|
# hhc seems to return 1 on success and 0 (zero) on failure
|
||||||
# see https://stackoverflow.com/questions/39012558/html-help-workshop-returns-error-after-successfully-compiled-chm-file
|
# see https://stackoverflow.com/questions/39012558/html-help-workshop-returns-error-after-successfully-compiled-chm-file
|
||||||
|
#
|
||||||
hhc IPhreeqc.hhp
|
hhc IPhreeqc.hhp
|
||||||
if (-Not $?) {
|
if (-Not $?) {
|
||||||
$LastExitCode = 0
|
$LastExitCode = 0
|
||||||
}
|
}
|
||||||
cd ..
|
Set-Location ..
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user