build with kaniko

main
avraham 2 years ago
parent 9de07b99ba
commit f1858c7074

@ -0,0 +1,3 @@
FROM devforth/spa-to-http:1.0.6
# keep in mind `dist/` is the context, so `./` refers to the files within `dist/`:
COPY ./ ./

@ -51,7 +51,7 @@ spec:
image: node:20
workingDir: $(workspaces.repo.path)
script: npm install && npm run build
- name: deploy-to-s3
- name: save-to-s3
runAfter:
- npm-build
workspaces:
@ -61,7 +61,7 @@ spec:
workspaces:
- name: repo
steps:
- name: deploy-to-s3
- name: save-to-s3
image: bitnami/minio-client
workingDir: $(workspaces.repo.path)
env:
@ -80,4 +80,32 @@ spec:
script: |
mc alias set minio http://${MINIO_SERVER_HOST}:9000 "${MINIO_SERVER_ACCESS_KEY}" "${MINIO_SERVER_SECRET_KEY}"
mc alias list
mc cp --recursive ./dist/ minio/sakal-us/
mc cp --recursive ./dist/ minio/sakal-us/
- name: build-image
runAfter:
- npm-build
workspaces:
- name: repo
workspace: repo
params:
- name: gitrevision
value: "$(params.gitrevision)"
taskSpec:
params:
- name: gitrevision
type: string
workspaces:
- name: repo
steps:
- name: build-image
image: gcr.io/kaniko-project/executor:v1.9.0-debug
workingDir: $(workspaces.repo.path)
env:
- name: REGISTRY_HOST
value: registry.docker-registry.svc.cluster.local
script: |
#!/bin/sh
/kaniko/executor \
--context "./dist" \
--dockerfile "./Dockerfile" \
--destination "${REGISTRY_HOST}:5000/sakal-us:$(params.gitrevision)" \
Loading…
Cancel
Save