3 # ============LICENSE_START=======================================================
4 # Copyright (C) 2019 The Nordix Foundation. All rights reserved.
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=========================================================
26 # file to record k8s properties
27 export K8S_DEPLOYMENT_FILE="$WORKSPACE/k8s.properties"
28 /bin/rm -f "$K8S_DEPLOYMENT_FILE"
30 echo "Info : Generating k8s properties"
32 # determine the project
33 # this scripts is used by all engine repos so we need to determine what this change is for
34 export ENGINE_COMPONENT="${GERRIT_PROJECT//*\//}"
36 echo "Info : Setting STACK_TYPE and STACK_VERSION"
38 export STACK_TYPE="kubernetes"
39 export STACK_VERSION="$K8S_VERSION"
41 # record vars to properties file
42 echo "STACK_TYPE=$STACK_TYPE" >> "$K8S_DEPLOYMENT_FILE"
43 echo "DEPLOY_SCENARIO=k8-calico-nofeature" >> "$K8S_DEPLOYMENT_FILE"
44 echo "STACK_VERSION=$STACK_VERSION" >> "$K8S_DEPLOYMENT_FILE"
45 echo "NORDIX_STACK_VERSION=$K8S_VERSION" >> "$K8S_DEPLOYMENT_FILE"
48 export NORDIX_ARM_HTTPS_URL="https://artifactory.nordix.org/artifactory"
49 export ARTIFACT_ARM_FOLDER="release"
50 export BUILD_IDENTIFIER="${K8S_VERSION}/stack/latest"
51 export OFFLINE_INSTALLER_FILE="/tmp/${STACK_TYPE}-${K8S_VERSION}-${DISTRO}.bsx"
52 export BUILD_ARTIFACTS="/tmp/${STACK_TYPE}-${K8S_VERSION}-${DISTRO}.bsx"
53 export NORDIX_ARM_REPO="nordix-${STACK_TYPE}"
54 # looking to make url looking like
55 # https://artifactory.nordix.org/artifactory/nordix-kubernetes/oss/release/1.15/stack/latest/kubernetes-1.15-ubuntu1804.bsx
56 export NORDIX_ARTIFACT_URL="$NORDIX_ARM_HTTPS_URL/$NORDIX_ARM_REPO/oss/$ARTIFACT_ARM_FOLDER/$BUILD_IDENTIFIER"
58 cat << EOF >> "$K8S_DEPLOYMENT_FILE"
59 BUILD_IDENTIFIER=$BUILD_IDENTIFIER
60 BUILD_DATE=$(date '+%Y%m%d%H%M')
64 ENGINE_SHA=$(git rev-parse HEAD)
65 OFFLINE_INSTALLER_FILE=$OFFLINE_INSTALLER_FILE
66 BUILD_ARTIFACTS=$BUILD_ARTIFACTS
67 NORDIX_ARM_REPO=nordix-${STACK_TYPE}
68 NORDIX_ARTIFACT_URL=$NORDIX_ARTIFACT_URL
71 echo "Info : K8S properties"
72 echo "-------------------------------------------------------------------------"
73 cat "$K8S_DEPLOYMENT_FILE"
74 echo "-------------------------------------------------------------------------"
76 # vim: set ts=2 sw=2 expandtab: