mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-07 21:16:57 +02:00
build_docker_aci: include 'extra' version number
This allows for multiple iterations with the same package version if needed.
This commit is contained in:
parent
ada33ad411
commit
b8589683b8
@ -25,14 +25,18 @@ DEFINE_boolean getbinpkg "${FLAGS_FALSE}" \
|
|||||||
DEFINE_string getbinpkgver "" \
|
DEFINE_string getbinpkgver "" \
|
||||||
"Use binary packages from a specific version."
|
"Use binary packages from a specific version."
|
||||||
|
|
||||||
FLAGS_HELP="USAGE: build_docker_aci [flags] [docker version].
|
FLAGS_HELP="USAGE: build_docker_aci [flags] [docker version] [aci version number].
|
||||||
This script is used to build a CoreOS docker-skim ACI.
|
This script is used to build a CoreOS docker-skim ACI.
|
||||||
|
|
||||||
The version should identify an existent ebuild (i.e. app-emulation/docker-\$version).
|
The docker version should identify an existent ebuild (i.e.
|
||||||
|
app-emulation/docker-\$version).
|
||||||
|
|
||||||
|
The aci version number is an atomically incrementing number that will be
|
||||||
|
appended to the aci version (to create e.g. :v1.12.6_coreos.0).
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
build_docker_aci --board=amd64-usr --build_dir=<build_dir> 1.12.6
|
build_docker_aci --board=amd64-usr --build_dir=<build_dir> 1.12.6 0
|
||||||
...
|
...
|
||||||
"
|
"
|
||||||
show_help_if_requested "$@"
|
show_help_if_requested "$@"
|
||||||
@ -48,12 +52,18 @@ DEFINE_string output_root "${DEFAULT_BUILD_ROOT}/images" \
|
|||||||
"Directory in which to place image result directories (named by version)"
|
"Directory in which to place image result directories (named by version)"
|
||||||
DEFINE_string version "" \
|
DEFINE_string version "" \
|
||||||
"Sets the docker version to build."
|
"Sets the docker version to build."
|
||||||
|
DEFINE_integer aci_version "" \
|
||||||
|
"Sets the aci version tag identifier."
|
||||||
|
|
||||||
# Parse command line.
|
# Parse command line.
|
||||||
FLAGS "$@" || exit 1
|
FLAGS "$@" || exit 1
|
||||||
[ -z "${FLAGS_ARGV}" ] && echo 'No version given' && exit 0
|
[ -z "${FLAGS_ARGV}" ] && echo 'No version given' && exit 0
|
||||||
eval set -- "${FLAGS_ARGV}"
|
eval set -- "${FLAGS_ARGV}"
|
||||||
|
|
||||||
|
version="${1:?Docker version}"
|
||||||
|
aci_version="${2:?Docker version}"
|
||||||
|
|
||||||
|
|
||||||
# Only now can we die on error. shflags functions leak non-zero error codes,
|
# Only now can we die on error. shflags functions leak non-zero error codes,
|
||||||
# so will die prematurely if 'switch_to_strict_mode' is specified before now.
|
# so will die prematurely if 'switch_to_strict_mode' is specified before now.
|
||||||
switch_to_strict_mode
|
switch_to_strict_mode
|
||||||
@ -75,23 +85,26 @@ fi
|
|||||||
|
|
||||||
BUILD_DIR=${FLAGS_build_dir:-$BUILD_DIR}
|
BUILD_DIR=${FLAGS_build_dir:-$BUILD_DIR}
|
||||||
|
|
||||||
for version; do
|
case "${version}" in
|
||||||
case "${version}" in
|
1.12.[0-9]*)
|
||||||
1.12.[0-9]*)
|
packaged_files=(
|
||||||
packaged_files=(
|
"/usr/bin/docker"
|
||||||
"/usr/bin/docker"
|
"/usr/bin/dockerd"
|
||||||
"/usr/bin/dockerd"
|
"/usr/bin/docker-containerd"
|
||||||
"/usr/bin/docker-containerd"
|
"/usr/bin/docker-containerd-shim"
|
||||||
"/usr/bin/docker-containerd-shim"
|
"/usr/bin/docker-proxy"
|
||||||
"/usr/bin/docker-proxy"
|
"/usr/bin/docker-runc"
|
||||||
"/usr/bin/docker-runc"
|
"/usr/lib/coreos/dockerd"
|
||||||
"/usr/lib/coreos/dockerd"
|
)
|
||||||
)
|
ebuild_aci_create "users.developer.core-os.net/skim/docker" \
|
||||||
ebuild_aci_create "users.developer.core-os.net/skim/docker" "coreos_docker-${version}-${BOARD}" "app-emulation/docker" "${version}" "${packaged_files[@]}"
|
"coreos_docker-${BOARD}-${version}_coreos.${aci_version}" \
|
||||||
;;
|
"app-emulation/docker" \
|
||||||
*)
|
"${version}" \
|
||||||
1>&2 echo "Unrecognized version; please enter a supported version"
|
"${aci_version}" \
|
||||||
exit 1
|
"${packaged_files[@]}"
|
||||||
;;
|
;;
|
||||||
esac
|
*)
|
||||||
done
|
1>&2 echo "Unrecognized version; please enter a supported version"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
@ -57,6 +57,7 @@ ebuild_aci_create() {
|
|||||||
local output_image="${1?No output file specified}"; shift
|
local output_image="${1?No output file specified}"; shift
|
||||||
local pkg="${1?No package given}"; shift
|
local pkg="${1?No package given}"; shift
|
||||||
local version="${1?No package version given}"; shift
|
local version="${1?No package version given}"; shift
|
||||||
|
local extra_version="${1?No extra version number given}"; shift
|
||||||
local pkg_files=( "${@}" )
|
local pkg_files=( "${@}" )
|
||||||
|
|
||||||
local staging_image="coreos_pkg_staging_aci_stage.bin"
|
local staging_image="coreos_pkg_staging_aci_stage.bin"
|
||||||
@ -75,11 +76,10 @@ ebuild_aci_create() {
|
|||||||
trap "cleanup_mounts '${aciroot}/rootfs' && delete_prompt" EXIT
|
trap "cleanup_mounts '${aciroot}/rootfs' && delete_prompt" EXIT
|
||||||
|
|
||||||
# Substitute variables into the manifest to produce the final version.
|
# Substitute variables into the manifest to produce the final version.
|
||||||
# TODO: tag with the right version
|
|
||||||
ebuild_aci_write_manifest \
|
ebuild_aci_write_manifest \
|
||||||
"${aciroot}/manifest" \
|
"${aciroot}/manifest" \
|
||||||
"${aci_name}" \
|
"${aci_name}" \
|
||||||
"${version}"
|
"${version}_coreos.${extra_version}"
|
||||||
|
|
||||||
local pkg_files_in_rootfs=( "${pkg_files[@]/#/rootfs}" )
|
local pkg_files_in_rootfs=( "${pkg_files[@]/#/rootfs}" )
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user