scripts/build_inf.sh: add debian support
[pti/rtp.git] / scripts / build_inf_debian / build_inf_prepare_jenkins.sh
1 #!/bin/sh
2 #
3 # Copyright (C) 2022 Wind River Systems, Inc.
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # 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
18 # Ensure we fail the job if any steps fail.
19 set -e -o pipefail
20
21 #########################################################################
22 # Variables
23 #########################################################################
24 WORKSPACE=""
25
26 SCRIPTS_NAME=$(basename $0)
27
28 #########################################################################
29 # Common Functions
30 #########################################################################
31
32 help_info () {
33 cat << ENDHELP
34 Usage:
35 ${SCRIPTS_NAME} [-w WORKSPACE_DIR] [-h]
36 where:
37     -w WORKSPACE_DIR is the path for the builds
38     -h this help info
39 examples:
40 $0
41 $0 -w workspace_1234
42 ENDHELP
43 }
44
45 echo_step_start() {
46     [ -n "$1" ] && msg_step=$1
47     echo "#########################################################################################"
48     echo "## ${SCRIPTS_NAME} - STEP START: ${msg_step}"
49     echo "#########################################################################################"
50 }
51
52 echo_step_end() {
53     [ -n "$1" ] && msg_step=$1
54     echo "#########################################################################################"
55     echo "## ${SCRIPTS_NAME} - STEP END: ${msg_step}"
56     echo "#########################################################################################"
57     echo
58 }
59
60 echo_info () {
61     echo "INFO: $1"
62 }
63
64 while getopts "w:h" OPTION; do
65     case ${OPTION} in
66         w)
67             WORKSPACE=`readlink -f ${OPTARG}`
68             ;;
69         h)
70             help_info
71             exit
72             ;;
73     esac
74 done
75
76 #########################################################################
77 # Main process
78 #########################################################################
79 msg_step="Prepare build directories"
80 echo_step_start
81
82 echo_info "Install minikube"
83 mkdir -p ${WORKSPACE}/dl-tools
84 cd ${WORKSPACE}/dl-tools
85 curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
86 sudo install minikube-linux-amd64 /usr/local/bin/minikube
87 minikube version
88
89 echo_info "Install helm"
90 curl -LO https://get.helm.sh/helm-v3.6.2-linux-amd64.tar.gz
91 tar xvf helm-v3.6.2-linux-amd64.tar.gz
92 sudo mv linux-amd64/helm /usr/local/bin/
93
94 echo_info "Install repo tool"
95 sudo wget https://storage.googleapis.com/git-repo-downloads/repo -O /usr/local/bin/repo
96 sudo chmod a+x /usr/local/bin/repo
97
98 echo_step_end