develop #1

Merged
wt merged 2 commits from develop into main 2025-07-25 18:12:30 +07:00
6 changed files with 81 additions and 0 deletions
+10
View File
@@ -12,3 +12,13 @@ jobs:
run: go mod download && go mod tidy
- name: Build
run: go build
Build-And-Push-Docker-Image:
runs-on: archlinux-amd64
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Build Image
run: docker build -t gitea.home.com:3000/tolamironcenko/scm:202507 .
- name: Push Image
run: docker push gitea.home.com:3000/tolamironcenko/scm:202507
+1
View File
@@ -1,3 +1,4 @@
scm
go.sum
certs
data
+21
View File
@@ -0,0 +1,21 @@
FROM golang:1.24.5-alpine AS build-stage
WORKDIR /app
COPY . .
RUN apk update && \
apk upgrade && \
apk add binutils && \
go mod tidy && \
go build && \
strip scm
FROM alpine:latest AS build-release-stage
WORKDIR /data
COPY --from=build-stage /app/scm /scm
RUN mkdir -p /certs
COPY scm.conf.docker /data/scm.conf
ENTRYPOINT [ "/scm" ]
+11
View File
@@ -0,0 +1,11 @@
services:
scm:
build:
context: .
dockerfile: Dockerfile
container_name: scm_server
ports:
- "8777:8777"
volumes:
- ./data:/data
- ./certs:/certs
+6
View File
@@ -0,0 +1,6 @@
ENABLE_TLS=false
CERTS_PATH=/certs
SERVER_ADDRESS=0.0.0.0
SERVER_PORT=8777
+32
View File
@@ -0,0 +1,32 @@
#!/bin/sh
#--- import colors and init-funcs ---
. /usr/lib/init/colors.sh
. /usr/lib/init/init-funcs.sh
#------------------------------------
start() {
notify "Starting scm"
/usr/bin/scm &
echo $(pgrep scm) > /var/run/scm.pid
check $? "start scm"
return $?
}
stop() {
notify "Stopping scm"
kill $(cat /var/run/scm.pid)
check $? "stop scm"
rm /var/run/scm.pid &> /dev/null
return $?
}
case "$1" in
start|stop|restart|reload|help)
"$1"
;;
*)
help
return 1
esac
return $?