Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Features: - Added support to allow Day Of Month and Day Of Week parts of the cron expressions to both be enforced - Additional parsing of the cron schedules, better logging when incorrect expression provided
- Loading branch information
1 parent
64027b0
commit 96125b9
Showing
6 changed files
with
211 additions
and
49 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,35 @@ | ||
{ | ||
"APIKey": "API Key goes here", | ||
"InstanceID": "Instance name goes here", | ||
"Schedule": [ | ||
{ | ||
"Enabled":true, | ||
"CronSchedule":"0 0 9 * * 1-6", | ||
"ScheduleFrom":"", | ||
"ScheduleTo":"", | ||
"Service":"", | ||
"API":"", | ||
"APIParams":{ | ||
"0": | ||
{ | ||
"Type":"Content", | ||
"Parameter":"paramName", | ||
"Content":"parameter content" | ||
}, | ||
"1": | ||
{ | ||
"Type":"Open", | ||
"Parameter":"complexParamName", | ||
"Content":"" | ||
}, | ||
"2": | ||
{ | ||
"Type":"Content", | ||
"Parameter":"paramName", | ||
"Content":"parameter content" | ||
}, | ||
"3": | ||
{ | ||
"Type":"Close", | ||
"Parameter":"complexParamName", | ||
"Content":"" | ||
} | ||
"APIKey": "apikeygoeshere", | ||
"InstanceID": "instanceIDgoeshere", | ||
"Schedule": [{ | ||
"Enabled": true, | ||
"CronSchedule": "0 1 23 * * 1-6", | ||
"DayOfMonthANDDayOfWeek":false, | ||
"ScheduleFrom": "", | ||
"ScheduleTo": "", | ||
"Service": "", | ||
"API": "", | ||
"APIParams": { | ||
"0": { | ||
"Type": "Content", | ||
"Parameter": "paramName", | ||
"Content": "parameter content" | ||
}, | ||
"1": { | ||
"Type": "Open", | ||
"Parameter": "complexParamName", | ||
"Content": "" | ||
}, | ||
"2": { | ||
"Type": "Content", | ||
"Parameter": "paramName", | ||
"Content": "parameter content" | ||
}, | ||
"3": { | ||
"Type": "Close", | ||
"Parameter": "complexParamName", | ||
"Content": "" | ||
} | ||
} | ||
] | ||
} | ||
}] | ||
} |
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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#!/bin/bash | ||
# Orignal https://gist.github.com/jmervine/7d3f455e923cf2ac3c9e | ||
# usage: ./golang-crosscompile-build.bash | ||
|
||
#Get current working directory | ||
currentdir=`pwd` | ||
|
||
#Clear Sceeen | ||
printf "\033c" | ||
|
||
# Get Version out of target then replace . with _ | ||
versiond=$(go run *.go -version) | ||
version=${versiond//./_} | ||
#Remove White Space | ||
version=${version// /} | ||
versiond=${versiond// /} | ||
#platforms="darwin/386 darwin/amd64 freebsd/386 freebsd/amd64 freebsd/arm linux/386 linux/amd64 linux/arm windows/386 windows/amd64" | ||
platforms="windows/386 windows/amd64 linux/386 linux/amd64 linux/arm darwin/386 darwin/amd64" | ||
printf " ---- Building API Scheduler $versiond ---- \n" | ||
printf "\n" | ||
for platform in ${platforms} | ||
do | ||
split=(${platform//\// }) | ||
goos=${split[0]} | ||
os=${split[0]} | ||
goarch=${split[1]} | ||
arch=${split[1]} | ||
output=goAPIScheduler | ||
package=goAPIScheduler | ||
# add exe to windows output | ||
[[ "windows" == "$goos" ]] && output="$output.exe" | ||
[[ "windows" == "$goos" ]] && os="win" | ||
[[ "386" == "$goarch" ]] && arch="x86" | ||
[[ "amd64" == "$goarch" ]] && arch="x64" | ||
|
||
printf "Platform: $goos - $goarch \n" | ||
|
||
destination="builds/$goos/$goarch/$output" | ||
|
||
printf "Go Build\n" | ||
GOOS=$goos GOARCH=$goarch go build -o $destination | ||
# $target | ||
|
||
printf "Copy Source Files\n" | ||
#Copy Source to Build Dir | ||
cp *.md "builds/$goos/$goarch/" | ||
cp conf*.json "builds/$goos/$goarch/" | ||
|
||
printf "Build Zip \n" | ||
cd "builds/$goos/$goarch/" | ||
if [ $os == "darwin" ]; then | ||
os="osx" | ||
fi | ||
zip -r "${package}_${os}_${arch}_v${version}.zip" $output *.md conf*.json > /dev/null | ||
cp "${package}_${os}_${arch}_v${version}.zip" "../../../${package}_${os}_${arch}_v${version}.zip" | ||
cd $currentdir | ||
printf "\n" | ||
done | ||
printf "Clean Up \n" | ||
rm -rf "builds/" | ||
printf "Build Complete \n" | ||
printf "\n" |
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