blob: ca285a46aa063f7e56e6f49a39c912a94107131a [file] [log] [blame]
#!/bin/bash
# ============LICENSE_START=======================================================
# Copyright (C) 2019 The Nordix Foundation. All rights reserved.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
set -o nounset
set -o errexit
set -o pipefail
# file to record k8s properties
export K8S_DEPLOYMENT_FILE="$WORKSPACE/k8s.properties"
/bin/rm -f "$K8S_DEPLOYMENT_FILE"
echo "Info : Generating k8s properties"
echo "Info : Setting STACK_TYPE and STACK_VERSION"
export STACK_TYPE="kubernetes"
export STACK_VERSION="$K8S_VERSION"
# record vars to properties file
echo "STACK_TYPE=$STACK_TYPE" >> "$K8S_DEPLOYMENT_FILE"
echo "DEPLOY_SCENARIO=k8-calico-nofeature" >> "$K8S_DEPLOYMENT_FILE"
echo "STACK_VERSION=$STACK_VERSION" >> "$K8S_DEPLOYMENT_FILE"
echo "NORDIX_STACK_VERSION=$K8S_VERSION" >> "$K8S_DEPLOYMENT_FILE"
# global vars
export NORDIX_ARM_HTTPS_URL="https://artifactory.nordix.org/artifactory"
export ARTIFACT_ARM_FOLDER="release"
export BUILD_IDENTIFIER="${K8S_VERSION}/stack/latest"
export OFFLINE_INSTALLER_FILE="/tmp/${STACK_TYPE}-${K8S_VERSION}-${DISTRO}.bsx"
export BUILD_ARTIFACTS="/tmp/${STACK_TYPE}-${K8S_VERSION}-${DISTRO}.bsx"
export NORDIX_ARM_REPO="nordix-${STACK_TYPE}"
# looking to make url looking like
# https://artifactory.nordix.org/artifactory/nordix-kubernetes/oss/release/1.15/stack/latest/kubernetes-1.15-ubuntu1804.bsx
export NORDIX_ARTIFACT_URL="$NORDIX_ARM_HTTPS_URL/$NORDIX_ARM_REPO/oss/$ARTIFACT_ARM_FOLDER/$BUILD_IDENTIFIER"
cat << EOF >> "$K8S_DEPLOYMENT_FILE"
BUILD_IDENTIFIER=$BUILD_IDENTIFIER
BUILD_DATE=$(date '+%Y%m%d%H%M')
BUILT_BY=$BUILD_URL
DISTRO=$DISTRO
CI_LOOP=$CI_LOOP
ENGINE_SHA=$(git rev-parse HEAD)
OFFLINE_INSTALLER_FILE=$OFFLINE_INSTALLER_FILE
BUILD_ARTIFACTS=$BUILD_ARTIFACTS
NORDIX_ARM_REPO=nordix-${STACK_TYPE}
NORDIX_ARTIFACT_URL=$NORDIX_ARTIFACT_URL
EOF
echo "Info : K8S properties"
echo "-------------------------------------------------------------------------"
cat "$K8S_DEPLOYMENT_FILE"
echo "-------------------------------------------------------------------------"
# vim: set ts=2 sw=2 expandtab: