1
0

Update to latest xe-solutions

Signed-off-by: James Ketrenos <james.p.ketrenos@intel.com>
This commit is contained in:
James Ketrenos 2021-01-19 12:03:40 -08:00
parent 74dd261246
commit b26d1e5df5
7 changed files with 38 additions and 35 deletions

View File

@ -61,32 +61,33 @@ PROJECT=$(echo ${REGISTRY_URL#*/}/${CONTAINER} | sed s,/,%2F,g)
HEADER="Authorization:Basic $(echo -n "${HARBOR_USER}:${HARBOR_PASSWD}" | base64)" HEADER="Authorization:Basic $(echo -n "${HARBOR_USER}:${HARBOR_PASSWD}" | base64)"
# Try and delete build tag 5 times, with a 10s delay between attempts delete_tag() {
# _project=$1
iter=5 _repository=$2
while (( iter )); do _tag=$3
echo -e "Deleting tag:\n ${CONTAINER}:${TAG}\nFrom:\n ${PROJECT}" _fqdn=${REGISTRY_URL%%/*}
_repository=${_repository//\//%2F}
RESULTS=$(curl --noproxy '*' -s -k \ curl --noproxy '*' -s -k \
-i \ -i \
-X DELETE \ -X DELETE \
-H "${HEADER}" \ -H "${HEADER}" \
-H "accept: application/json" \ -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 # 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." echo "Tag deleted successfully."
break break
else else
echo "Error deleting tag:" >&2 echo "Error deleting tag:" >&2
echo "${RESULTS}" >&2 echo "${RESULTS}" >&2
iter=$((iter-1))
if (( ! iter )); then
fail "No more tries."
fi
echo "Waiting 10s before trying again..."
sleep 10
fi
done done
iter=5 iter=5

View File

@ -28,14 +28,18 @@ Usage: scripts/trigger.sh [OPTIONS]
Options: Options:
-h Help -h This text
-q Quiet -p PROJECT Project name.
-p PROJECT Project to trigger GitLab CI 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 EOF
} }
while getopts ydqp:h opt; do while getopts ydqp:hg: opt; do
case "${opt}" in case "${opt}" in
h) h)
usage usage
@ -44,6 +48,9 @@ while getopts ydqp:h opt; do
q) q)
QUIET=1 QUIET=1
;; ;;
g)
GROUP=${OPTARG}
;;
p) p)
PROJECT=${OPTARG} PROJECT=${OPTARG}
;; ;;
@ -91,7 +98,8 @@ REF=${REF:-master}
PROJECT=${PROJECT:-${CONTAINER}} PROJECT=${PROJECT:-${CONTAINER}}
PROJECT=${PROJECT:-$(basename $(pwd))} 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') URI_PROJECT=$(echo ${PROJECT} | sed -E 's,/,%2F,g')
eval $(grep ^SYS_OSGC_TOKEN SECRETS) eval $(grep ^SYS_OSGC_TOKEN SECRETS)

View File

@ -5,3 +5,5 @@ ENV GPGPU_PACKAGE_REPOSITORY "${PACKAGE_REPOSITORY}"
ENV GPGPU_PACKAGE_STREAM "${PACKAGE_STREAM}" ENV GPGPU_PACKAGE_STREAM "${PACKAGE_STREAM}"
ENV GPGPU_PACKAGE_DISTRO "${OS_DISTRO}" ENV GPGPU_PACKAGE_DISTRO "${OS_DISTRO}"
ENV GPGPU_PACKAGE_DISTRO_RELEASE "${OS_RELEASE}" ENV GPGPU_PACKAGE_DISTRO_RELEASE "${OS_RELEASE}"
USER user

View File

@ -17,5 +17,3 @@ RUN groupadd -r user \
# Set 'wheel' to NOPASSWD for all container users # Set 'wheel' to NOPASSWD for all container users
RUN sed -i -e 's,%wheel.*,%wheel ALL=(ALL) NOPASSWD:ALL,g' /etc/sudoers RUN sed -i -e 's,%wheel.*,%wheel ALL=(ALL) NOPASSWD:ALL,g' /etc/sudoers
USER user

View File

@ -16,5 +16,3 @@ RUN groupadd -r user \
# Set 'wheel' to NOPASSWD for all container users # Set 'wheel' to NOPASSWD for all container users
RUN sed -i -e 's,%wheel.*,%wheel ALL=(ALL) NOPASSWD:ALL,g' /etc/sudoers RUN sed -i -e 's,%wheel.*,%wheel ALL=(ALL) NOPASSWD:ALL,g' /etc/sudoers
USER user

View File

@ -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 # Needed for env values set which are needed by the base OS, eg zypper
# and *_proxy *_PROXY... # and *_proxy *_PROXY...
RUN echo "Defaults !env_reset" >> /etc/sudoers RUN echo "Defaults !env_reset" >> /etc/sudoers
USER user

View File

@ -28,5 +28,3 @@ RUN sed -i -e 's,%sudo.*,%sudo ALL=(ALL) NOPASSWD:ALL,g' /etc/sudoers
RUN apt-get clean \ RUN apt-get clean \
&& rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} && rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log}
USER user