Update to latest xe-solutions
Signed-off-by: James Ketrenos <james.p.ketrenos@intel.com>
This commit is contained in:
parent
74dd261246
commit
b26d1e5df5
@ -61,32 +61,33 @@ PROJECT=$(echo ${REGISTRY_URL#*/}/${CONTAINER} | sed s,/,%2F,g)
|
||||
|
||||
HEADER="Authorization:Basic $(echo -n "${HARBOR_USER}:${HARBOR_PASSWD}" | base64)"
|
||||
|
||||
# Try and delete build tag 5 times, with a 10s delay between attempts
|
||||
#
|
||||
iter=5
|
||||
while (( iter )); do
|
||||
echo -e "Deleting tag:\n ${CONTAINER}:${TAG}\nFrom:\n ${PROJECT}"
|
||||
|
||||
RESULTS=$(curl --noproxy '*' -s -k \
|
||||
delete_tag() {
|
||||
_project=$1
|
||||
_repository=$2
|
||||
_tag=$3
|
||||
_fqdn=${REGISTRY_URL%%/*}
|
||||
_repository=${_repository//\//%2F}
|
||||
curl --noproxy '*' -s -k \
|
||||
-i \
|
||||
-X DELETE \
|
||||
-H "${HEADER}" \
|
||||
-H "accept: application/json" \
|
||||
"https://${FQDN}/api/repositories/${PROJECT}/tags/${TAG}")
|
||||
"https://${_fqdn}/api/v2.0/projects/${_project}/repositories/${_repository}/artifacts/${_tag}"
|
||||
|
||||
if echo ${RESULTS} | grep -q "HTTP.*200"; then
|
||||
echo "Tag deleted successfully."
|
||||
break
|
||||
else
|
||||
echo "Error deleting tag:" >&2
|
||||
echo "${RESULTS}" >&2
|
||||
iter=$((iter-1))
|
||||
if (( ! iter )); then
|
||||
fail "No more tries."
|
||||
fi
|
||||
echo "Waiting 10s before trying again..."
|
||||
sleep 10
|
||||
fi
|
||||
# To just delete the tag and not the image, use:
|
||||
# "https://${_fqdn}/api/v2.0/projects/${_project}/repositories/${_repository}/artifacts/${_tag}/tags/${_tag}"
|
||||
}
|
||||
|
||||
echo -e "Deleting tag:\n vtt-osgc solutions/${CONTAINER}:${TAG}\nFrom:\n ${PROJECT}"
|
||||
|
||||
RESULTS=$(delete_tag vtt-osgc solutions/${CONTAINER} ${TAG})
|
||||
|
||||
if echo ${RESULTS} | grep -q "HTTP.*200"; then
|
||||
echo "Tag deleted successfully."
|
||||
break
|
||||
else
|
||||
echo "Error deleting tag:" >&2
|
||||
echo "${RESULTS}" >&2
|
||||
done
|
||||
|
||||
iter=5
|
||||
|
@ -28,14 +28,18 @@ Usage: scripts/trigger.sh [OPTIONS]
|
||||
|
||||
Options:
|
||||
|
||||
-h Help
|
||||
-q Quiet
|
||||
-p PROJECT Project to trigger GitLab CI
|
||||
|
||||
-h This text
|
||||
-p PROJECT Project name.
|
||||
Default: Current directory name
|
||||
-q Quiet output (for use in scripting.) Only output
|
||||
pipeline ID (if successfully started.)
|
||||
-y Answer Yes to any prompts
|
||||
-g GROUP Group path under GitLab URL
|
||||
Default: vtt/sws/osgc/solutions
|
||||
EOF
|
||||
}
|
||||
|
||||
while getopts ydqp:h opt; do
|
||||
while getopts ydqp:hg: opt; do
|
||||
case "${opt}" in
|
||||
h)
|
||||
usage
|
||||
@ -44,6 +48,9 @@ while getopts ydqp:h opt; do
|
||||
q)
|
||||
QUIET=1
|
||||
;;
|
||||
g)
|
||||
GROUP=${OPTARG}
|
||||
;;
|
||||
p)
|
||||
PROJECT=${OPTARG}
|
||||
;;
|
||||
@ -91,7 +98,8 @@ REF=${REF:-master}
|
||||
|
||||
PROJECT=${PROJECT:-${CONTAINER}}
|
||||
PROJECT=${PROJECT:-$(basename $(pwd))}
|
||||
PROJECT="vtt/sws/osgc/solutions/${PROJECT}"
|
||||
GROUP=${GROUP:-"vtt/sws/osgc/solutions"}
|
||||
PROJECT="${GROUP}/${PROJECT}"
|
||||
URI_PROJECT=$(echo ${PROJECT} | sed -E 's,/,%2F,g')
|
||||
|
||||
eval $(grep ^SYS_OSGC_TOKEN SECRETS)
|
||||
|
@ -5,3 +5,5 @@ ENV GPGPU_PACKAGE_REPOSITORY "${PACKAGE_REPOSITORY}"
|
||||
ENV GPGPU_PACKAGE_STREAM "${PACKAGE_STREAM}"
|
||||
ENV GPGPU_PACKAGE_DISTRO "${OS_DISTRO}"
|
||||
ENV GPGPU_PACKAGE_DISTRO_RELEASE "${OS_RELEASE}"
|
||||
|
||||
USER user
|
||||
|
@ -17,5 +17,3 @@ RUN groupadd -r user \
|
||||
|
||||
# Set 'wheel' to NOPASSWD for all container users
|
||||
RUN sed -i -e 's,%wheel.*,%wheel ALL=(ALL) NOPASSWD:ALL,g' /etc/sudoers
|
||||
|
||||
USER user
|
@ -16,5 +16,3 @@ RUN groupadd -r user \
|
||||
|
||||
# Set 'wheel' to NOPASSWD for all container users
|
||||
RUN sed -i -e 's,%wheel.*,%wheel ALL=(ALL) NOPASSWD:ALL,g' /etc/sudoers
|
||||
|
||||
USER user
|
@ -31,5 +31,3 @@ RUN sed -i -e 's,^ALL.*,%users ALL=(ALL) NOPASSWD:ALL,g' /etc/sudoers
|
||||
# Needed for env values set which are needed by the base OS, eg zypper
|
||||
# and *_proxy *_PROXY...
|
||||
RUN echo "Defaults !env_reset" >> /etc/sudoers
|
||||
|
||||
USER user
|
@ -28,5 +28,3 @@ RUN sed -i -e 's,%sudo.*,%sudo ALL=(ALL) NOPASSWD:ALL,g' /etc/sudoers
|
||||
|
||||
RUN apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log}
|
||||
|
||||
USER user
|
Loading…
x
Reference in New Issue
Block a user