[ta] Add TA verify and merge jobs
[ci-management.git] / jjb / shell / ta-rpm-deploy.sh
1 #!/bin/bash
2 # SPDX-License-Identifier: EPL-1.0
3 ##############################################################################
4 # Copyright (c) 2017 The Linux Foundation and others.
5 #
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
12 echo "---> ta-rpm-deploy.sh"
13
14 # Ensure we fail the job if any steps fail.
15 set -eu -o pipefail
16
17 set -x  # Trace commands for this script to make debugging easier.
18
19 NEXUS_REPO=images-snapshots
20 release_path=TA/release-1
21
22 repo_dir="$WORKSPACE/work/nexus/$NEXUS_REPO"
23 x86_dir="$repo_dir/$release_path/rpms/x86_64"
24 sources_dir="$repo_dir/$release_path/rpms/Sources"
25 nexus_repo_url="$NEXUS_URL/content/repositories/$NEXUS_REPO"
26
27 mkdir -p "$x86_dir"
28 mkdir -p "$sources_dir"
29
30 cp "$WORKSPACE/work/results/repo/"*.rpm "$x86_dir"
31 cp "$WORKSPACE/work/results/src_repo/"*.rpm "$sources_dir"
32
33 echo "-----> Upload RPMs to Nexus"
34 lftools deploy nexus "$nexus_repo_url" "$repo_dir"
35
36 set +x  # Disable trace since we no longer need it.
37 echo "RPMs location: <a href=\"$nexus_repo_url\">$nexus_repo_url</a>"