Skip to content

Commit

Permalink
Merge pull request #84 from mbargull/bot-rebuild-2024-06
Browse files Browse the repository at this point in the history
bot: Rebuild with latest versions
  • Loading branch information
mbargull authored Jun 2, 2024
2 parents 98ea236 + c4fa576 commit d0c22db
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 36 deletions.
86 changes: 55 additions & 31 deletions .github/workflows/bot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,37 @@ jobs:
packages: "anaconda-client skopeo"
- tag: update
packages: "git openssh"
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
container:
# travier/podman-action contains newer podman/buildah versions.
image: quay.io/travier/podman-action
options: --privileged
env:
IMAGE_NAME: bot
IMAGE_VERSION: '1.3.1'
IMAGE_VERSION: '1.4.0'

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Install Tools
run: |
set -eu
# jq is not installed in travier/podman-action
dnf install -qy \
jq
rpm -q \
buildah podman \
coreutils findutils sed \
curl jq \
| (
while read -r line ; do
printf %s\\n "${line}"
case "${line}" in (*' not installed'*)
err=1 ;;
esac
done
exit "${err-0}"
)
- name: Build
id: buildah-build
Expand Down Expand Up @@ -63,35 +87,35 @@ jobs:
done
buildah rmi --prune || true
#- name: Check Tags
# run: |
# # FIX upstream: Quay.io does not support immutable images currently.
# # => Try to use the REST API to check for duplicate tags.
# respone="$(
# curl -sL \
# 'https://quay.io/api/v1/repository/bioconda/${{ steps.buildah-build.outputs.image }}/image'
# )"
- name: Check Tags
run: |
# FIX upstream: Quay.io does not support immutable images currently.
# => Try to use the REST API to check for duplicate tags.
respone="$(
curl -sL \
'https://quay.io/api/v1/repository/bioconda/${{ steps.buildah-build.outputs.image }}/tag/'
)"
# existing_tags="$(
# printf %s "${respone}" \
# | jq -r '.images[].tags[]'
# )" \
# || {
# printf %s\\n \
# 'Could not get list of image tags.' \
# 'Does the repository exist on Quay.io?' \
# 'Quay.io REST API response was:' \
# "${respone}"
# exit 1
# }
# for tag in ${{ steps.buildah-build.outputs.tags }} ; do
# if [ \! "${tag}" = '${{ matrix.tag }}' ] ; then
# if printf %s "${existing_tags}" | grep -qxF "${tag}" ; then
# printf 'Tag %s already exists!\n' "${tag}"
# exit 1
# fi
# fi
# done
existing_tags="$(
printf %s "${respone}" \
| jq -r '.tags[]|select(.end_ts == null or .end_ts >= now)|.name'
)" \
|| {
printf %s\\n \
'Could not get list of image tags.' \
'Does the repository exist on Quay.io?' \
'Quay.io REST API response was:' \
"${respone}"
exit 1
}
for tag in ${{ steps.buildah-build.outputs.tags }} ; do
if [ \! "${tag}" = '${{ matrix.tag }}' ] ; then
if printf %s "${existing_tags}" | grep -qxF "${tag}" ; then
printf 'Tag %s already exists!\n' "${tag}"
exit 1
fi
fi
done
- if: ${{ github.ref == 'refs/heads/main' }}
name: Push
Expand Down
7 changes: 2 additions & 5 deletions images/bot/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ARG base=quay.io/bioconda/base-glibc-busybox-bash:2.1.0
ARG base=quay.io/bioconda/base-glibc-busybox-bash:latest

FROM quay.io/bioconda/create-env as build
## If gettext pulls in libxml2, use one that doesn't bloat the image with ICU.
Expand All @@ -18,13 +18,11 @@ FROM quay.io/bioconda/create-env as build
# && \
# conda-build -m .ci_support/linux_64_.yaml recipe/
ARG packages=
ARG python=3.8
ARG prefix=/usr/local
RUN . /opt/create-env/env-activate.sh && \
export CONDA_ADD_PIP_AS_PYTHON_DEPENDENCY=0 \
&& \
create-env \
--conda=mamba \
--strip-files=\* \
--remove-paths=\*.a \
--remove-paths=\*.c \
Expand All @@ -43,10 +41,9 @@ RUN . /opt/create-env/env-activate.sh && \
--channel=conda-forge \
--override-channels \
pip wheel setuptools \
python="${python}" \
python\>=3.8 \
aiohttp \
ca-certificates \
idna\<3 \
pyyaml \
${packages} \
&& \
Expand Down

0 comments on commit d0c22db

Please sign in to comment.