Text build front and back
This commit is contained in:
parent
6e55b088e9
commit
aeb9f4a138
119
.woodpecker.yaml
119
.woodpecker.yaml
@ -1,38 +1,95 @@
|
||||
steps:
|
||||
build-frontend:
|
||||
name: Build & Push Frontend with wp-kaniko-sync
|
||||
image: harbor.dvirlabs.com/dev-tools/wp-kaniko-sync:latest
|
||||
name: Build & Push Frontend
|
||||
image: woodpeckerci/plugin-kaniko
|
||||
when:
|
||||
branch: [ master, develop ]
|
||||
event: [ push, pull_request, tag ]
|
||||
path:
|
||||
include: [ frontend/** ]
|
||||
settings:
|
||||
PLUGIN_CONTEXT: frontend
|
||||
PLUGIN_DOCKERFILE: frontend/Dockerfile
|
||||
PLUGIN_REPO: my-apps/labmap-frontend
|
||||
PLUGIN_REGISTRY: harbor.dvirlabs.com
|
||||
PLUGIN_NAME: frontend
|
||||
PLUGIN_GIT_REPO: git.dvirlabs.com/dvirlabs/my-apps.git
|
||||
PLUGIN_VALUES_FILE: manifests/labmap/values.yaml
|
||||
PLUGIN_VALUES_PATH: frontend.tag
|
||||
PLUGIN_GIT_USERNAME:
|
||||
from_secret: GIT_USERNAME
|
||||
PLUGIN_GIT_TOKEN:
|
||||
from_secret: GIT_TOKEN
|
||||
registry: harbor.dvirlabs.com
|
||||
repo: my-apps/navix-frontend
|
||||
dockerfile: frontend/Dockerfile
|
||||
context: frontend
|
||||
tags:
|
||||
- latest
|
||||
- ${CI_COMMIT_BRANCH}-${CI_COMMIT_SHA:0:7}
|
||||
username:
|
||||
from_secret: DOCKER_USERNAME
|
||||
password:
|
||||
from_secret: DOCKER_PASSWORD
|
||||
|
||||
build-backend:
|
||||
name: Build & Push Backend with wp-kaniko-sync
|
||||
image: harbor.dvirlabs.com/dev-tools/wp-kaniko-sync:latest
|
||||
name: Build & Push Backend
|
||||
image: woodpeckerci/plugin-kaniko
|
||||
when:
|
||||
branch: [ master, develop ]
|
||||
event: [ push, pull_request, tag ]
|
||||
path:
|
||||
include: [ backend/** ]
|
||||
settings:
|
||||
PLUGIN_CONTEXT: backend
|
||||
PLUGIN_DOCKERFILE: backend/Dockerfile
|
||||
PLUGIN_REPO: my-apps/labmap-backend
|
||||
PLUGIN_REGISTRY: harbor.dvirlabs.com
|
||||
PLUGIN_NAME: backend
|
||||
PLUGIN_GIT_REPO: git.dvirlabs.com/dvirlabs/my-apps.git
|
||||
PLUGIN_VALUES_FILE: manifests/labmap/values.yaml
|
||||
PLUGIN_VALUES_PATH: backend.tag
|
||||
PLUGIN_GIT_USERNAME:
|
||||
from_secret: GIT_USERNAME
|
||||
PLUGIN_GIT_TOKEN:
|
||||
from_secret: GIT_TOKEN
|
||||
registry: harbor.dvirlabs.com
|
||||
repo: my-apps/navix-backend
|
||||
dockerfile: backend/Dockerfile
|
||||
context: backend
|
||||
tags:
|
||||
- latest
|
||||
- ${CI_COMMIT_BRANCH}-${CI_COMMIT_SHA:0:7}
|
||||
username:
|
||||
from_secret: DOCKER_USERNAME
|
||||
password:
|
||||
from_secret: DOCKER_PASSWORD
|
||||
|
||||
when:
|
||||
branch: [ master, develop ]
|
||||
event: [ push, tag ]
|
||||
update-values-frontend:
|
||||
name: Update frontend tag in values.yaml
|
||||
image: alpine:3.19
|
||||
when:
|
||||
branch: [ master, develop ]
|
||||
event: [ push ]
|
||||
path:
|
||||
include: [ frontend/** ]
|
||||
environment:
|
||||
GIT_USERNAME:
|
||||
from_secret: GIT_USERNAME
|
||||
GIT_TOKEN:
|
||||
from_secret: GIT_TOKEN
|
||||
commands:
|
||||
- apk add --no-cache git yq
|
||||
- git config --global user.name "woodpecker-bot"
|
||||
- git config --global user.email "ci@dvirlabs.com"
|
||||
- git clone "https://$${GIT_USERNAME}:$${GIT_TOKEN}@git.dvirlabs.com/dvirlabs/my-apps.git"
|
||||
- cd my-apps
|
||||
- |
|
||||
TAG="${CI_COMMIT_BRANCH}-${CI_COMMIT_SHA:0:7}"
|
||||
echo "💡 Setting frontend tag to: $TAG"
|
||||
yq -i ".frontend.tag = \"$TAG\"" manifests/navix/values.yaml
|
||||
git add manifests/navix/values.yaml
|
||||
git commit -m "frontend: update tag to $TAG" || echo "No changes"
|
||||
git push origin HEAD
|
||||
|
||||
update-values-backend:
|
||||
name: Update backend tag in values.yaml
|
||||
image: alpine:3.19
|
||||
when:
|
||||
branch: [ master, develop ]
|
||||
event: [ push ]
|
||||
path:
|
||||
include: [ backend/** ]
|
||||
environment:
|
||||
GIT_USERNAME:
|
||||
from_secret: GIT_USERNAME
|
||||
GIT_TOKEN:
|
||||
from_secret: GIT_TOKEN
|
||||
commands:
|
||||
- apk add --no-cache git yq
|
||||
- git config --global user.name "woodpecker-bot"
|
||||
- git config --global user.email "ci@dvirlabs.com"
|
||||
- cd my-apps
|
||||
- |
|
||||
TAG="${CI_COMMIT_BRANCH}-${CI_COMMIT_SHA:0:7}"
|
||||
echo "💡 Setting backend tag to: $TAG"
|
||||
yq -i ".backend.tag = \"$TAG\"" manifests/navix/values.yaml
|
||||
git add manifests/navix/values.yaml
|
||||
git commit -m "backend: update tag to $TAG" || echo "No changes"
|
||||
git push origin HEAD
|
||||
|
||||
@ -92,3 +92,4 @@ app.include_router(router, prefix="/api")
|
||||
if __name__ == "__main__":
|
||||
import uvicorn
|
||||
uvicorn.run("main:app", host="0.0.0.0", port=8000, reload=True)
|
||||
|
||||
|
||||
@ -27,3 +27,4 @@ RUN dos2unix /docker-entrypoint.d/10-generate-env.sh && chmod +x /docker-entrypo
|
||||
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user