diff --git a/stream8_snapshots.nomad b/stream8_snapshots.nomad index a1751cd7d6a5a1a780bdbd1d0ad5ac1da0884767..ecd98de469c213ec9918f5e7493869e8e7eb40df 100644 --- a/stream8_snapshots.nomad +++ b/stream8_snapshots.nomad @@ -34,7 +34,8 @@ job "${PREFIX}_stream8_snapshots" { "$CEPHTMP:/cephtmp", "/etc/nomad/submit_token:/secrets/token", "/etc/nomad/ssh-id_ed25519:/root/.ssh/id_ed25519", - "/etc/nomad/linuxci_api_token:/secrets/linuxci_api_token" + "/etc/nomad/linuxci_api_token:/secrets/linuxci_api_token", + "/etc/nomad/linuxci_pw:/secrets/linuxci_pw" ] } diff --git a/stream8_snapshots/Dockerfile b/stream8_snapshots/Dockerfile index 862290dff4ad461fd32e9157bf51fc6f70f8b9e2..44d711bb88172d32b0d580dc9c8074412ab0b57c 100644 --- a/stream8_snapshots/Dockerfile +++ b/stream8_snapshots/Dockerfile @@ -3,7 +3,7 @@ FROM gitlab-registry.cern.ch/linuxsupport/c8-base:latest COPY linuxsupport8-stable.repo /etc/yum.repos.d/ RUN dnf install -y epel-release \ - && dnf install -y dnf-utils swaks gettext createrepo git jq file sqlite + && dnf install -y dnf-utils swaks gettext createrepo git jq file sqlite aims2client COPY *.sh *.tpl /root/ WORKDIR /root diff --git a/stream8_snapshots/aims.sh b/stream8_snapshots/aims.sh new file mode 100755 index 0000000000000000000000000000000000000000..109b3ea1631f974ea675f652f9903fe075ea5342 --- /dev/null +++ b/stream8_snapshots/aims.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +source /root/common.sh + +TMPDIR=$1 +POINT=$3 + +# Rather than introduce a new variable, test if $DESTINATION is not prod +if [ "$DESTINATION" != "/data/cern/centos" ]; then + TEST="--testserver" +fi + +cat /secrets/linuxci_pw | kinit linuxci + +for ARCH in $CENTOS_ARCHES; do + NAME="C${RELEASE^^}${POINT^^}_${ARCH^^}" + DESC="CENTOS STREAM 8 (${TODAY}) ${ARCH^^}" + PATH="${TMPDIR}/BaseOS/${ARCH}/os/images/pxeboot" + + if [[ $2 == $LN_TESTING ]]; then + NAME="${NAME}_TEST" + DESC="${DESC} TEST" + fi + + /usr/bin/aims2client ${TEST} delimg "${NAME}" + + echo "Uploading image to AIMS: ${NAME} - ${DESC}" + /usr/bin/aims2client ${TEST} addimg \ + --name "${NAME}" \ + --description "${DESC}" \ + --arch "${ARCH}" \ + --vmlinuz "${PATH}/vmlinuz" \ + --initrd "${PATH}/initrd.img" \ + --uefi +done diff --git a/stream8_snapshots/movelinks.sh b/stream8_snapshots/movelinks.sh index 505413ad9a0cedf908c21a20e46c681ee56c164a..be2bb2486646096d238f58eaf112b32fdbede1d7 100755 --- a/stream8_snapshots/movelinks.sh +++ b/stream8_snapshots/movelinks.sh @@ -118,6 +118,7 @@ if [[ "$TODAY_KERNELFAM" != "$LAST_POINT_KERNELFAM" ]]; then if [[ ! -e "${NEW_POINT_RELEASE}" ]]; then # It does not, so we have a new point release! setLink $SNAPS_DIR/$TODAY $NEW_POINT_RELEASE + /root/aims.sh $SNAPS_DIR/$TODAY "point" "$(/bin/date +%Y.%q)" fi fi @@ -125,8 +126,10 @@ fi if [[ $SHORTEST_TEST == 0 ]]; then /root/sendemail.sh $TMPDIR $LN_TESTING + /root/aims.sh $SNAPS_DIR/$TODAY $LN_TESTING fi if [[ $SHORTEST_PROD == 0 ]]; then /root/sendemail.sh $TMPDIR + /root/aims.sh $SNAPS_DIR/$DELAYED fi