Skip to content

Commit

Permalink
feat: move to ansible-builder
Browse files Browse the repository at this point in the history
  • Loading branch information
sbaerlocher committed Jan 25, 2024
1 parent 6595062 commit 5997f5e
Show file tree
Hide file tree
Showing 10 changed files with 87 additions and 55 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- uses: actions/setup-python@v2
with:
python-version: "3.9"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Build EE with Docker
env:
DOCKER_BUILDKIT: 1
run: |
tox -e docker
- name: Login to DockerHub
uses: docker/login-action@v1
with:
Expand Down
35 changes: 32 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

name: Testing Container
on: [push]
jobs:
Expand All @@ -14,8 +13,38 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- uses: actions/setup-python@v2
with:
python-version: "3.9"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Build EE with Docker
env:
DOCKER_BUILDKIT: 1
run: |
tox -e docker
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: sbaerlocher
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v2
with:
context: context
push: false
push: true
tags: |
ghcr.io/arillso/kubernetes:${{ github.sha }}
arillso/kubernetes:${{ github.sha }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.tox/*
context/*
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2021 Arillso
Copyright (c) 2023 Arillso

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
31 changes: 0 additions & 31 deletions context/Dockerfile

This file was deleted.

4 changes: 0 additions & 4 deletions context/_build/bindep.txt

This file was deleted.

6 changes: 0 additions & 6 deletions context/_build/requirements.txt

This file was deleted.

3 changes: 0 additions & 3 deletions context/_build/requirements.yml

This file was deleted.

18 changes: 11 additions & 7 deletions execution-environment.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
---
version: 1
version: 3

dependencies:
galaxy: requirements.yml
python: requirements.txt
system: bindep.txt
galaxy: requirements.yml
python: requirements.txt
system: bindep.txt

additional_build_steps:
append:
- RUN wget https://get.helm.sh/helm-v3.7.1-linux-amd64.tar.gz -O - | tar -xz && mv linux-amd64/helm /usr/bin/helm && chmod +x /usr/bin/helm && rm -rf linux-amd64
- RUN wget https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v4.5.4/kustomize_v4.5.4_linux_amd64.tar.gz -O - | tar -xz && mv kustomize /usr/bin/kustomize && chmod +x /usr/bin/kustomize
append_final:
- RUN wget https://get.helm.sh/helm-v3.14.0-linux-amd64.tar.gz -O - | tar -xz && mv linux-amd64/helm /usr/bin/helm && chmod +x /usr/bin/helm && rm -rf linux-amd64
- RUN wget https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize/v5.3.0/kustomize_v5.3.0_linux_amd64.tar.gz -O - | tar -xz && mv kustomize /usr/bin/kustomize && chmod +x /usr/bin/kustomize

images:
base_image:
name: ghcr.io/ansible-community/community-ee-minimal:2.15.4-2
26 changes: 26 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[tox]
minversion = 1.6
skipsdist = True

[testenv]
basepython = python3
install_command = pip install {opts} {packages}
deps = -r{toxinidir}/requirements.txt

[testenv:podman]
passenv = HOME
allowlist_externals =
/bin/bash
podman
commands =
/bin/bash -c "podman rmi quay.io/ansible/awx-ee:latest || true"
ansible-builder build -v3 -t quay.io/ansible/awx-ee {posargs}

[testenv:docker]
passenv = HOME,DOCKER_BUILDKIT
allowlist_externals =
/bin/bash
docker
commands =
/bin/bash -c "docker rmi quay.io/ansible/awx-ee:latest || true"
ansible-builder build -v3 -t quay.io/ansible/awx-ee {posargs} --container-runtime=docker

0 comments on commit 5997f5e

Please sign in to comment.