|
| 1 | +#!/usr/bin/env bash |
| 2 | +# Licensed to the Apache Software Foundation (ASF) under one or more |
| 3 | +# contributor license agreements. See the NOTICE file distributed with |
| 4 | +# this work for additional information regarding copyright ownership. |
| 5 | +# The ASF licenses this file to You under the Apache License, Version 2.0 |
| 6 | +# (the "License"); you may not use this file except in compliance with |
| 7 | +# the License. You may obtain a copy of the License at |
| 8 | +# |
| 9 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# Unless required by applicable law or agreed to in writing, software |
| 12 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | +# See the License for the specific language governing permissions and |
| 15 | +# limitations under the License. |
| 16 | + |
| 17 | +set -e -u -o pipefail |
| 18 | + |
| 19 | +# This script tests the local part of the release process. It does not publish anything. |
| 20 | + |
| 21 | +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" |
| 22 | +cd "$DIR/../.." || exit 1 |
| 23 | + |
| 24 | +: "${RATISVERSION:="0.0.1"}" |
| 25 | +: "${RC:="-ci-test"}" |
| 26 | +: "${STAGING_REPO_DIR:="/tmp/ratis.staging-repo"}" |
| 27 | +: "${SVNDISTDIR:="/tmp/ratis.svn"}" |
| 28 | +: "${USERID:="ratis-ci-not-for-release"}" |
| 29 | + |
| 30 | +MVN_REPO_DIR="${HOME}/.m2/repository" |
| 31 | + |
| 32 | +mkdir -p "${SVNDISTDIR}" |
| 33 | + |
| 34 | +if [[ -z "${CODESIGNINGKEY:-}" ]]; then |
| 35 | + gpg --batch --passphrase '' --pinentry-mode loopback --quick-generate-key "${USERID}" rsa4096 default 1d |
| 36 | + CODESIGNINGKEY=$(gpg --list-keys --with-colons "${USERID}" | grep '^pub:' | cut -f5 -d:) |
| 37 | +fi |
| 38 | + |
| 39 | +git config user.email || git config user.email '[email protected]' |
| 40 | +git config user.name || git config user.name 'Test User' |
| 41 | + |
| 42 | +export CODESIGNINGKEY MVN_REPO_DIR RATISVERSION RC SVNDISTDIR |
| 43 | + |
| 44 | +export MAVEN_ARGS="--batch-mode" |
| 45 | + |
| 46 | +dev-support/make_rc.sh 1-prepare-src |
| 47 | +dev-support/make_rc.sh 2-verify-bin |
| 48 | +dev-support/make_rc.sh 3-publish-mvn -DaltDeploymentRepository="local::default::file://${STAGING_REPO_DIR}" |
| 49 | +dev-support/make_rc.sh 4-assembly |
0 commit comments