Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: exit if any error and specify the download file name when download by wget #751

Merged
merged 1 commit into from
Nov 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ manager-api

output
default.etcd
api/build-tools/apisix
/*.zip
9 changes: 6 additions & 3 deletions api/build-tools/schema-sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,24 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#

set -ex

pwd=`pwd`

version="master"
if [[ -n $1 ]]; then
version=$1
fi
fi

rm -rf ./api/build-tools/apisix/
wget https://github.com/apache/apisix/archive/$version.zip
wget -O $version.zip https://github.com/apache/apisix/archive/$version.zip

unzip $version.zip
mkdir -p ./api/build-tools/apisix/
mv ./apisix-$version/apisix/* ./api/build-tools/apisix/
rm -rf ./apisix-$version
cd ./api/build-tools/ && lua schema-sync.lua > ${pwd}/api/conf/schema.json

echo "sync success:"
echo "sync success:"
echo "${pwd}/api/conf/schema.json"