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 a94cf10
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 77 deletions.
36 changes: 21 additions & 15 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,38 @@ jobs:
runs-on: ubuntu-latest

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

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- uses: actions/setup-python@v5
with:
python-version: "3.9"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
pip install ansible-builder
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build EE with Docker
env:
DOCKER_BUILDKIT: 1
run: |
ansible-builder build -v3 --tag=ghcr.io/arillso/kubernetes:latest --tag=arillso/kubernetes:latest --container-runtime=docker
- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: sbaerlocher
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v1
uses: docker/login-action@v3
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: true
tags: |
ghcr.io/arillso/kubernetes:latest
arillso/kubernetes:latest
- name: Push
run: |
docker push ghcr.io/arillso/kubernetes:latest
docker push arillso/kubernetes:latest
44 changes: 34 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,45 @@

name: Testing Container
on: [push]

jobs:
testing:
runs-on: ubuntu-latest

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

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

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ansible-builder
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Set branch name environment variable
run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\//-/g')" >> $GITHUB_ENV

- name: Build and push
uses: docker/build-push-action@v2
- name: Build EE with Docker
env:
DOCKER_BUILDKIT: 1
run: |
ansible-builder build -v3 --tag=ghcr.io/arillso/kubernetes:${{ env.BRANCH_NAME }} --tag=arillso/kubernetes:${{ env.BRANCH_NAME }} --container-runtime=docker
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: sbaerlocher
password: ${{ secrets.DOCKERHUB_TOKEN }}

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

- name: Push
run: |
docker push ghcr.io/arillso/kubernetes:${{ env.BRANCH_NAME }}
docker push arillso/kubernetes:${{ env.BRANCH_NAME }}
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

0 comments on commit a94cf10

Please sign in to comment.