20 Commits

Author SHA1 Message Date
Renovate Bot 83fb7bd532 Update module github.com/spf13/pflag to v1.0.10 2026-06-22 13:46:00 +00:00
nate.lubitz 01223c176f Merge pull request 'Configure Renovate' (#1) from renovate/configure into main
Publish Action Image / build (push) Successful in 29s
Reviewed-on: #1
2026-06-22 13:28:14 +00:00
Renovate Bot 0610651cf0 Add renovate.json 2026-06-22 13:25:48 +00:00
nate.lubitz 5d257a786e validate false
Publish Action Image / build (push) Successful in 28s
2026-06-05 17:07:33 +10:00
nate.lubitz 1d19b08b7e add security scans
Publish Action Image / build (push) Successful in 1m9s
2026-06-05 17:02:41 +10:00
nate.lubitz 70593fe0a3 missing dot
Publish Action Image / build (push) Successful in 28s
2026-06-05 16:58:57 +10:00
nate.lubitz f02cf329d6 skip regcred
Publish Action Image / build (push) Successful in 27s
2026-06-05 16:55:58 +10:00
nate.lubitz 4ed2e2c8b1 add validate false flag
Publish Action Image / build (push) Successful in 34s
2026-06-05 16:54:25 +10:00
nate.lubitz 115484ce0d too many added
Publish Action Image / build (push) Successful in 29s
2026-06-05 16:51:40 +10:00
nate.lubitz 95ef2f8a28 just use insecure flag
Publish Action Image / build (push) Successful in 29s
2026-06-05 16:49:47 +10:00
nate.lubitz 747d22f8be Update entrypoint.sh
Publish Action Image / build (push) Successful in 39s
2026-06-04 18:39:13 +00:00
nate.lubitz f09a243d8a wrong side validate
Publish Action Image / build (push) Successful in 37s
2026-06-05 04:34:06 +10:00
nate.lubitz 986863b064 disable verify tls
Publish Action Image / build (push) Successful in 37s
2026-06-05 04:30:17 +10:00
nate.lubitz da774ae051 validate false
Publish Action Image / build (push) Successful in 39s
2026-06-05 04:23:46 +10:00
nate.lubitz dd781f4cd6 move cleanup
Publish Action Image / build (push) Successful in 49s
2026-06-05 04:17:30 +10:00
nate.lubitz 15551103ec cert debugging
Publish Action Image / build (push) Successful in 43s
2026-06-05 04:13:57 +10:00
nate.lubitz 8f13825087 typo
Publish Action Image / build (push) Successful in 34s
2026-06-05 04:07:46 +10:00
nate.lubitz 5a0505a9ea remove bash, make temp file
Publish Action Image / build (push) Failing after 34s
2026-06-05 04:05:00 +10:00
nate.lubitz 188453d534 use bash instead
Publish Action Image / build (push) Successful in 1m22s
2026-06-05 03:59:20 +10:00
nate.lubitz 699a2ddd2c add docker-cli
Publish Action Image / build (push) Successful in 1m33s
2026-06-05 03:46:56 +10:00
6 changed files with 55 additions and 12 deletions
+4 -2
View File
@@ -5,9 +5,11 @@ RUN go build -o kforge .
FROM alpine:3.19 FROM alpine:3.19
COPY --from=builder /app/kforge /usr/local/bin/kforge COPY --from=builder /app/kforge /usr/local/bin/kforge
RUN apk add --no-cache curl && \ RUN apk add --no-cache curl docker-cli && \
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && \ curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" && \
install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl && \
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin
COPY entrypoint.sh /entrypoint.sh COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh RUN chmod +x /entrypoint.sh
+9
View File
@@ -40,6 +40,15 @@ inputs:
description: "Kubernetes service account token" description: "Kubernetes service account token"
required: true required: true
scan_image:
description: "Scan image for vulnerabilities before pushing"
required: false
default: "true"
scan_severity:
description: "Fail on these severity levels (UNKNOWN,LOW,MEDIUM,HIGH,CRITICAL)"
required: false
default: "HIGH,CRITICAL"
# outputs: # outputs:
# output_file: # output_file:
# description: "Path to the generated Kubernetes YAML file" # description: "Path to the generated Kubernetes YAML file"
+35 -8
View File
@@ -67,6 +67,15 @@ if [ -n "$INPUT_IMAGE_NAME" ]; then
if [ -n "$INPUT_IMAGE_TAG" ]; then if [ -n "$INPUT_IMAGE_TAG" ]; then
echo "Building image $FULL_IMAGE:$INPUT_IMAGE_TAG..." echo "Building image $FULL_IMAGE:$INPUT_IMAGE_TAG..."
docker build -t "$FULL_IMAGE:$INPUT_IMAGE_TAG" -f "$INPUT_DOCKERFILE" . docker build -t "$FULL_IMAGE:$INPUT_IMAGE_TAG" -f "$INPUT_DOCKERFILE" .
echo "Scanning image for vulnerabilities..."
trivy image \
--exit-code 1 \
--severity "$INPUT_SCAN_SEVERITY" \
--no-progress \
"$FULL_IMAGE:$INPUT_IMAGE_TAG"
echo "Scan passed, pushing image..."
docker push "$FULL_IMAGE:$INPUT_IMAGE_TAG" docker push "$FULL_IMAGE:$INPUT_IMAGE_TAG"
else else
SHA=$(echo "$GITHUB_SHA" | cut -c1-7) SHA=$(echo "$GITHUB_SHA" | cut -c1-7)
@@ -75,6 +84,15 @@ if [ -n "$INPUT_IMAGE_NAME" ]; then
-t "$FULL_IMAGE:latest" \ -t "$FULL_IMAGE:latest" \
-t "$FULL_IMAGE:$SHA" \ -t "$FULL_IMAGE:$SHA" \
-f "$INPUT_DOCKERFILE" . -f "$INPUT_DOCKERFILE" .
echo "Scanning image for vulnerabilities..."
trivy image \
--exit-code 1 \
--severity "$INPUT_SCAN_SEVERITY" \
--no-progress \
"$FULL_IMAGE:latest"
echo "Scan passed, pushing image..."
docker push "$FULL_IMAGE:latest" docker push "$FULL_IMAGE:latest"
docker push "$FULL_IMAGE:$SHA" docker push "$FULL_IMAGE:$SHA"
@@ -93,9 +111,15 @@ echo "Generating Kubernetes YAML from .kforge.yml"
# ---------------------------------------------------------------- # ----------------------------------------------------------------
# Build kubeconfig from token-based credentials # Build kubeconfig from token-based credentials
echo "Configuring kubectl..." echo "Configuring kubectl..."
# Try writing the cert and check if it worked
echo "$INPUT_KUBE_CERTIFICATE" | base64 -d > /tmp/kube-ca.crt 2>&1
echo "Cert file size: $(wc -c < /tmp/kube-ca.crt)"
echo "Cert file contents: $(cat /tmp/kube-ca.crt | head -1)"
kubectl config set-cluster default \ kubectl config set-cluster default \
--server="$INPUT_KUBE_HOST" \ --server="$INPUT_KUBE_HOST" \
--certificate-authority=<(echo "$INPUT_KUBE_CERTIFICATE" | base64 -d) --certificate-authority=/tmp/kube-ca.crt
kubectl config set-credentials default \ kubectl config set-credentials default \
--token="$INPUT_KUBE_TOKEN" --token="$INPUT_KUBE_TOKEN"
@@ -106,14 +130,17 @@ kubectl config set-context default \
kubectl config use-context default kubectl config use-context default
# Create/update regcred secret idempotently # Create/update regcred secret idempotently
echo "Creating regcred secret..." # echo "Creating regcred secret..."
kubectl create secret docker-registry regcred \ # kubectl create secret docker-registry regcred \
--docker-server="$INPUT_REGISTRY" \ # --docker-server="$INPUT_REGISTRY" \
--docker-username="$INPUT_REGISTRY_USERNAME" \ # --docker-username="$INPUT_REGISTRY_USERNAME" \
--docker-password="$INPUT_REGISTRY_PASSWORD" \ # --docker-password="$INPUT_REGISTRY_PASSWORD" \
--dry-run=client -o yaml | kubectl apply -f - # --dry-run=client -o yaml | kubectl apply -f - --insecure-skip-tls-verify --validate=false
echo "Deploying to Kubernetes..." echo "Deploying to Kubernetes..."
kubectl apply -f ./kforge-out/ kubectl apply --insecure-skip-tls-verify --validate=false -f ./.kforge-out/
echo "Deploy complete." echo "Deploy complete."
echo "Cleanup"
rm -f /tmp/kube-ca.crt
+1 -1
View File
@@ -4,7 +4,7 @@ go 1.22
require ( require (
github.com/spf13/cobra v1.8.0 github.com/spf13/cobra v1.8.0
github.com/spf13/pflag v1.0.5 github.com/spf13/pflag v1.0.10
gopkg.in/yaml.v3 v3.0.1 gopkg.in/yaml.v3 v3.0.1
) )
+2
View File
@@ -6,6 +6,8 @@ github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/pflag v1.0.10 h1:4EBh2KAYBwaONj6b2Ye1GiHfwjqyROoF4RwYO+vPwFk=
github.com/spf13/pflag v1.0.10/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+3
View File
@@ -0,0 +1,3 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json"
}