Compare commits
30 Commits
master
...
developmen
Author | SHA1 | Date | |
---|---|---|---|
726ba483da | |||
a51155b6d8 | |||
5823ea1849 | |||
9fdff31347 | |||
3f27002d19 | |||
5279aa6c4c | |||
36e58ca7be | |||
164013a5b8 | |||
d2426892da | |||
f2fb6a3540 | |||
9c04001d95 | |||
95bceb22df | |||
0e73168147 | |||
f0f697b9c8 | |||
d776962590 | |||
97e850fbd1 | |||
311c139727 | |||
f487bdb896 | |||
2e86c82c88 | |||
f06766484d | |||
7ca4715aa8 | |||
0a92925d09 | |||
7018418c32 | |||
e594b70828 | |||
ab316b65a4 | |||
39650ded8c | |||
5113fc2596 | |||
3e81328f67 | |||
67bf6c4b6a | |||
25bfcf6679 |
@ -17,6 +17,7 @@ include:
|
||||
- template/automagic.gitlab-ci.yaml
|
||||
#- template: Jobs/Container-Scanning.gitlab-ci.yml # see https://gitlab.com/gitlab-org/gitlab/-/issues/381665
|
||||
|
||||
|
||||
.MKDocs_Build:
|
||||
image: python:3.11-buster
|
||||
|
||||
@ -61,3 +62,57 @@ Build/Cache Python Packages:
|
||||
allow_failure: true
|
||||
when: manual
|
||||
- when: never
|
||||
|
||||
|
||||
Docker Container:
|
||||
extends: .build_docker_container
|
||||
resource_group: build
|
||||
needs: []
|
||||
script:
|
||||
- update-binfmts --display
|
||||
- |
|
||||
|
||||
if [ "0$DOCKER_IMAGE_BUILD_TARGET_PLATFORMS" != "0" ]; then
|
||||
|
||||
echo "[DEBUG] building multiarch/specified arch image";
|
||||
|
||||
docker buildx build --platform=$DOCKER_IMAGE_BUILD_TARGET_PLATFORMS . \
|
||||
--label org.opencontainers.image.created="$(date '+%Y-%m-%d %H:%M:%S%:z')" \
|
||||
--label org.opencontainers.image.documentation="$CI_PROJECT_URL" \
|
||||
--label org.opencontainers.image.source="$CI_PROJECT_URL" \
|
||||
--label org.opencontainers.image.revision="$CI_COMMIT_SHA" \
|
||||
--push \
|
||||
--build-arg CI_JOB_TOKEN=$CI_JOB_TOKEN --build-arg CI_PROJECT_ID=$CI_PROJECT_ID --build-arg CI_API_V4_URL=$CI_API_V4_URL \
|
||||
--build-arg CI_COMMIT_SHA=$CI_COMMIT_SHA \
|
||||
--file $DOCKER_DOCKERFILE \
|
||||
--tag $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG;
|
||||
|
||||
docker buildx imagetools inspect $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG;
|
||||
|
||||
# during docker multi platform build there are >=3 additional unknown images added to gitlab container registry. cleanup
|
||||
|
||||
DOCKER_MULTI_ARCH_IMAGES=$(docker buildx imagetools inspect "$DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG" --format "{{ range .Manifest.Manifests }}{{ if ne (print .Platform) \"&{unknown unknown [] }\" }}$DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG@{{ println .Digest }}{{end}} {{end}}");
|
||||
|
||||
docker buildx imagetools create $DOCKER_MULTI_ARCH_IMAGES --tag $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG;
|
||||
|
||||
docker buildx imagetools inspect $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG;
|
||||
|
||||
else
|
||||
|
||||
echo "[DEBUG] building image";
|
||||
|
||||
docker build . \
|
||||
--label org.opencontainers.image.created="$(date '+%Y-%m-%d %H:%M:%S%:z')" \
|
||||
--label org.opencontainers.image.documentation="$CI_PROJECT_URL" \
|
||||
--label org.opencontainers.image.source="$CI_PROJECT_URL" \
|
||||
--label org.opencontainers.image.url="$CI_PROJECT_URL/-/releases/$(cz -n cz_nfc version --project)" \
|
||||
--label org.opencontainers.image.version="$(cz -n cz_nfc version --project)" \
|
||||
--label org.opencontainers.image.revision="$CI_COMMIT_SHA" \
|
||||
--build-arg CI_JOB_TOKEN=$CI_JOB_TOKEN --build-arg CI_PROJECT_ID=$CI_PROJECT_ID --build-arg CI_API_V4_URL=$CI_API_V4_URL \
|
||||
--build-arg CI_COMMIT_SHA=$CI_COMMIT_SHA \
|
||||
--file $DOCKER_DOCKERFILE \
|
||||
--tag $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG;
|
||||
|
||||
docker push $DOCKER_IMAGE_BUILD_REGISTRY/$DOCKER_IMAGE_BUILD_NAME:$DOCKER_IMAGE_BUILD_TAG;
|
||||
|
||||
fi
|
@ -8,6 +8,8 @@
|
||||
|
||||

