diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4ee2814..c9417cf 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 81a62c3..e94ace5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 }} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5d26471 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.tox/* +context/* diff --git a/LICENSE b/LICENSE index 4796609..c8b6f84 100644 --- a/LICENSE +++ b/LICENSE @@ -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 diff --git a/context/Dockerfile b/context/Dockerfile deleted file mode 100644 index 63f163c..0000000 --- a/context/Dockerfile +++ /dev/null @@ -1,31 +0,0 @@ -ARG EE_BASE_IMAGE=quay.io/ansible/ansible-runner:latest -ARG EE_BUILDER_IMAGE=quay.io/ansible/ansible-builder:latest - -FROM $EE_BASE_IMAGE as galaxy -ARG ANSIBLE_GALAXY_CLI_COLLECTION_OPTS= -USER root - -ADD _build /build -WORKDIR /build - -RUN ansible-galaxy role install -r requirements.yml --roles-path /usr/share/ansible/roles -RUN ansible-galaxy collection install $ANSIBLE_GALAXY_CLI_COLLECTION_OPTS -r requirements.yml --collections-path /usr/share/ansible/collections - -FROM $EE_BUILDER_IMAGE as builder - -COPY --from=galaxy /usr/share/ansible /usr/share/ansible - -ADD _build/requirements.txt requirements.txt -ADD _build/bindep.txt bindep.txt -RUN ansible-builder introspect --sanitize --user-pip=requirements.txt --user-bindep=bindep.txt --write-bindep=/tmp/src/bindep.txt --write-pip=/tmp/src/requirements.txt -RUN assemble - -FROM $EE_BASE_IMAGE -USER root - -COPY --from=galaxy /usr/share/ansible /usr/share/ansible - -COPY --from=builder /output/ /output/ -RUN /output/install-from-bindep && rm -rf /output/wheels -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 diff --git a/context/_build/bindep.txt b/context/_build/bindep.txt deleted file mode 100644 index 881e15c..0000000 --- a/context/_build/bindep.txt +++ /dev/null @@ -1,4 +0,0 @@ -kubernetes-client [platform:fedora] -openshift-clients [platform:rhel-8] -wget -openssl diff --git a/context/_build/requirements.txt b/context/_build/requirements.txt deleted file mode 100644 index bd5341c..0000000 --- a/context/_build/requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -kubernetes>=12.0.0 -requests-oauthlib -jsonpatch -boto -botocore -boto3 diff --git a/context/_build/requirements.yml b/context/_build/requirements.yml deleted file mode 100644 index 14643e3..0000000 --- a/context/_build/requirements.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -collections: - - name: kubernetes.core diff --git a/execution-environment.yml b/execution-environment.yml index 368eeb1..842f1a7 100644 --- a/execution-environment.yml +++ b/execution-environment.yml @@ -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