Прокидывание версии
This commit is contained in:
parent
d76d0e865d
commit
e47115036e
6 changed files with 21 additions and 15 deletions
|
@ -1,11 +1,12 @@
|
||||||
steps:
|
steps:
|
||||||
build:
|
build:
|
||||||
image: plugins/docker
|
image: woodpeckerci/plugin-docker-buildx
|
||||||
settings:
|
settings:
|
||||||
registry: gitrepo.ru
|
registry: gitrepo.ru
|
||||||
username: neonxp
|
username: neonxp
|
||||||
password:
|
password:
|
||||||
from_secret: gitea_token
|
from_secret: gitea_token
|
||||||
repo: gitrepo.ru/neonxp/nquest
|
repo: gitrepo.ru/neonxp/nquest
|
||||||
tags: latest
|
tags:
|
||||||
auto_tag: true
|
- latest
|
||||||
|
- ${CI_COMMIT_SHA}
|
14
Dockerfile
14
Dockerfile
|
@ -1,19 +1,21 @@
|
||||||
# Build frontend
|
# Build frontend
|
||||||
FROM node:21-alpine3.17 as frontend
|
FROM node:21-alpine3.17 as frontend
|
||||||
|
ARG VERSION
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY ./frontend /app
|
COPY ./frontend /app
|
||||||
RUN echo "@neonxp:registry=https://gitrepo.ru/api/packages/neonxp/npm/" > ~/.npmrc
|
RUN echo "@neonxp:registry=https://gitrepo.ru/api/packages/neonxp/npm/" > ~/.npmrc
|
||||||
RUN npm install && npm run build
|
RUN npm install && VITE_VERSION=${VERSION} npm run build
|
||||||
|
|
||||||
# Build backend
|
# Build backend
|
||||||
FROM golang:1.21.3-alpine3.17 as backend
|
FROM golang:1.21.3-alpine3.17 as backend
|
||||||
|
ARG VERSION
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
RUN apk update --no-cache && apk add --no-cache tzdata
|
RUN apk update --no-cache && apk add --no-cache tzdata
|
||||||
COPY go.mod go.sum ./
|
COPY go.mod go.sum ./
|
||||||
RUN go mod download && go mod verify
|
RUN go mod download && go mod verify
|
||||||
COPY . .
|
COPY . .
|
||||||
COPY --from=frontend /app/dist /app/frontend/dist
|
COPY --from=frontend /app/dist /app/frontend/dist
|
||||||
RUN go build -o nquest *.go
|
RUN go build -ldflags="-X gitrepo.ru/neonxp/nquest.Version=${VERSION}" -o nquest *.go
|
||||||
|
|
||||||
# Runtime container
|
# Runtime container
|
||||||
FROM alpine:3.17
|
FROM alpine:3.17
|
||||||
|
@ -25,14 +27,6 @@ COPY --from=backend /app/nquest /app/nquest
|
||||||
|
|
||||||
ENV TZ Europe/Moscow
|
ENV TZ Europe/Moscow
|
||||||
|
|
||||||
ENV PG_HOST nquestdb
|
|
||||||
ENV PG_NAME nquest
|
|
||||||
ENV PG_USER nquest
|
|
||||||
ENV PG_PASS nquest
|
|
||||||
ENV PG_PORT 5432
|
|
||||||
ENV SECRET s3cr3t
|
|
||||||
ENV LISTEN :8000
|
|
||||||
|
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
|
|
||||||
CMD ["/app/nquest"]
|
CMD ["/app/nquest"]
|
|
@ -9,6 +9,8 @@ import App from './App.jsx'
|
||||||
import { store } from './store/provider.js'
|
import { store } from './store/provider.js'
|
||||||
const { darkAlgorithm } = theme
|
const { darkAlgorithm } = theme
|
||||||
|
|
||||||
|
console.log(import.meta.env.VITE_VERSION)
|
||||||
|
|
||||||
ReactDOM.createRoot(document.getElementById('root')).render(
|
ReactDOM.createRoot(document.getElementById('root')).render(
|
||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
<Compose providers={store}>
|
<Compose providers={store}>
|
||||||
|
|
5
frontend/src/pages/admin/Quest.jsx
Normal file
5
frontend/src/pages/admin/Quest.jsx
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
const Quest = () => {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Quest
|
|
@ -61,7 +61,7 @@ const manifest = {
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react(), splitVendorChunkPlugin(), VitePWA(manifest)],
|
plugins: [react(), splitVendorChunkPlugin()/* , VitePWA(manifest) */],
|
||||||
server: {
|
server: {
|
||||||
proxy: {
|
proxy: {
|
||||||
'/api': {
|
'/api': {
|
||||||
|
|
6
main.go
6
main.go
|
@ -25,6 +25,10 @@ import (
|
||||||
"gitrepo.ru/neonxp/nquest/pkg/service"
|
"gitrepo.ru/neonxp/nquest/pkg/service"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
Version = "dev"
|
||||||
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
cfg, err := GetConfig()
|
cfg, err := GetConfig()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -177,7 +181,7 @@ func main() {
|
||||||
|
|
||||||
// --[ System ]--
|
// --[ System ]--
|
||||||
e.GET("/metrics", echoprometheus.NewHandler())
|
e.GET("/metrics", echoprometheus.NewHandler())
|
||||||
|
e.Logger.Debugf("backend version %s", Version)
|
||||||
e.Logger.Fatal(e.Start(cfg.Listen))
|
e.Logger.Fatal(e.Start(cfg.Listen))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue