-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adopts the code from https://github.com/ansible/ansible-workspace-env-reference-image project.
- Loading branch information
Showing
22 changed files
with
512 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
tests/conftest.py | ||
DOC503: Method `Infrastructure.__post_init__` exceptions in the "Raises" section in the docstring do not match those in the function body Raises values in the docstring: ['ValueError', 'ValueError', 'ValueError']. Raised exceptions in the body: ['ValueError']. | ||
-------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--- | ||
name: Build & Test | ||
description: Build the final container image and run tests on it | ||
|
||
inputs: | ||
registry: | ||
description: Target registry to push the final image. | ||
default: "localhost:5000" | ||
namespace: | ||
description: Namespace of the container image. | ||
default: ansible | ||
final_image: | ||
description: Name of the final image. | ||
default: ansible-workspace-env-reference | ||
publish: | ||
description: Publish the image to ghcr.io | ||
default: "false" | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Prepare | ||
shell: bash | ||
run: | | ||
platform=${{ matrix.platform }} | ||
echo "PLATFORM_PAIR=${platform//\//-}" >> $GITHUB_ENV | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
with: | ||
# network=host driver-opt needed to push to local registry | ||
driver-opts: network=host | ||
buildkitd-flags: --debug | ||
|
||
- name: Build final image | ||
id: build-final | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: ${{ github.workspace }}/devspaces/context | ||
provenance: false | ||
file: ${{ github.workspace }}/devspaces/Containerfile | ||
load: true | ||
tags: | | ||
${{ inputs.namespace }}/${{ inputs.final_image }}:test | ||
# cache-from: type=gha,scope=build-${{ env.PLATFORM_PAIR }} | ||
# cache-to: type=gha,scope=build-${{ env.PLATFORM_PAIR }} | ||
|
||
- name: Docker meta | ||
id: meta | ||
if: ${{ inputs.publish == 'true' }} | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ghcr.io/${{ inputs.namespace }}/${{ inputs.final_image }} | ||
flavor: | | ||
latest=false | ||
tags: | | ||
type=raw,value=latest | ||
type=ref,event=tag | ||
- name: Push the built image to ghcr.io | ||
id: push-final | ||
if: ${{ inputs.publish == 'true' }} | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: ${{ github.workspace }}/devspaces/context | ||
provenance: false | ||
file: ${{ github.workspace }}/devspaces/Containerfile | ||
tags: ${{ steps.meta.outputs.tags }} | ||
push: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -175,5 +175,5 @@ cython_debug/ | |
_readthedocs | ||
|
||
# ansible-builder | ||
context | ||
collections | ||
/context | ||
/collections |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
python3-devel | ||
python3-devel [platform:redhat] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Version created and populated by setuptools_scm | ||
/src/ansible_creator/_version.py | ||
|
||
dist/ | ||
|
||
build/ | ||
|
||
*.egg-info | ||
|
||
*.ruff_cache/ | ||
|
||
*.mypy_cache/ | ||
|
||
*.pytest_cache/ | ||
|
||
*.tox/ | ||
|
||
__pycache__/ | ||
.cache | ||
_readthedocs | ||
.coverage | ||
coverage.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM quay.io/devfile/universal-developer-image:ubi8-latest | ||
|
||
ARG PYV=3.11 | ||
|
||
LABEL org.opencontainers.image.source=https://github.com/ansible/ansible-workspace-env-reference-image | ||
LABEL org.opencontainers.image.authors="Ansible DevTools" | ||
LABEL org.opencontainers.image.vendor="Red Hat" | ||
LABEL org.opencontainers.image.licenses="GPL-3.0" | ||
LABEL org.opencontainers.image.description="An OpenShift Dev Spaces container image for Ansible." | ||
|
||
USER 0 | ||
|
||
WORKDIR /context | ||
# install ansible-dev-tools specific packages and dependencies while avoiding | ||
# adding multiple layers to the image. | ||
RUN --mount=type=bind,target=. --mount=type=cache,dst=/var/cache/dnf --mount=type=cache,dst=/root/.cache/pip ./setup.sh | ||
|
||
USER 10001 |
Oops, something went wrong.