Skip to content

Instantly share code, notes, and snippets.

@membphis
Created January 6, 2020 14:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save membphis/7f5afa12e2bceb6231f41f88891a98c3 to your computer and use it in GitHub Desktop.
Save membphis/7f5afa12e2bceb6231f41f88891a98c3 to your computer and use it in GitHub Desktop.
#!/bin/sh
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# set -e
ver_major=$1
ver_sub=$2
ver=$1-$2
# 新建版本号目录并进入,比如:1.0-rc1
rm -rf $ver && mkdir -p $ver && cd $ver
# 下载安装包
git clone -b v${ver_major} git@github.com:apache/incubator-apisix.git apache-apisix-${ver_major}-incubating
# 检查版本号
cd apache-apisix-${ver_major}-incubating && ./utils/check-version.sh ${ver_major} && cd ..
# 删除 .git 文件夹
rm -rf apache-apisix-${ver_major}-incubating/.git
# 制作压缩包
tar zcvf apache-apisix-${ver}-incubating-src.tar.gz apache-apisix-${ver_major}-incubating
# 制作签名(这步会弹出对话框,提示你输入生成 gpg 时录入的密码)
gpg --armor --detach-sign apache-apisix-${ver}-incubating-src.tar.gz
# 生成 sha512 校验文件
shasum -a512 apache-apisix-${ver}-incubating-src.tar.gz > apache-apisix-${ver}-incubating-src.tar.gz.sha512
# 删除 apache-apisix-${ver}-incubating
rm -rf apache-apisix-${ver_major}-incubating
# 后退到 Apache svn 的 apisix 根目录,并确认文件目录
cd .. && tree
green='\e[0;32m'
GREEN='\e[1;32m'
NC='\e[0m'
echo
echo "# You can submit new file to Apache svn server by following steps:"
echo "# 1. add new file to svn"
echo -e "cmd: ${green}svn add *${NC}"
echo "# 2. submit changing to svn server"
echo -e "cmd: ${green}svn --username=$"'{Apache user name}'" commit -m \"release ${ver}\"${NC}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment