1#!/usr/bin/env bash 2# Copyright 2017 The TensorFlow Authors. All Rights Reserved. 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15# ============================================================================== 16# 17# Script to upload release artifacts for the TensorFlow Java library to 18# Maven Central. See README.md for an explanation. 19 20cd $(dirname "$0") 21TF_VERSION="$1" 22SETTINGS_XML="$2" 23shift 24shift 25CMD="$*" 26 27if [[ -z "${TF_VERSION}" ]] 28then 29 echo "Usage: $0 <version to release> [<path to settings.xml>] ["bash" for debugging]" 30 exit 1 31fi 32 33if [[ -z "${SETTINGS_XML}" ]] 34then 35 SETTINGS_XML="$HOME/.m2/settings.xml" 36fi 37 38if [[ -z "${CMD}" ]] 39then 40 CMD="bash run_inside_container.sh" 41fi 42 43if [[ ! -f "${SETTINGS_XML}" ]] 44then 45 echo "No settings.xml (containing credentials for upload) found" 46 exit 1 47fi 48 49set -ex 50docker run \ 51 -e TF_VERSION="${TF_VERSION}" \ 52 -e DEPLOY_OSSRH="${DEPLOY_OSSRH:-true}" \ 53 -e DEPLOY_BINTRAY="${DEPLOY_BINTRAY:-true}" \ 54 -v ${PWD}:/tensorflow \ 55 -v "${SETTINGS_XML}":/root/.m2/settings.xml \ 56 -v ${HOME}/.gnupg:/root/.gnupg \ 57 -w /tensorflow \ 58 -it \ 59 maven:3.3.9-jdk-8 \ 60 ${CMD} 61