blob: ca285a46aa063f7e56e6f49a39c912a94107131a [file] [log] [blame]
afennerc20596c2020-07-31 15:15:27 +01001#!/bin/bash
2
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
9#
10# http://www.apache.org/licenses/LICENSE-2.0
11#
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.
17#
18# SPDX-License-Identifier: Apache-2.0
19# ============LICENSE_END=========================================================
20
21
22set -o nounset
23set -o errexit
24set -o pipefail
25
26# file to record k8s properties
27export K8S_DEPLOYMENT_FILE="$WORKSPACE/k8s.properties"
28/bin/rm -f "$K8S_DEPLOYMENT_FILE"
29
30echo "Info : Generating k8s properties"
31
afennerc20596c2020-07-31 15:15:27 +010032echo "Info : Setting STACK_TYPE and STACK_VERSION"
33
34export STACK_TYPE="kubernetes"
35export STACK_VERSION="$K8S_VERSION"
36
37# record vars to properties file
38echo "STACK_TYPE=$STACK_TYPE" >> "$K8S_DEPLOYMENT_FILE"
39echo "DEPLOY_SCENARIO=k8-calico-nofeature" >> "$K8S_DEPLOYMENT_FILE"
40echo "STACK_VERSION=$STACK_VERSION" >> "$K8S_DEPLOYMENT_FILE"
41echo "NORDIX_STACK_VERSION=$K8S_VERSION" >> "$K8S_DEPLOYMENT_FILE"
42
43# global vars
44export NORDIX_ARM_HTTPS_URL="https://artifactory.nordix.org/artifactory"
45export ARTIFACT_ARM_FOLDER="release"
afennerc2e7ec32020-08-05 08:42:56 +010046export BUILD_IDENTIFIER="${K8S_VERSION}/stack/latest"
afennerc20596c2020-07-31 15:15:27 +010047export OFFLINE_INSTALLER_FILE="/tmp/${STACK_TYPE}-${K8S_VERSION}-${DISTRO}.bsx"
48export BUILD_ARTIFACTS="/tmp/${STACK_TYPE}-${K8S_VERSION}-${DISTRO}.bsx"
49export NORDIX_ARM_REPO="nordix-${STACK_TYPE}"
afennerc2e7ec32020-08-05 08:42:56 +010050# looking to make url looking like
51# https://artifactory.nordix.org/artifactory/nordix-kubernetes/oss/release/1.15/stack/latest/kubernetes-1.15-ubuntu1804.bsx
afennerc20596c2020-07-31 15:15:27 +010052export NORDIX_ARTIFACT_URL="$NORDIX_ARM_HTTPS_URL/$NORDIX_ARM_REPO/oss/$ARTIFACT_ARM_FOLDER/$BUILD_IDENTIFIER"
53
54cat << EOF >> "$K8S_DEPLOYMENT_FILE"
55BUILD_IDENTIFIER=$BUILD_IDENTIFIER
56BUILD_DATE=$(date '+%Y%m%d%H%M')
57BUILT_BY=$BUILD_URL
58DISTRO=$DISTRO
59CI_LOOP=$CI_LOOP
60ENGINE_SHA=$(git rev-parse HEAD)
61OFFLINE_INSTALLER_FILE=$OFFLINE_INSTALLER_FILE
62BUILD_ARTIFACTS=$BUILD_ARTIFACTS
63NORDIX_ARM_REPO=nordix-${STACK_TYPE}
64NORDIX_ARTIFACT_URL=$NORDIX_ARTIFACT_URL
65EOF
66
67echo "Info : K8S properties"
68echo "-------------------------------------------------------------------------"
69cat "$K8S_DEPLOYMENT_FILE"
70echo "-------------------------------------------------------------------------"
71
72# vim: set ts=2 sw=2 expandtab: