2 # SPDX-License-Identifier: EPL-1.0
3 ##############################################################################
4 # Copyright (c) 2018 The Linux Foundation and others.
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Eclipse Public License v1.0
8 # which accompanies this distribution, and is available at
9 # http://www.eclipse.org/legal/epl-v10.html
10 ##############################################################################
11 echo "---> cmake-stage.sh"
13 classifier="${CLASSIFIER:-linux-amd64}"
14 nexus_group_id="${NEXUS_GROUP_ID:-io.aswf.opencolorio}"
15 staging_profile_id="${STAGING_PROFILE_ID:-126694cb53ec54}"
16 version="${VERSION:-}"
18 # shellcheck source=/tmp/v/lftools/bin/activate disable=SC1091
19 source "/tmp/v/lftools/bin/activate"
23 if [ -z "${nexus_group_id}" ]; then
24 echo "ERROR: No nexus group ID provided."
28 if [ -z "${staging_profile_id}" ]; then
29 echo "ERROR: No staging profile ID provided."
33 if [ -z "${version}" ]; then
34 if [ -f "/tmp/artifact_version" ]; then
35 version="$(cat /tmp/artifact_version)"
37 echo "ERROR: No artifact version defined."
42 repo_id=$(lftools deploy nexus-stage-repo-create "$NEXUS_URL" \
43 "$staging_profile_id")
45 mapfile -t artifacts < <(ls "$WORKSPACE"/dist)
46 for artifact in "${artifacts[@]}"; do
47 lftools deploy file -c "$classifier" "$NEXUS_URL" "$repo_id" \
49 "${artifact%.tar.xz}" \
52 "$WORKSPACE/dist/$artifact"
55 git config tar.tar.xz.command "xz -c"
56 git archive --format=tar.xz HEAD > src.tar.xz
57 lftools deploy file -c "sources" "$NEXUS_URL" "$repo_id" \
59 "${artifact%.tar.xz}" \
65 lftools deploy nexus-stage-repo-close "$NEXUS_URL" "$staging_profile_id" \
68 PATCH_DIR="$WORKSPACE/archives/patches"
70 echo "$PROJECT" "$(git rev-parse --verify HEAD)" | \
71 tee -a "$PATCH_DIR/taglist.log"
72 echo "$repo_id" > "$WORKSPACE/archives/staging-repo.txt"