-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a phone make target to check local schema against master
The idea behind this addition is to avoid the CI round-trip for ensuring our currently generated schema produces the results that we expect. Currently missing from schema-tools is an implementation of the version command which means we'll download a new artifact every time we run. We also don't have a very safe OS check, etc, but it will at least work on apple machines for the time being.
- Loading branch information
Showing
2 changed files
with
32 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#! /bin/bash | ||
|
||
ACCOUNT='pulumi' | ||
OS=$(uname -s | tr '[:upper:]' '[:lower:]') | ||
ARCH=$(uname -m|tr '[:upper:]' '[:lower:]') | ||
VERSION=$1 | ||
|
||
RELEASE_ARTIFACT="schema-tools-${VERSION}-${OS}-${ARCH}.tar.gz" | ||
ARTIFACT_URL="https://github.com/${ACCOUNT}/schema-tools/releases/download/${VERSION}/${RELEASE_ARTIFACT}" | ||
|
||
CURRENT_VERSION=$(schema-tools version 2>/dev/null) | ||
echo "Downloading schema-tools ${VERSION} for ${OS} ${ARCH}..." | ||
|
||
if [ CURRENT_VERSION == VERSION ]; then | ||
echo "schema-tools ${VERSION} is already installed." | ||
exit 0 | ||
else | ||
echo "schema-tools ${CURRENT_VERSION} is installed. Installing ${VERSION}..." | ||
curl -L -o /tmp/${RELEASE_ARTIFACT} ${ARTIFACT_URL} | ||
tar -xzf /tmp/${RELEASE_ARTIFACT} -C /tmp | ||
rm /tmp/${RELEASE_ARTIFACT} | ||
|
||
echo "Moving schema-tools to /usr/local/bin - please enter your password if prompted." | ||
sudo mv /tmp/schema-tools /usr/local/bin | ||
fi |