Skip to content

Commit

Permalink
feature(v0.0.1): initial version (#1)
Browse files Browse the repository at this point in the history
Should replicate secrets and configmaps using ns-object-mirror/to annotation.
Should not replicate self-annotation to prevent infinite copy loop.
Should not replicate if data has not changed.
Should not replicate if annotations have not changed.
Should replicate new annotations if updated.
Should replicate new data if updated.
  • Loading branch information
DragonStuff authored Apr 6, 2024
2 parents c369958 + 6b970d9 commit 06e9a20
Show file tree
Hide file tree
Showing 6 changed files with 657 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: CI/CD Workflow

on: [push]

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Create k8s Kind Cluster
uses: helm/kind-action@v1
with:
cluster_name: kind

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.10.14

- name: Install dependencies
run: |
pip install pipenv
pipenv install --dev
- name: Run tests
run: |
pipenv run python test.py
build_and_push:
needs: test
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

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

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ghcr.io/${{ github.repository_owner }}/ns-object-mirror:latest
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Use an official Python runtime as a parent image
FROM python:3.10

# Set the working directory in the container
WORKDIR /usr/src/app

# Install pipenv
RUN pip install --upgrade pip && \
pip install pipenv

# Copy Pipfile to the working directory
COPY Pipfile /usr/src/app/

# Install any needed packages specified in Pipfile
RUN pipenv install --deploy --ignore-pipfile

# Copy the current directory contents into the container at /usr/src/app
COPY . /usr/src/app

# Run run.sh when the container launches
CMD ["pipenv", "run", "python", "app.py"]
12 changes: 12 additions & 0 deletions Pipfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"

[packages]
kubernetes = "*"

[dev-packages]

[requires]
python_version = "3.10"
Loading

0 comments on commit 06e9a20

Please sign in to comment.