Skip to content

Commit

Permalink
Get NeonVM version from go.mod in scripts (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
sharnoff authored Feb 24, 2023
1 parent c24f3b9 commit 37d62f9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
7 changes: 7 additions & 0 deletions scripts-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ git_info () {
sed -e "s:':\":g"
}

# Usage: NEONVM_VERSION="$(neonvm_version)"
#
# Fetches the version of NeonVM we're using as a dependency, directly from go.mod.
neonvm_version () {
go list -m -f '{{ .Version }}' github.com/neondatabase/neonvm
}

# Usage: VAR_NAME="$(get_var VAR_NAME DEFAULT_VALUE)"
#
# Helper function that
Expand Down
4 changes: 3 additions & 1 deletion scripts/download-deployments.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ set -eu -o pipefail
cd -P -- "$(dirname -- "$0")"
cd .. # but all of the references are to things in the upper directory

source './scripts-common.sh'

echo "downloading 'deploy/flannel.yaml'..."
curl -sS https://raw.githubusercontent.com/flannel-io/flannel/v0.19.2/Documentation/kube-flannel.yml \
-o deploy/flannel.yaml
Expand All @@ -18,5 +20,5 @@ echo "downloading 'multus-daemonset.yaml'..."
curl -sS https://raw.githubusercontent.com/k8snetworkplumbingwg/multus-cni/master/deployments/multus-daemonset.yml \
-o deploy/multus-daemonset.yaml
echo "downloading 'neonvm.yaml'..."
curl -sSL https://github.com/neondatabase/neonvm/releases/download/v0.4.6/neonvm.yaml \
curl -sSL https://github.com/neondatabase/neonvm/releases/download/$(neonvm_version)/neonvm.yaml \
-o deploy/neonvm.yaml
2 changes: 1 addition & 1 deletion vm_image/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ source '../scripts-common.sh'

NEONVM_BUILDER_PATH='neonvm-builder'
NEONVM_REPO='https://github.com/neondatabase/neonvm'
NEONVM_VERSION='v0.4.6'
NEONVM_VERSION="$(neonvm_version)"

if [ -e "$NEONVM_BUILDER_PATH" ]; then
echo "Skipping downloading NeonVM vm-builder because '$NEONVM_BUILDER_PATH' already exists"
Expand Down

0 comments on commit 37d62f9

Please sign in to comment.