3 # ============LICENSE_START=======================================================
4 # Copyright (C) 2018-2019 Nordix Foundation.
5 # ================================================================================
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
18 # SPDX-License-Identifier: Apache-2.0
19 # ============LICENSE_END=========================================================
24 ARTIFACTORY_URL="https://artifactory.nordix.org/artifactory"
25 GEODE_BUILD_VERSION=$(cat $WORKSPACE/geode-build-version/number)
26 GEODE_UPSTREAM_VERSION=$(echo ${GEODE_BUILD_VERSION} | awk -F "." '{print $1"."$2"."$3}')
29 GEODE_ARTIFACT_PATH=$(find geode-assembly/build/distributions \( -name \*.tgz ! -name \*src.tgz \))
30 GEODE_ARTIFACT=${GEODE_ARTIFACT_PATH##*/}
31 SHA_CHECKSUM=$(shasum -a 1 ${GEODE_ARTIFACT_PATH} | awk '{ print $1 }')
32 SHA256_CHECKSUM=$(sha256sum ${GEODE_ARTIFACT_PATH} | awk '{ print $1 }')
33 MD5_CHECKSUM=$(md5sum ${GEODE_ARTIFACT_PATH} | awk '{ print $1 }')
35 if [[ ${GEODE_BUILD_VERSION} =~ \.RC[0-9]+ ]] ; then
40 echo "-----------------------------------------------------------"
41 echo -e "\nUploading ${GEODE_ARTIFACT} to geode staging area: "
42 echo -e "geode/${GEODE_UPSTREAM_VERSION}/${LOCATION} on artifactory.nordix.org\n"
43 curl -H "X-JFrog-Art-Api:${ARTIFACTORY_API_KEY}" \
44 -H "X-Checksum-Sha1:${SHA_CHECKSUM}" \
45 -H "X-Checksum-Sha256:${SHA256_CHECKSUM}" \
46 -H "X-Checksum-MD5:${MD5_CHECKSUM}" \
47 -X PUT "${ARTIFACTORY_URL}/geode/${GEODE_UPSTREAM_VERSION}/${LOCATION}/${GEODE_ARTIFACT}" \
48 -T ${GEODE_ARTIFACT_PATH}
49 echo "-----------------------------------------------------------"