File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3434 stages : [commit]
3535 always_run : true
3636 pass_filenames : false
37+
38+ - id : kafka-check-schemas
39+ name : Check if local Kafka Schemas are up to date with code
40+ language : script
41+ entry : ./kafka-check-local-schemas.sh
42+ stages : [commit]
43+ always_run : true
44+ pass_filenames : false
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # Safety measures
4+ set -o errexit # Leave immediately if a command returns an error
5+ set -o nounset # Leave immediately if an unitialized value is used
6+ set -o pipefail # Leave immediately if a command fails in a pipe
7+
8+ [[ " ${BASH_VERSION} " =~ ^(5| 4\. [0-9]).* ]] && shopt -s inherit_errexit
9+
10+ # ####################################################################
11+ # Helper functions
12+ # ####################################################################
13+
14+ function error() {
15+ local msg=" $1 " exit_code=" ${2:- } "
16+ echo " ERROR: ${msg} " >&2
17+ exit " ${exit_code} "
18+ }
19+
20+ function check_binary_exists() {
21+ local binary=" $1 "
22+ command -v " ${binary} " & > /dev/null || error " ${binary} is required but it's not installed"
23+ }
24+
25+ # ####################################################################
26+ # Main code
27+ # ####################################################################
28+
29+ check_binary_exists " sbt"
30+
31+ sbt " runMain tools.generateSchemaFile schemas/schema.json"
You can’t perform that action at this time.
0 commit comments