diff --git a/README.md b/README.md index 4efa6b02..ae292b4b 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ projects. ## System Requirements -This framework is intended to be run on an Ubuntu 20.04 system with some basic +This framework is intended to be run on an Ubuntu 24.04 system with some basic developer packages installed, such as git, and passwordless sudo enabled. Note that it will automatically install various build-dependencies on the system, so as a safety precaution it is currently restricted to only run on an AWS instance diff --git a/default-package-config.sh b/default-package-config.sh index 93f962c3..1f5497c4 100644 --- a/default-package-config.sh +++ b/default-package-config.sh @@ -262,7 +262,7 @@ function kernel_update_upstream() { local tag_prefix_flavour case "${platform}" in generic) - if [[ "$UBUNTU_DISTRIBUTION" == focal ]]; then + if [[ "$UBUNTU_DISTRIBUTION" == noble ]]; then tag_prefix_flavour="Ubuntu-hwe" else tag_prefix_flavour="Ubuntu" diff --git a/lib/common.sh b/lib/common.sh index 79f71b42..d81dded2 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -28,7 +28,7 @@ export SUPPORTED_KERNEL_FLAVORS="generic aws gcp azure oracle" # export JENKINS_OPS_DIR="${JENKINS_OPS_DIR:-jenkins-ops}" -export UBUNTU_DISTRIBUTION="focal" +export UBUNTU_DISTRIBUTION="noble" # # We currently support getting the linux kernel from 3 different sources: @@ -746,6 +746,24 @@ function git_fetch_helper() { git fetch "$git_url" "$@" || die "git fetch failed" } +# +# Run git fetch with the passed arguments. Git url must be passed as first +# argument. If FETCH_GIT_TOKEN is set and this is a github repository +# then pass-in the token when fetching. +# +function git_branch_exists() { + local git_url="$1" + local label='' + shift + + if [[ -n "$FETCH_GIT_TOKEN" ]] && + [[ "$git_url" == https://github.com/* ]]; then + git_url="${git_url/https:\/\//https:\/\/${FETCH_GIT_TOKEN}@}" + label='[token passed]' + fi + git fetch "$git_url" "$@" --no-tags --depth=1 || return 1 +} + # # Fetch package repository into $WORKDIR/repo # @@ -769,6 +787,25 @@ function fetch_repo_from_git() { logmust git show-ref repo-HEAD logmust git show-ref upstream-HEAD else + + # + # The "os-upgrade" branch is used for Ubuntu version upgrade projects. As such, the following + # block of code will only be executed if the `PACKAGE_GIT_BRANCH` is set to "os-upgrade". Not + # all product repositories are required to have an "os-upgrade" branch, because some packages + # will successfully build on the new Ubuntu version as well as the old without any changes. + # To allow engineering to create the "os-upgrade" branch only in repositories that require + # changes for the new Ubuntu version, this block of code will check if the "os-upgrade" branch + # exists in the repository and if it does not, it will build off of "develop" instead. + # + if [[ "$PACKAGE_GIT_BRANCH" == "os-upgrade" ]]; then + git_branch_exists "$PACKAGE_GIT_URL" "$PACKAGE_GIT_BRANCH" + branch_exists=$? + if [[ $branch_exists -ne 0 ]]; then + echo "NOTE: The branch 'os-upgrade' does not exist for this repo. Using 'develop' instead." + PACKAGE_GIT_BRANCH="develop" + fi + fi + logmust git_fetch_helper "$PACKAGE_GIT_URL" --no-tags \ "+$PACKAGE_GIT_BRANCH:repo-HEAD" --depth=1 logmust git show-ref repo-HEAD @@ -1082,10 +1119,10 @@ function get_kernel_version_for_platform_from_apt() { # available, it is not always the case. # - if [[ "$platform" != generic ]] && [[ "$UBUNTU_DISTRIBUTION" == focal ]]; then + if [[ "$platform" != generic ]] && [[ "$UBUNTU_DISTRIBUTION" == noble ]]; then package="linux-image-${platform}" else - package="linux-image-${platform}-hwe-20.04" + package="linux-image-${platform}-hwe-24.04" fi if [[ "$(apt-cache show --no-all-versions "$package" \ diff --git a/packages/misc-debs/config.sh b/packages/misc-debs/config.sh index 3fc41b3b..36225319 100644 --- a/packages/misc-debs/config.sh +++ b/packages/misc-debs/config.sh @@ -47,10 +47,7 @@ SKIP_COPYRIGHTS_CHECK=true function fetch() { logmust cd "$WORKDIR/artifacts" - local debs=( - # Copied from https://s3.amazonaws.com/packages.treasuredata.com/4/ubuntu/focal/pool/contrib/t/td-agent/td-agent_4.4.2-1_arm64.deb - "td-agent_4.4.2-1_amd64.deb b40c1883c3849e9a7bf67762c9f9a87a6119ad98f1fae64a83d754e1275a379a" - ) + local debs=() local url="http://artifactory.delphix.com/artifactory/linux-pkg/misc-debs"