Compare commits
12 Commits
a845babc44
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 20e6b1d33b | |||
| 3cf3da9886 | |||
| 0521385d30 | |||
| a779a16acb | |||
| f3ac85cfb4 | |||
| 4ecd29996e | |||
| 9095cdf4ed | |||
| 305602644c | |||
| a240dd4b22 | |||
| 7a1dda51a4 | |||
| 001b43c74c | |||
| d622684a08 |
+51
-27
@@ -1,42 +1,66 @@
|
|||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: kubernetes
|
type: kubernetes
|
||||||
name: pr-check
|
name: pr-check
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
event:
|
event:
|
||||||
- pull_request
|
- pull_request
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build-angular
|
- name: build-angular
|
||||||
image: node:22-alpine
|
image: node:22-alpine
|
||||||
commands:
|
commands:
|
||||||
- npm ci
|
- npm ci
|
||||||
- npm run build
|
- npm run build
|
||||||
|
|
||||||
---
|
---
|
||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: kubernetes
|
type: kubernetes
|
||||||
name: deploy
|
name: deploy
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
branch:
|
branch:
|
||||||
- main
|
- main
|
||||||
event:
|
event:
|
||||||
- push
|
- push
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: build-angular
|
- name: build-angular
|
||||||
image: node:22-alpine
|
image: node:22-alpine
|
||||||
commands:
|
commands:
|
||||||
- npm ci
|
- npm ci
|
||||||
- npm run build
|
- npm run build
|
||||||
|
|
||||||
- name: build-and-push
|
- name: build-and-push
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
settings:
|
settings:
|
||||||
registry: gitea.mnky-code.de
|
registry: gitea.mnky-code.de
|
||||||
repo: gitea.mnky-code.de/mnky/ngrx-playground
|
repo: gitea.mnky-code.de/mnky/ngrx-playground
|
||||||
tags:
|
tags:
|
||||||
- ${DRONE_COMMIT_SHA}
|
- ${DRONE_COMMIT_SHA}
|
||||||
username:
|
username:
|
||||||
from_secret: gitea_username
|
from_secret: gitea_username
|
||||||
password:
|
password:
|
||||||
from_secret: gitea_password
|
from_secret: gitea_password
|
||||||
|
|
||||||
|
- name: update-manifests
|
||||||
|
image: alpine:3.20
|
||||||
|
environment:
|
||||||
|
GITEA_USERNAME:
|
||||||
|
from_secret: gitea_git_username
|
||||||
|
GITEA_TOKEN:
|
||||||
|
from_secret: gitea_git_token
|
||||||
|
commands:
|
||||||
|
- apk add --no-cache git sed
|
||||||
|
- test -n "$GITEA_USERNAME"
|
||||||
|
- test -n "$GITEA_TOKEN"
|
||||||
|
- 'printf "machine gitea.mnky-code.de\nlogin %s\npassword %s\n" "$GITEA_USERNAME" "$GITEA_TOKEN" > ~/.netrc'
|
||||||
|
- chmod 600 ~/.netrc
|
||||||
|
- git clone https://gitea.mnky-code.de/mnky/k8s-manifests.git
|
||||||
|
- cd k8s-manifests
|
||||||
|
- 'sed -i "s|image: gitea.mnky-code.de/mnky/ngrx-playground:.*|image: gitea.mnky-code.de/mnky/ngrx-playground:${DRONE_COMMIT_SHA}|" ngrx-playground/deployment.yaml'
|
||||||
|
- git config user.name "drone"
|
||||||
|
- git config user.email "drone@mnky-code.de"
|
||||||
|
- git add ngrx-playground/deployment.yaml
|
||||||
|
- 'git commit -m "Deploy ngrx-playground ${DRONE_COMMIT_SHA}" || exit 0'
|
||||||
|
- git push origin HEAD:main
|
||||||
|
|||||||
+2
-1
@@ -9,5 +9,6 @@ RUN npm run build
|
|||||||
# Runtime Stage
|
# Runtime Stage
|
||||||
FROM nginx:alpine
|
FROM nginx:alpine
|
||||||
COPY --from=builder /app/dist/*/browser /usr/share/nginx/html
|
COPY --from=builder /app/dist/*/browser /usr/share/nginx/html
|
||||||
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
|
|||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name _;
|
||||||
|
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
index index.html;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user