-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Sayan Chowdhury <schowdhury@microsoft.com>
- Loading branch information
1 parent
39ce68d
commit c55899b
Showing
2 changed files
with
77 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
# -- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters