Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
57fd444c29 | ||
|
|
d3f3854f8d | ||
|
|
9f2092b7c5 |
No files matched your search
+3
-3
@@ -12,7 +12,7 @@ pipeline {
|
|||||||
}
|
}
|
||||||
environment {
|
environment {
|
||||||
SERVICE = 'micro-crontab'
|
SERVICE = 'micro-crontab'
|
||||||
IMAGE_REPOSITORY = 'harbor.vitatech.com.cn:19443/backend/micro_layout-crontab'
|
IMAGE_REPOSITORY = 'harbor.vitatech.com.cn:19443/vitavideo/micro_layout-crontab'
|
||||||
DOCKERFILE = 'build/crontab/Dockerfile'
|
DOCKERFILE = 'build/crontab/Dockerfile'
|
||||||
DEPLOY_ROOT = '/home/SHARE/devstack-scb/apps/layout-test'
|
DEPLOY_ROOT = '/home/SHARE/devstack-scb/apps/layout-test'
|
||||||
}
|
}
|
||||||
@@ -29,7 +29,7 @@ pipeline {
|
|||||||
branches: [[name: '*/' + env.SOURCE_BRANCH]],
|
branches: [[name: '*/' + env.SOURCE_BRANCH]],
|
||||||
userRemoteConfigs: [[
|
userRemoteConfigs: [[
|
||||||
url: 'ssh://git@git.vitatech.com.cn:12222/leo/micro_layout.git',
|
url: 'ssh://git@git.vitatech.com.cn:12222/leo/micro_layout.git',
|
||||||
credentialsId: 'gitea-layout-read'
|
credentialsId: 'gitea'
|
||||||
]],
|
]],
|
||||||
extensions: [[$class: 'CleanBeforeCheckout']]
|
extensions: [[$class: 'CleanBeforeCheckout']]
|
||||||
])
|
])
|
||||||
@@ -41,7 +41,7 @@ pipeline {
|
|||||||
}
|
}
|
||||||
stage('Build and push') {
|
stage('Build and push') {
|
||||||
steps {
|
steps {
|
||||||
sshagent(credentials: ['gitea-layout-read']) {
|
sshagent(credentials: ['gitea']) {
|
||||||
withCredentials([
|
withCredentials([
|
||||||
file(credentialsId: 'gitea-known-hosts', variable: 'GIT_KNOWN_HOSTS'),
|
file(credentialsId: 'gitea-known-hosts', variable: 'GIT_KNOWN_HOSTS'),
|
||||||
usernamePassword(credentialsId: 'harbor-backend',
|
usernamePassword(credentialsId: 'harbor-backend',
|
||||||
|
|||||||
+3
-3
@@ -12,7 +12,7 @@ pipeline {
|
|||||||
}
|
}
|
||||||
environment {
|
environment {
|
||||||
SERVICE = 'micro-rpc'
|
SERVICE = 'micro-rpc'
|
||||||
IMAGE_REPOSITORY = 'harbor.vitatech.com.cn:19443/backend/micro_layout-rpc'
|
IMAGE_REPOSITORY = 'harbor.vitatech.com.cn:19443/vitavideo/micro_layout-rpc'
|
||||||
DOCKERFILE = 'build/srv/Dockerfile'
|
DOCKERFILE = 'build/srv/Dockerfile'
|
||||||
DEPLOY_ROOT = '/home/SHARE/devstack-scb/apps/layout-test'
|
DEPLOY_ROOT = '/home/SHARE/devstack-scb/apps/layout-test'
|
||||||
}
|
}
|
||||||
@@ -29,7 +29,7 @@ pipeline {
|
|||||||
branches: [[name: '*/' + env.SOURCE_BRANCH]],
|
branches: [[name: '*/' + env.SOURCE_BRANCH]],
|
||||||
userRemoteConfigs: [[
|
userRemoteConfigs: [[
|
||||||
url: 'ssh://git@git.vitatech.com.cn:12222/leo/micro_layout.git',
|
url: 'ssh://git@git.vitatech.com.cn:12222/leo/micro_layout.git',
|
||||||
credentialsId: 'gitea-layout-read'
|
credentialsId: 'gitea'
|
||||||
]],
|
]],
|
||||||
extensions: [[$class: 'CleanBeforeCheckout']]
|
extensions: [[$class: 'CleanBeforeCheckout']]
|
||||||
])
|
])
|
||||||
@@ -41,7 +41,7 @@ pipeline {
|
|||||||
}
|
}
|
||||||
stage('Build and push') {
|
stage('Build and push') {
|
||||||
steps {
|
steps {
|
||||||
sshagent(credentials: ['gitea-layout-read']) {
|
sshagent(credentials: ['gitea']) {
|
||||||
withCredentials([
|
withCredentials([
|
||||||
file(credentialsId: 'gitea-known-hosts', variable: 'GIT_KNOWN_HOSTS'),
|
file(credentialsId: 'gitea-known-hosts', variable: 'GIT_KNOWN_HOSTS'),
|
||||||
usernamePassword(credentialsId: 'harbor-backend',
|
usernamePassword(credentialsId: 'harbor-backend',
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
FROM golang:1.27.3-alpine AS builder
|
FROM harbor.vitatech.com.cn:19443/vitavideo/base-golang:1.27.3-alpine AS builder
|
||||||
RUN apk add --no-cache git openssh-client
|
RUN apk add --no-cache git openssh-client
|
||||||
ENV GOPRIVATE=git.vitatech.com.cn
|
ARG GOPROXY=https://goproxy.cn,direct
|
||||||
|
ENV GOPROXY=${GOPROXY} \
|
||||||
|
GOPRIVATE=git.vitatech.com.cn
|
||||||
RUN git config --global url."ssh://git@git.vitatech.com.cn:12222/".insteadOf "https://git.vitatech.com.cn/" \
|
RUN git config --global url."ssh://git@git.vitatech.com.cn:12222/".insteadOf "https://git.vitatech.com.cn/" \
|
||||||
&& mkdir -p -m 0700 /root/.ssh
|
&& mkdir -p -m 0700 /root/.ssh
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
@@ -11,7 +13,7 @@ RUN --mount=type=ssh,required=true \
|
|||||||
COPY . .
|
COPY . .
|
||||||
RUN CGO_ENABLED=0 go build -mod=readonly -trimpath -o /out/crontab ./cmd/crontab
|
RUN CGO_ENABLED=0 go build -mod=readonly -trimpath -o /out/crontab ./cmd/crontab
|
||||||
|
|
||||||
FROM alpine:3.23
|
FROM harbor.vitatech.com.cn:19443/vitavideo/base-alpine:3.23
|
||||||
RUN apk add --no-cache ca-certificates tzdata
|
RUN apk add --no-cache ca-certificates tzdata
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN mkdir -p logs && chown 65532:65532 logs
|
RUN mkdir -p logs && chown 65532:65532 logs
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
FROM golang:1.27.3-alpine AS builder
|
FROM harbor.vitatech.com.cn:19443/vitavideo/base-golang:1.27.3-alpine AS builder
|
||||||
RUN apk add --no-cache git openssh-client
|
RUN apk add --no-cache git openssh-client
|
||||||
ENV GOPRIVATE=git.vitatech.com.cn
|
ARG GOPROXY=https://goproxy.cn,direct
|
||||||
|
ENV GOPROXY=${GOPROXY} \
|
||||||
|
GOPRIVATE=git.vitatech.com.cn
|
||||||
RUN git config --global url."ssh://git@git.vitatech.com.cn:12222/".insteadOf "https://git.vitatech.com.cn/" \
|
RUN git config --global url."ssh://git@git.vitatech.com.cn:12222/".insteadOf "https://git.vitatech.com.cn/" \
|
||||||
&& mkdir -p -m 0700 /root/.ssh
|
&& mkdir -p -m 0700 /root/.ssh
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
@@ -12,7 +14,7 @@ COPY . .
|
|||||||
RUN CGO_ENABLED=0 go build -mod=readonly -trimpath -o /out/srv ./cmd/srv \
|
RUN CGO_ENABLED=0 go build -mod=readonly -trimpath -o /out/srv ./cmd/srv \
|
||||||
&& CGO_ENABLED=0 go build -mod=readonly -trimpath -o /out/grpc-health ./cmd/healthcheck
|
&& CGO_ENABLED=0 go build -mod=readonly -trimpath -o /out/grpc-health ./cmd/healthcheck
|
||||||
|
|
||||||
FROM alpine:3.23
|
FROM harbor.vitatech.com.cn:19443/vitavideo/base-alpine:3.23
|
||||||
RUN apk add --no-cache ca-certificates tzdata
|
RUN apk add --no-cache ca-certificates tzdata
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN mkdir -p logs && chown 65532:65532 logs
|
RUN mkdir -p logs && chown 65532:65532 logs
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package crontab
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"os"
|
||||||
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/robfig/cron/v3"
|
"github.com/robfig/cron/v3"
|
||||||
@@ -48,6 +49,8 @@ func (m *Crontab) Start() error {
|
|||||||
// }))
|
// }))
|
||||||
|
|
||||||
c.Start()
|
c.Start()
|
||||||
|
// Readiness is independent of application log filtering.
|
||||||
|
fmt.Fprintln(os.Stdout, `{"event":"crontab_ready"}`)
|
||||||
log.Infof("crontab start")
|
log.Infof("crontab start")
|
||||||
|
|
||||||
<-m.options.Context.Done()
|
<-m.options.Context.Done()
|
||||||
|
|||||||
Reference in new issue
Block a user