added docker image and CI/CD (git action) to limbosolutions docker registry
This commit is contained in:
32
.gitea/ docker-image.deploy.yml
Normal file
32
.gitea/ docker-image.deploy.yml
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- "docker/**"
|
||||||
|
- ".gitea/**"
|
||||||
|
schedule:
|
||||||
|
- cron: "0 02 * * *"
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
build-docker-image:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Log in to git.limbosolutions.com docker registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: git.limbosolutions.com
|
||||||
|
username: ${{ secrets.GITLIMBO_DOCKER_REGISTRY_USERNAME }}
|
||||||
|
password: ${{ secrets.GITLIMBO_DOCKER_REGISTRY_PASSWORD }}
|
||||||
|
|
||||||
|
- name: Build and push Docker images
|
||||||
|
id: push
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ${{gitea.workspace}}/docker/Dockerfile
|
||||||
|
push: true
|
||||||
|
tags: git.limbosolutions.com/kb/borg-backup
|
||||||
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
**.local.**
|
||||||
6
.vscode/settings.json
vendored
Normal file
6
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
{
|
||||||
|
"cSpell.words": [
|
||||||
|
"ffenv",
|
||||||
|
"GITLIMBO"
|
||||||
|
]
|
||||||
|
}
|
||||||
15
docker-compose.dev.yml
Normal file
15
docker-compose.dev.yml
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
# image: #"git.limbosolutions.com/kb/borg:latest"
|
||||||
|
|
||||||
|
services:
|
||||||
|
borg:
|
||||||
|
build:
|
||||||
|
dockerfile: /docker/dockerfile
|
||||||
|
context: .
|
||||||
|
environment:
|
||||||
|
- BORG_REPO=${BORG_REPO}
|
||||||
|
- BORG_RSH=${BORG_RSH}
|
||||||
|
- BORG_PASSPHRASE=${BORG_PASSPHRASE}
|
||||||
|
- SSH_ID=${SSH_ID}
|
||||||
|
- BORG_KEY=${BORG_KEY}
|
||||||
|
|
||||||
|
|
||||||
18
docker/Dockerfile
Normal file
18
docker/Dockerfile
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
FROM ubuntu:latest
|
||||||
|
|
||||||
|
|
||||||
|
RUN apt-get update
|
||||||
|
|
||||||
|
|
||||||
|
RUN apt-get install -y \
|
||||||
|
python3 \
|
||||||
|
python3-pip \
|
||||||
|
borgbackup \
|
||||||
|
fuse \
|
||||||
|
python3-pyfuse3 \
|
||||||
|
openssh-client
|
||||||
|
|
||||||
|
COPY ./docker/app /app
|
||||||
|
RUN chmod +x /app/scripts/ffenv
|
||||||
|
RUN ln -s /app/scripts/ffenv /usr/local/lib/ffenv
|
||||||
|
|
||||||
19
docker/app/scripts/ffenv
Normal file
19
docker/app/scripts/ffenv
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
echo "checking SSH_ID..."
|
||||||
|
if [[ "${SSH_ID}" ]]; then
|
||||||
|
echo "found SSH_ID..."
|
||||||
|
mkdir -p /root/.ssh
|
||||||
|
echo "${SSH_ID}" > /root/.ssh/id_rsa
|
||||||
|
chmod 700 /root/.ssh/id_rsa
|
||||||
|
fi
|
||||||
|
echo "checking BORG_KEY..."
|
||||||
|
if [[ "${BORG_KEY}" ]]; then
|
||||||
|
echo "found BORG_KEY..."
|
||||||
|
mkdir -p /root/.config/borg/keys
|
||||||
|
echo "${BORG_KEY}" > /root/.config/borg/keys/key
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user