-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into szinn-add-checkout-token
- Loading branch information
Showing
137 changed files
with
8,047 additions
and
3,704 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Docker environment for local development in devcontainer | ||
|
||
FROM ubuntu:jammy-20231128 | ||
|
||
RUN apt-get update --fix-missing && \ | ||
apt-get upgrade -y && \ | ||
apt-get install -y --fix-missing \ | ||
curl \ | ||
unzip \ | ||
software-properties-common \ | ||
vim \ | ||
git \ | ||
python3-pip | ||
|
||
COPY --from=docker.io/bitnami/kubectl:1.29.0 /opt/bitnami/kubectl/bin/kubectl /usr/local/bin/kubectl | ||
COPY --from=registry.k8s.io/kustomize/kustomize:v5.3.0 /app/kustomize /usr/local/bin/kustomize | ||
COPY --from=ghcr.io/kyverno/kyverno-cli:v1.11.3 /ko-app/kubectl-kyverno /usr/local/bin/kyverno | ||
COPY --from=docker.io/alpine/helm:3.13.3 /usr/bin/helm /usr/local/bin/helm | ||
COPY --from=ghcr.io/fluxcd/flux-cli:v2.2.2 /usr/local/bin/flux /usr/local/bin/flux | ||
|
||
COPY requirements.txt /src/ | ||
RUN pip3 install -r /src/requirements.txt | ||
|
||
SHELL ["/bin/bash", "-c"] |
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,9 +1,13 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/kubernetes-helm | ||
{ | ||
"name": "Kubernetes - Local Configuration", | ||
"build": { | ||
"context": "..", | ||
"dockerfile": "../Dockerfile" | ||
} | ||
"dockerfile": "./Dockerfile" | ||
}, | ||
// Creates a local volume where you the developer need to clone the git | ||
// repo inside the container. Uses a local volume since this project | ||
// relies heavily on local disk performance. | ||
//"workspaceMount": "source=flux-local,target=/workspaces,type=volume", | ||
//"workspaceFolder": "/workspaces/", | ||
//"postCreateCommand": "chown vscode /workspaces", | ||
} |
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,53 @@ | ||
--- | ||
name: Container Release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: | | ||
ghcr.io/${{ github.repository }} | ||
flavor: | | ||
latest=true | ||
prefix=v | ||
tags: | | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
type=semver,pattern={{major}} | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and Push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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,52 @@ | ||
--- | ||
name: Container Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
if: ${{ github.event.pull_request.head.repo.full_name == 'allenporter/flux-local' || github.event_name != 'pull_request' }} | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: | | ||
ghcr.io/${{ github.repository }} | ||
tags: | | ||
type=ref,event=branch | ||
type=ref,event=pr | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to GitHub Container Registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and Push | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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 |
---|---|---|
|
@@ -28,6 +28,8 @@ jobs: | |
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup Flux CLI | ||
uses: fluxcd/flux2/[email protected] | ||
- uses: ./action/diff | ||
id: diff | ||
with: | ||
|
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 |
---|---|---|
|
@@ -24,6 +24,8 @@ jobs: | |
- tests/testdata/cluster7 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Flux CLI | ||
uses: fluxcd/flux2/[email protected] | ||
- uses: ./action/test | ||
with: | ||
enable-helm: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,29 +19,28 @@ jobs: | |
python-version: | ||
- "3.10" | ||
- "3.11" | ||
- "3.12" | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
- name: Setup Flux CLI | ||
uses: fluxcd/flux2/[email protected] | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
cache: "pip" | ||
cache: pip | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install -r requirements.txt | ||
pip install -e . | ||
- uses: supplypike/setup-bin@v3 | ||
with: | ||
uri: https://github.com/kyverno/kyverno/releases/download/v1.9.0/kyverno-cli_v1.9.0_linux_x86_64.tar.gz | ||
uri: https://github.com/kyverno/kyverno/releases/download/v1.11.3/kyverno-cli_v1.11.3_linux_x86_64.tar.gz | ||
name: kyverno-cli | ||
version: v1.9.0 | ||
version: v1.11.3 | ||
- name: Test with pytest | ||
run: | | ||
SKIP_DIFF_TESTS=1 pytest --cov=flux_local --cov-report=term-missing | ||
- name: Test with pytest pydantic v1 | ||
run: | | ||
pip install pydantic==1.10.11 | ||
SKIP_DIFF_TESTS=1 pytest --cov=flux_local --cov-report=term-missing | ||
SKIP_DIFF_TESTS=1 pytest --cov=flux_local --cov-report=term-missing --snapshot-warn-unused | ||
- uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
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 |
---|---|---|
|
@@ -16,7 +16,7 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
|
@@ -26,7 +26,7 @@ jobs: | |
- name: Build package | ||
run: python -m build | ||
- name: Publish package | ||
uses: pypa/[email protected].10 | ||
uses: pypa/[email protected].11 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
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 |
---|---|---|
@@ -1,47 +1,21 @@ | ||
# Docker environment for local development in devcontainer | ||
FROM ubuntu:jammy-20231004 | ||
FROM python:3.12-alpine as base | ||
|
||
RUN apt-get update --fix-missing && \ | ||
apt-get upgrade -y && \ | ||
apt-get install -y --fix-missing \ | ||
curl \ | ||
unzip \ | ||
software-properties-common \ | ||
vim \ | ||
git \ | ||
python3-pip | ||
RUN apk add --no-cache ca-certificates git | ||
|
||
# renovate: datasource=github-releases depName=kubernetes-sigs/kustomize | ||
ARG KUSTOMIZE_VERSION=v5.0.3 | ||
RUN cd /usr/local/bin/ && \ | ||
curl -OL https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2F${KUSTOMIZE_VERSION}/kustomize_${KUSTOMIZE_VERSION}_linux_amd64.tar.gz && \ | ||
tar xf kustomize_${KUSTOMIZE_VERSION}_linux_amd64.tar.gz && \ | ||
chmod +x kustomize | ||
RUN kustomize version | ||
WORKDIR /app | ||
COPY requirements.txt /requirements.txt | ||
COPY flux_local/ ./flux_local | ||
COPY setup.py . | ||
COPY setup.cfg . | ||
|
||
# renovate: datasource=github-releases depName=helm/helm | ||
ARG HELM_CLI_VERSION=v3.12.1 | ||
RUN mkdir -p /src && \ | ||
cd /src && \ | ||
curl -OL https://get.helm.sh/helm-${HELM_CLI_VERSION}-linux-amd64.tar.gz && \ | ||
tar xf helm-${HELM_CLI_VERSION}-linux-amd64.tar.gz && \ | ||
cp linux-amd64/helm /usr/local/bin/helm && \ | ||
rm -fr /src | ||
RUN helm version | ||
RUN pip install --no-cache-dir -r /requirements.txt | ||
RUN pip install -e . | ||
|
||
# renovate: datasource=github-releases depName=kyverno/kyverno | ||
ARG KYVERNO_VERSION=v1.10.0 | ||
RUN mkdir -p /src && \ | ||
cd /src && \ | ||
curl -OL https://github.com/kyverno/kyverno/releases/download/${KYVERNO_VERSION}/kyverno-cli_${KYVERNO_VERSION}_linux_x86_64.tar.gz && \ | ||
tar xf kyverno-cli_${KYVERNO_VERSION}_linux_x86_64.tar.gz && \ | ||
cp kyverno /usr/local/bin/kyverno && \ | ||
chmod +x /usr/local/bin/kyverno && \ | ||
rm -fr /src | ||
RUN kyverno version | ||
COPY --from=ghcr.io/fluxcd/flux-cli:v2.2.2 /usr/local/bin/flux /usr/local/bin/flux | ||
COPY --from=docker.io/alpine/helm:3.13.3 /usr/bin/helm /usr/local/bin/helm | ||
COPY --from=docker.io/bitnami/kubectl:1.29.0 /opt/bitnami/kubectl/bin/kubectl /usr/local/bin/kubectl | ||
COPY --from=registry.k8s.io/kustomize/kustomize:v5.3.0 /app/kustomize /usr/local/bin/kustomize | ||
COPY --from=ghcr.io/kyverno/kyverno-cli:v1.11.3 /ko-app/kubectl-kyverno /usr/local/bin/kyverno | ||
|
||
COPY . /src/ | ||
WORKDIR /src/ | ||
RUN pip3 install -r /src/requirements.txt | ||
|
||
SHELL ["/bin/bash", "-c"] | ||
USER 1001 | ||
ENTRYPOINT ["/usr/local/bin/flux-local"] |
Oops, something went wrong.