Skip to content

Commit

Permalink
Another commit
Browse files Browse the repository at this point in the history
Signed-off-by: Sayan Chowdhury <schowdhury@microsoft.com>
  • Loading branch information
sayanchowdhury committed Jun 30, 2023
1 parent 39ce68d commit c55899b
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 39 deletions.
77 changes: 77 additions & 0 deletions ci-automation/capi_image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
#!/bin/bash
#
# Copyright (c) 2023 The Flatcar Maintainers.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

# >>> This file is supposed to be SOURCED from the repository ROOT. <<<
#
# --
function capi_image_build() {
# Run a subshell, so the traps, environment changes and global
# variables are not spilled into the caller.
(
set -euo pipefail

_capi_image_build_impl "${@}"
)
}

function capi_image_publish() {
# Run a subshell, so the traps, environment changes and global
# variables are not spilled into the caller.
(
set -euo pipefail

_capi_image_publish_impl "${@}"
)
}

function setup_capi_params() {
source sdk_lib/sdk_container_common.sh
source ci-automation/ci_automation_common.sh
source ci-automation/gpg_setup.sh
source sdk_container/.repo/manifests/version.txt

echo "==================================================================="
azure_profile_config_file=""
secret_to_file azure_profile_config_file "${AZURE_PROFILE}"
azure_auth_config_file=""
secret_to_file azure_auth_config_file "${AZURE_AUTH_CREDENTIALS}"

FLATCAR_CHANNEL="$(get_git_channel)"
FLATCAR_AZURE_AUTH_CREDENTIALS="${AZURE_AUTH_CREDENTIALS}"

# Provide a python3 command for the k8s schedule parsing
export PATH="$PATH:$PWD/ci-automation/python-bin"
k8s_release_versions=$(ci-automation/get_kubernetes_releases.py)
}

function _capi_image_build_impl() {
local arch="$1"
setup_capi_params

for k8s_version in $k8s_release_versions
do
KUBERNETES_SEMVER="v${k8s_version}"
echo "== Building Flatcar SIG images from VHDs"
ci-automation/azure-sig.sh ensure-flatcar-staging-sig-image-version-from-vhd
echo "== Building Flatcar CAPI SIG image"
ci-automation/azure-sig.sh build-capi-staging-image
done
}

function _capi_image_publish_impl() {
local arch="$1"
setup_capi_params

for k8s_version in $k8s_release_versions
do
KUBERNETES_SEMVER="v${k8s_version}"
echo "== Publishing Flatcar SIG image"
ci-automation/azure-sig.sh publish-flatcar-image
# Publish Flatcar CAPI image
ci-automation/azure-sig.sh publish-flatcar-capi-image
done
}
# --
39 changes: 0 additions & 39 deletions ci-automation/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,45 +67,6 @@ function release_build() {
)
}

function stg_release_build() {
# This is a staging release build, run via a staging job.
# Thi
# Run a subshell, so the traps, environment changes and global
# variables are not spilled into the caller.
(
set -euo pipefail

_release_build_impl "${@}"
)
}

function _stg_release_build_impl() {
source sdk_lib/sdk_container_common.sh
source ci-automation/ci_automation_common.sh
source ci-automation/gpg_setup.sh

source sdk_container/.repo/manifests/version.txt
# Needed because we are not the SDK container here
source sdk_container/.env
local sdk_version="${FLATCAR_SDK_VERSION}"
CHANNEL="$(get_git_channel)"
VERSION="${FLATCAR_VERSION}"

azure_profile_config_file=""
secret_to_file azure_profile_config_file "${AZURE_PROFILE}"
azure_auth_config_file=""
secret_to_file azure_auth_config_file "${AZURE_AUTH_CREDENTIALS}"

# Provide a python3 command for the k8s schedule parsing
export PATH="$PATH:$PWD/ci-automation/python-bin"
k8s_release_versions= $(ci-automation/get_kubernetes_releases.py)
for k8s_version in $k8s_release_versions
do
FLATCAR_CHANNEL="${CHANNEL}" FLATCAR_AZURE_AUTH_CREDENTIALS="${AZURE_AUTH_CREDENTIALS}" KUBERNETES_SEMVER="v${k8s_version}" ci-automation/azure-sig.sh
done
}


function _inside_mantle() {
# Run a subshell for the same reasons as above
(
Expand Down

0 comments on commit c55899b

Please sign in to comment.