Compare commits
9 commits
Author | SHA1 | Date | |
---|---|---|---|
fda90f4ecc | |||
8073c813d0 | |||
8defbc2215 | |||
949f56cd9d | |||
ec0bda0403 | |||
09f83a581f | |||
4693c26a9e | |||
0115b95544 | |||
3535ca52b1 |
6 changed files with 69 additions and 85 deletions
|
@ -1,76 +0,0 @@
|
||||||
name: "lint, build and push"
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: "23 18 * * SUN"
|
|
||||||
push:
|
|
||||||
branches: [ master ]
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
# Variables: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables + https://forgejo.org/docs/latest/user/actions/#env-1
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
lint:
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: Run Gitleaks
|
|
||||||
uses: docker://zricethezav/gitleaks:v8.18.4
|
|
||||||
with:
|
|
||||||
args: detect --no-git --verbose --source ${{ github.workspace }}
|
|
||||||
- name: Run hadolint
|
|
||||||
uses: docker://pipelinecomponents/hadolint:0.26.4
|
|
||||||
with:
|
|
||||||
args: hadolint Dockerfile
|
|
||||||
# - name: Run ShellCheck
|
|
||||||
# uses: sudo-bot/action-shellcheck@latest
|
|
||||||
# with:
|
|
||||||
# cli-args: "shell.sh"
|
|
||||||
- name: Send notification on error
|
|
||||||
uses: dawidd6/action-send-mail@v3
|
|
||||||
if: failure()
|
|
||||||
with:
|
|
||||||
connection_url: smtp://docker10.mgrote.net:1025
|
|
||||||
secure: false
|
|
||||||
ignore_cert: true
|
|
||||||
to: michael.grote@posteo.de
|
|
||||||
from: Gitea Actions <gitea@mgrote.net>
|
|
||||||
subject: "CI Error in ${{ env.GITHUB_REPOSITORY }}"
|
|
||||||
body: "Job of ${{ env.github.repository }} failed!"
|
|
||||||
|
|
||||||
build:
|
|
||||||
needs: [gitleaks, hadolint] # shellcheck
|
|
||||||
steps:
|
|
||||||
- uses: https://github.com/actions/checkout@v4
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
# - name: Login to Docker Hub
|
|
||||||
# uses: docker/login-action@v3
|
|
||||||
# with:
|
|
||||||
# username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
||||||
# password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
||||||
- name: Extract repository name
|
|
||||||
id: meta
|
|
||||||
run: |
|
|
||||||
echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT
|
|
||||||
- name: Extract branch name
|
|
||||||
shell: bash
|
|
||||||
run: echo "REPO_BRANCH=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
|
|
||||||
id: extract_branch
|
|
||||||
- name: Build and push Docker image
|
|
||||||
uses: https://github.com/docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
file: ./Dockerfile
|
|
||||||
push: true
|
|
||||||
tags: "registry.mgrote.net/${{ steps.meta.outputs.REPO_NAME }}:latest,registry.mgrote.net/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.extract_branch.outputs.REPO_BRANCH }}"
|
|
||||||
- name: Send notification on error
|
|
||||||
uses: dawidd6/action-send-mail@v3
|
|
||||||
if: failure()
|
|
||||||
with:
|
|
||||||
connection_url: smtp://docker10.mgrote.net:1025
|
|
||||||
secure: false
|
|
||||||
ignore_cert: true
|
|
||||||
to: michael.grote@posteo.de
|
|
||||||
from: Gitea Actions <gitea@mgrote.net>
|
|
||||||
subject: "CI Error in ${{ env.GITHUB_REPOSITORY }}"
|
|
||||||
body: Job of ${{ env.github.repository }} failed!
|
|
34
.woodpecker/build.yml
Normal file
34
.woodpecker/build.yml
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: docker_build
|
||||||
|
depends_on:
|
||||||
|
- lint
|
||||||
|
steps:
|
||||||
|
selfhosted_tag:
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
repo: registry.mgrote.net/oxidized-selfmade
|
||||||
|
registry: registry.mgrote.net
|
||||||
|
tags:
|
||||||
|
- ${CI_COMMIT_TAG}
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
- tag
|
||||||
|
|
||||||
|
selfhosted_push:
|
||||||
|
image: plugins/docker
|
||||||
|
settings:
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
repo: registry.mgrote.net/oxidized-selfmade
|
||||||
|
registry: registry.mgrote.net
|
||||||
|
tags:
|
||||||
|
- ${CI_COMMIT_SHA:0:8}
|
||||||
|
- ${CI_COMMIT_BRANCH}
|
||||||
|
- latest
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
exclude:
|
||||||
|
- pull_request
|
||||||
|
- tag
|
31
.woodpecker/lint.yml
Normal file
31
.woodpecker/lint.yml
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: linting
|
||||||
|
steps:
|
||||||
|
gitleaks:
|
||||||
|
image: zricethezav/gitleaks:latest
|
||||||
|
commands:
|
||||||
|
- gitleaks detect --no-git --verbose --source $CI_WORKSPACE
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
exclude:
|
||||||
|
- tag
|
||||||
|
|
||||||
|
hadolint:
|
||||||
|
image: hadolint/hadolint:latest-debian
|
||||||
|
commands:
|
||||||
|
- hadolint Dockerfile
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
exclude:
|
||||||
|
- tag
|
||||||
|
|
||||||
|
shellcheck:
|
||||||
|
image: koalaman/shellcheck-alpine:stable
|
||||||
|
commands:
|
||||||
|
- "find . -name *.sh -exec shellcheck {} +"
|
||||||
|
when:
|
||||||
|
event:
|
||||||
|
exclude:
|
||||||
|
- tag
|
|
@ -1,4 +1,4 @@
|
||||||
FROM alpine:3.19.1
|
FROM alpine:latest
|
||||||
|
|
||||||
# hadolint ignore=DL3018
|
# hadolint ignore=DL3018
|
||||||
RUN apk add --no-cache \
|
RUN apk add --no-cache \
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
# oxidized-selfmade aka routeros-config-export
|
# oxidized-selfmade aka routeros-config-export
|
||||||
|
|
||||||
|
[![status-badge](https://ci.mgrote.net/api/badges/6/status.svg)](https://ci.mgrote.net/repos/6)
|
||||||
|
|
||||||
This is a small script that pulls the config of one or multiple routeros-devices and pushes them into git-repository.
|
This is a small script that pulls the config of one or multiple routeros-devices and pushes them into git-repository.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
version: "3"
|
version: "3"
|
||||||
services:
|
services:
|
||||||
|
@ -23,7 +24,7 @@ services:
|
||||||
GIT_REPO_URL: "ssh://gitea@gitea.grote.lan:2222/mg/testrepo.git" # repo-url in ssh format
|
GIT_REPO_URL: "ssh://gitea@gitea.grote.lan:2222/mg/testrepo.git" # repo-url in ssh format
|
||||||
GIT_REPO_DEPLOY_KEY: "/neu" # path to deploy-key for the git-repository
|
GIT_REPO_DEPLOY_KEY: "/neu" # path to deploy-key for the git-repository
|
||||||
GIT_USERNAME: oxidized-selfmade # username for the commit
|
GIT_USERNAME: oxidized-selfmade # username for the commit
|
||||||
GIT_USER_MAIL: michael.grote@posteo.de # mailaddress for the commit
|
GIT_USER_MAIL: michael.grote@posteo.de # mail for the commit
|
||||||
GIT_REPO_REMOTE_NAME: origin # git-name of the remote
|
GIT_REPO_REMOTE_NAME: origin # git-name of the remote
|
||||||
INTERVAL: 30 # interval, how often should the config be pulled
|
INTERVAL: 30 # interval, how often should the config be pulled
|
||||||
```
|
```
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
{
|
|
||||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
|
||||||
"extends": [
|
|
||||||
"config:recommended"
|
|
||||||
]
|
|
||||||
}
|
|
Loading…
Reference in a new issue