#!/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 if [[ "$EXECUTION_MODE" == "offline-deployment" ]]; then echo "Info : Offline deployment. Adding Nordix ARM Public IP to /etc/hosts" sudo bash -c "cat << EOF >> /etc/hosts # managed by engine $NORDIX_ARM_PUBLIC_IP artifactory.nordix.org # managed by engine EOF" echo "Info : Downloading artifact from Nordix ARM." cd /tmp curl -s -O $NORDIX_ARTIFACT_URL echo "Info : Downloaded the artifact for offline deployment. Extracting." chmod +x /tmp/k8s-installer-ubuntu1804.bsx /tmp/k8s-installer-ubuntu1804.bsx else echo "Info : Online deployment. Skipping artifact download." fi