afenner | c20596c | 2020-07-31 15:15:27 +0100 | [diff] [blame] | 1 | #!/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 | |
| 22 | set -o nounset |
| 23 | set -o errexit |
| 24 | set -o pipefail |
| 25 | |
| 26 | # file to record k8s properties |
| 27 | export K8S_DEPLOYMENT_FILE="$WORKSPACE/k8s.properties" |
| 28 | /bin/rm -f "$K8S_DEPLOYMENT_FILE" |
| 29 | |
| 30 | echo "Info : Generating k8s properties" |
| 31 | |
afenner | c20596c | 2020-07-31 15:15:27 +0100 | [diff] [blame] | 32 | echo "Info : Setting STACK_TYPE and STACK_VERSION" |
| 33 | |
| 34 | export STACK_TYPE="kubernetes" |
| 35 | export STACK_VERSION="$K8S_VERSION" |
| 36 | |
| 37 | # record vars to properties file |
| 38 | echo "STACK_TYPE=$STACK_TYPE" >> "$K8S_DEPLOYMENT_FILE" |
| 39 | echo "DEPLOY_SCENARIO=k8-calico-nofeature" >> "$K8S_DEPLOYMENT_FILE" |
| 40 | echo "STACK_VERSION=$STACK_VERSION" >> "$K8S_DEPLOYMENT_FILE" |
| 41 | echo "NORDIX_STACK_VERSION=$K8S_VERSION" >> "$K8S_DEPLOYMENT_FILE" |
| 42 | |
| 43 | # global vars |
| 44 | export NORDIX_ARM_HTTPS_URL="https://artifactory.nordix.org/artifactory" |
| 45 | export ARTIFACT_ARM_FOLDER="release" |
afenner | c2e7ec3 | 2020-08-05 08:42:56 +0100 | [diff] [blame] | 46 | export BUILD_IDENTIFIER="${K8S_VERSION}/stack/latest" |
afenner | c20596c | 2020-07-31 15:15:27 +0100 | [diff] [blame] | 47 | export OFFLINE_INSTALLER_FILE="/tmp/${STACK_TYPE}-${K8S_VERSION}-${DISTRO}.bsx" |
| 48 | export BUILD_ARTIFACTS="/tmp/${STACK_TYPE}-${K8S_VERSION}-${DISTRO}.bsx" |
| 49 | export NORDIX_ARM_REPO="nordix-${STACK_TYPE}" |
afenner | c2e7ec3 | 2020-08-05 08:42:56 +0100 | [diff] [blame] | 50 | # 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 |
afenner | c20596c | 2020-07-31 15:15:27 +0100 | [diff] [blame] | 52 | export NORDIX_ARTIFACT_URL="$NORDIX_ARM_HTTPS_URL/$NORDIX_ARM_REPO/oss/$ARTIFACT_ARM_FOLDER/$BUILD_IDENTIFIER" |
| 53 | |
| 54 | cat << EOF >> "$K8S_DEPLOYMENT_FILE" |
| 55 | BUILD_IDENTIFIER=$BUILD_IDENTIFIER |
| 56 | BUILD_DATE=$(date '+%Y%m%d%H%M') |
| 57 | BUILT_BY=$BUILD_URL |
| 58 | DISTRO=$DISTRO |
| 59 | CI_LOOP=$CI_LOOP |
| 60 | ENGINE_SHA=$(git rev-parse HEAD) |
| 61 | OFFLINE_INSTALLER_FILE=$OFFLINE_INSTALLER_FILE |
| 62 | BUILD_ARTIFACTS=$BUILD_ARTIFACTS |
| 63 | NORDIX_ARM_REPO=nordix-${STACK_TYPE} |
| 64 | NORDIX_ARTIFACT_URL=$NORDIX_ARTIFACT_URL |
| 65 | EOF |
| 66 | |
| 67 | echo "Info : K8S properties" |
| 68 | echo "-------------------------------------------------------------------------" |
| 69 | cat "$K8S_DEPLOYMENT_FILE" |
| 70 | echo "-------------------------------------------------------------------------" |
| 71 | |
| 72 | # vim: set ts=2 sw=2 expandtab: |