|
||||
|
||||
[](https://hub.docker.com/r/nofusscomputing/ansible-ee) [](https://artifacthub.io/packages/container/nfc-ansible-ee/ansible-ee)
|
||||
|
||||
<br>
|
||||
|
||||
  [](https://gitlab.com/nofusscomputing/projects/ansible/execution_environment/-/issues)
|
||||
|
18
dockerfile
18
dockerfile
@ -2,6 +2,7 @@ ARG release_name=bookworm
|
||||
|
||||
ARG kubernetes_version=1.29
|
||||
|
||||
ARG CI_COMMIT_SHA=""
|
||||
|
||||
FROM --platform=$TARGETPLATFORM quay.io/ansible/receptor:v1.4.4 as receptor
|
||||
|
||||
@ -33,7 +34,9 @@ RUN curl -fsSL https://pkgs.k8s.io/core:/stable:/v${kubernetes_version}/deb/Rele
|
||||
|
||||
FROM --platform=$TARGETPLATFORM python:3.11-slim-${release_name}
|
||||
|
||||
ARG CI_COMMIT_SHA
|
||||
|
||||
ENV REPO_BUILD_SHA=${CI_COMMIT_SHA}
|
||||
# Ansible chucks a wobbler without. see: https://github.com/ansible/ansible/issues/78283
|
||||
ENV LC_ALL en_US.UTF-8
|
||||
|
||||
@ -49,16 +52,11 @@ COPY includes /
|
||||
|
||||
# Ref: https://github.com/opencontainers/image-spec/blob/d86384efdb8c30770a92415c100f57a9bffbb64e/annotations.md
|
||||
LABEL \
|
||||
# org.opencontainers.image.authors="{contributor url}" \
|
||||
org.opencontainers.image.vendor="No Fuss Computing" \
|
||||
# org.opencontainers.image.url="{dockerhub url}" \
|
||||
# org.opencontainers.image.documentation="{docs url}" \
|
||||
# org.opencontainers.image.source="{repo url}" \
|
||||
# org.opencontainers.image.revision="{git commit sha at time of build}" \
|
||||
org.opencontainers.image.title="No Fuss Computings Ansible Execution Environment" \
|
||||
org.opencontainers.image.description="An ansible execution environment for awx/tower and CI/CD pipelines" \
|
||||
org.opencontainers.image.vendor="No Fuss Computing"
|
||||
# org.opencontainers.image.version="{git tag}"
|
||||
org.opencontainers.image.title="Ansible Execution Environment" \
|
||||
org.opencontainers.image.description="An ansible execution environment for aap/awx and CI/CD pipelines" \
|
||||
org.opencontainers.image.vendor="No Fuss Computing" \
|
||||
io.artifacthub.package.license="MIT"
|
||||
|
||||
|
||||
RUN apt update \
|
||||
@ -148,5 +146,5 @@ RUN ansible-galaxy collection install \
|
||||
theforeman.foreman==4.0.0; \
|
||||
ansible-galaxy collection install --pre \
|
||||
nofusscomputing.glpi==0.1.0-a1 \
|
||||
nofusscomputing.kubernetes==1.13.0 \
|
||||
nofusscomputing.kubernetes==1.13.2 \
|
||||
nofusscomputing.netbox==0.4.0
|
||||
|
Submodule gitlab-ci updated: 673441f83a...224ef83157
Submodule includes/etc/ansible/playbooks updated: ed4f20d49c...8b940d30ff
Submodule includes/etc/ansible/roles updated: 7e7d208cf1...73c8bc6f96
Reference in New Issue
Block a user