add sync script

This commit is contained in:
2025-12-19 09:59:31 +01:00
parent 3e305a371d
commit d8adcdcc6e
2 changed files with 25 additions and 15 deletions

View File

@@ -1,20 +1,21 @@
when:
event: [ tag ]
steps:
build:
image: plugins/kaniko
settings:
repo: ${FORGE_NAME}/${CI_REPO}
registry:
from_secret: container_registry
tags: latest,${CI_COMMIT_SHA},${CI_COMMIT_TAG}
from_secret: local_registry
tags: latest,${CI_COMMIT_TAG}
username:
from_secret: container_registry_username
from_secret: local_username
password:
from_secret: container_registry_password
build-args: "BASE_URL=https://minimal-setups.de, RELEASETAG=${CI_COMMIT_SHA}"
from_secret: local_password
build-args: "BASE_URL=https://minimal-setups.de, RELEASETAG=${CI_COMMIT_TAG}"
dockerfile: Dockerfile
when:
- event: [push,tag]
scan:
image: quay.io/wollud1969/woodpecker-helper:0.5.1
@@ -30,7 +31,7 @@ steps:
commands:
- export GOPATH=/woodpecker/go # the export is required, otherwise trivy will not consider the variable
- HOME=/home/`id -nu`
- TAG="${CI_COMMIT_TAG:-$CI_COMMIT_SHA}"
- TAG="${CI_COMMIT_TAG:-$CI_COMMIT_TAG}"
- |
trivy image \
--server $TRIVY_URL \
@@ -38,7 +39,7 @@ steps:
--format cyclonedx \
--scanners license \
--output /tmp/sbom.xml \
$FORGE_NAME/$CI_REPO:$CI_COMMIT_SHA
$FORGE_NAME/$CI_REPO:$CI_COMMIT_TAG
- cat /tmp/sbom.xml
- |
curl -X "POST" \
@@ -49,9 +50,6 @@ steps:
-F "projectVersion=$TAG" \
-F "bom=@/tmp/sbom.xml"\
"$DTRACK_API_URL/api/v1/bom"
when:
- event: [push, tag]
deploy:
image: portainer/kubectl-shell:latest
@@ -59,10 +57,8 @@ steps:
KUBE_CONFIG_CONTENT:
from_secret: kube_config
commands:
- export IMAGE_TAG=$CI_COMMIT_SHA
- export IMAGE_TAG=$CI_COMMIT_TAG
- printf "$KUBE_CONFIG_CONTENT" > /tmp/kubeconfig
- export KUBECONFIG=/tmp/kubeconfig
- ./deployment/deploy.sh
when:
- event: [push,tag]

14
sync_from_obsidian.sh Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/bash
set -ex
SRC_DIR=~/Obsiadian/default
SRC_PUBLIC=${SRC_DIR}/Public
SRC_PUBLIC_STATIC=${SRC_DIR}/Public_Static
DEST_DIR=~/Workspace/minimal-setups/content
DEST_PUBLIC_DIR=${DEST_DIR}/snippets
DEST_PUBLIC_STATIC_DIR=${DEST_DIR}/static
rsync -av ${SRC_PUBLIC_DIR} ${DEST_PUBLIC_DIR}
rsync -av ${SRC_PUBLIC_STATIC_DIR} ${DEST_PUBLIC_STATIC_DIR}