-
Notifications
You must be signed in to change notification settings - Fork 278
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding docker ci images getter scripts (#3960)
Signed-off-by: Peter Zhu <[email protected]>
- Loading branch information
1 parent
db6c998
commit 811ec92
Showing
1 changed file
with
72 additions
and
0 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,72 @@ | ||
#!/bin/bash | ||
|
||
# Copyright OpenSearch Contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# | ||
# The OpenSearch Contributors require contributions made to | ||
# this file be licensed under the Apache-2.0 license or a | ||
# compatible open source license. | ||
|
||
# This script is to return the latest ci docker images | ||
|
||
set -e | ||
|
||
function usage() { | ||
echo "" | ||
echo "This script is used to return the latest ci docker images (mostly used in distribution build or integtest pipelines)" | ||
echo "This script will not return any older images, please check 'manifests' directory for those images" | ||
echo "--------------------------------------------------------------------------" | ||
echo "Usage: $0 [args]" | ||
echo "" | ||
echo "Required arguments:" | ||
echo -e "-p PLATFORM\tSpecify the ci image target platform, e.g. 'rockylinux8(default)', 'centos7', 'ubuntu2004' or 'windows2019-servercore'" | ||
echo -e "-u USAGE\tSpecify the ci image target usage, e.g. 'opensearch(default)' or 'opensearch-dashboards' or 'systemd-base'" | ||
echo -e "-t TYPE\tSpecify the usages ci image target type, e.g. 'build(default)' or 'integtest'" | ||
echo "" | ||
echo "Optional arguments:" | ||
echo -e "-h\t\tPrint this message." | ||
echo "--------------------------------------------------------------------------" | ||
} | ||
|
||
while getopts ":hp:u:t:" arg; do | ||
case $arg in | ||
h) | ||
usage | ||
exit 1 | ||
;; | ||
p) | ||
PLATFORM=$OPTARG | ||
;; | ||
u) | ||
USAGE=$OPTARG | ||
;; | ||
t) | ||
TYPE=$OPTARG | ||
;; | ||
:) | ||
echo "-${OPTARG} requires an argument" | ||
usage | ||
exit 1 | ||
;; | ||
?) | ||
echo "Invalid option: -${arg}" | ||
exit 1 | ||
;; | ||
esac | ||
done | ||
|
||
# Validate the required parameters to present | ||
if [ -z "$PLATFORM" ]; then | ||
PLATFORM="rockylinux8" | ||
fi | ||
|
||
if [ -z "$USAGE" ]; then | ||
USAGE="opensearch" | ||
fi | ||
|
||
if [ -z "$TYPE" ]; then | ||
TYPE="build" | ||
fi | ||
|
||
# Run script | ||
crane ls public.ecr.aws/opensearchstaging/ci-runner | grep -Eo '.*v[0-9]' | sort -r | uniq | grep $PLATFORM-$USAGE-$TYPE |