Compare commits
9 commits
Author | SHA1 | Date | |
---|---|---|---|
fda90f4ecc | |||
8073c813d0 | |||
8defbc2215 | |||
949f56cd9d | |||
ec0bda0403 | |||
09f83a581f | |||
4693c26a9e | |||
0115b95544 | |||
3535ca52b1 |
6 changed files with 69 additions and 100 deletions
|
@ -1,91 +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.21.2
|
||||
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
|
||||
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 ${{ job.status }} in ${{ github.repository }}"
|
||||
body: |
|
||||
Repo: ${{ github.repository }}
|
||||
Job: ${{ github.action }}
|
||||
Status: ${{ job.status }}
|
||||
Source: ${{ github.head_ref }}
|
||||
|
||||
build:
|
||||
needs: [gitleaks, hadolint] # shellcheck
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
- name: Extract repository name
|
||||
id: name
|
||||
run: |
|
||||
echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: |
|
||||
registry.mgrote.net/${{ steps.name.outputs.REPO_NAME }}
|
||||
tags: |
|
||||
type=raw,value=latest,enable={{is_default_branch}}
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
- 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: Build and push Docker image
|
||||
uses: https://github.com/docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
- name: Send notification
|
||||
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 ${{ job.status }} in ${{ github.repository }}"
|
||||
body: |
|
||||
Repo: ${{ github.repository }}
|
||||
Job: ${{ github.action }}
|
||||
Status: ${{ job.status }}
|
||||
Source: ${{ github.head_ref }}
|
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.20.3
|
||||
FROM alpine:latest
|
||||
|
||||
# hadolint ignore=DL3018
|
||||
RUN apk add --no-cache \
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
# 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.
|
||||
|
||||
## Usage
|
||||
|
||||
```yaml
|
||||
version: "3"
|
||||
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_DEPLOY_KEY: "/neu" # path to deploy-key for the git-repository
|
||||
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
|
||||
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