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:
|
steps:
|
||||||
build-frontend:
|
build-frontend:
|
||||||
name: Build & Push Frontend with wp-kaniko-sync
|
name: Build & Push Frontend
|
||||||
image: harbor.dvirlabs.com/dev-tools/wp-kaniko-sync:latest
|
image: woodpeckerci/plugin-kaniko
|
||||||
|
when:
|
||||||
|
branch: [ master, develop ]
|
||||||
|
event: [ push, pull_request, tag ]
|
||||||
|
path:
|
||||||
|
include: [ frontend/** ]
|
||||||
settings:
|
settings:
|
||||||
PLUGIN_CONTEXT: frontend
|
registry: harbor.dvirlabs.com
|
||||||
PLUGIN_DOCKERFILE: frontend/Dockerfile
|
repo: my-apps/navix-frontend
|
||||||
PLUGIN_REPO: my-apps/labmap-frontend
|
dockerfile: frontend/Dockerfile
|
||||||
PLUGIN_REGISTRY: harbor.dvirlabs.com
|
context: frontend
|
||||||
PLUGIN_NAME: frontend
|
tags:
|
||||||
PLUGIN_GIT_REPO: git.dvirlabs.com/dvirlabs/my-apps.git
|
- latest
|
||||||
PLUGIN_VALUES_FILE: manifests/labmap/values.yaml
|
- ${CI_COMMIT_BRANCH}-${CI_COMMIT_SHA:0:7}
|
||||||
PLUGIN_VALUES_PATH: frontend.tag
|
username:
|
||||||
PLUGIN_GIT_USERNAME:
|
from_secret: DOCKER_USERNAME
|
||||||
from_secret: GIT_USERNAME
|
password:
|
||||||
PLUGIN_GIT_TOKEN:
|
from_secret: DOCKER_PASSWORD
|
||||||
from_secret: GIT_TOKEN
|
|
||||||
|
|
||||||
build-backend:
|
build-backend:
|
||||||
name: Build & Push Backend with wp-kaniko-sync
|
name: Build & Push Backend
|
||||||
image: harbor.dvirlabs.com/dev-tools/wp-kaniko-sync:latest
|
image: woodpeckerci/plugin-kaniko
|
||||||
|
when:
|
||||||
|
branch: [ master, develop ]
|
||||||
|
event: [ push, pull_request, tag ]
|
||||||
|
path:
|
||||||
|
include: [ backend/** ]
|
||||||
settings:
|
settings:
|
||||||
PLUGIN_CONTEXT: backend
|
registry: harbor.dvirlabs.com
|
||||||
PLUGIN_DOCKERFILE: backend/Dockerfile
|
repo: my-apps/navix-backend
|
||||||
PLUGIN_REPO: my-apps/labmap-backend
|
dockerfile: backend/Dockerfile
|
||||||
PLUGIN_REGISTRY: harbor.dvirlabs.com
|
context: backend
|
||||||
PLUGIN_NAME: backend
|
tags:
|
||||||
PLUGIN_GIT_REPO: git.dvirlabs.com/dvirlabs/my-apps.git
|
- latest
|
||||||
PLUGIN_VALUES_FILE: manifests/labmap/values.yaml
|
- ${CI_COMMIT_BRANCH}-${CI_COMMIT_SHA:0:7}
|
||||||
PLUGIN_VALUES_PATH: backend.tag
|
username:
|
||||||
PLUGIN_GIT_USERNAME:
|
from_secret: DOCKER_USERNAME
|
||||||
from_secret: GIT_USERNAME
|
password:
|
||||||
PLUGIN_GIT_TOKEN:
|
from_secret: DOCKER_PASSWORD
|
||||||
from_secret: GIT_TOKEN
|
|
||||||
|
|
||||||
when:
|
update-values-frontend:
|
||||||
branch: [ master, develop ]
|
name: Update frontend tag in values.yaml
|
||||||
event: [ push, tag ]
|
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__":
|
if __name__ == "__main__":
|
||||||
import uvicorn
|
import uvicorn
|
||||||
uvicorn.run("main:app", host="0.0.0.0", port=8000, reload=True)
|
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
|
EXPOSE 80
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user