diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a8449a6 --- /dev/null +++ b/Dockerfile @@ -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 ./ ./ \ No newline at end of file diff --git a/tekton/pipeline.yaml b/tekton/pipeline.yaml index 89cf7f0..717a11b 100644 --- a/tekton/pipeline.yaml +++ b/tekton/pipeline.yaml @@ -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/ \ No newline at end of file + 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)" \ \ No newline at end of file