feat(ci): add Concourse pipeline

This commit is contained in:
Peter Kurfer 2022-12-23 15:10:41 +01:00
parent dbe5aeaa2b
commit 6c791e0492
No known key found for this signature in database
4 changed files with 70 additions and 3 deletions

39
.concourse/pipeline.yml Normal file
View file

@ -0,0 +1,39 @@
---
resource_types:
- name: helm
type: docker-image
source:
repository: ghcr.io/typositoire/concourse-helm3-resource
resources:
- name: blog.git
type: git
icon: github
source:
uri: https://code.icb4dc0.de/prskr/blog.git
- name: blog-chart
type: helm
source:
cluster_url: ((k8s-credentials.url))
cluster_ca: ((k8s-credentials.ca-crt))
token: ((k8s-credentials.token))
release: blog
namespace: blog
jobs:
- name: build
plan:
- get: blog.git
trigger: true
- task: build-container-image
file: blog.git/.concourse/tasks/image.yml
input_mapping: {repo: blog.git}
- put: blog-chart
params:
chart: blog.git/deploy/helm
override_values:
- key: image.tag
path: blog.git/.git/refs/heads/main
type: string

View file

@ -0,0 +1,28 @@
---
platform: linux
image_resource:
name: kaniko-debug
type: registry-image
source:
repository: gcr.io/kaniko-project/executor
tag: debug
inputs:
- name: repo
path: .
params:
GITEA_USER: ((gitea-credentials.user))
GITEA_TOKEN: ((gitea-credentials.token))
run:
path: sh
args:
- -ce
- |
echo "{\"auths\": {\"https://code.icb4dc0.de\": {\"auth\" : \"$(printf '%s:%s' $GITEA_USER $GITEA_TOKEN | base64)\" }}}" > /kaniko/.docker/config.json
/kaniko/executor \
--destination code.icb4dc0.de/prskr/blog:latest \
--destination code.icb4dc0.de/prskr/blog:$(cat .git/refs/heads/main) \
--context .

View file

@ -2,10 +2,10 @@ FROM docker.io/alpine:latest as builder
WORKDIR /src
COPY . ./
COPY . /src/
RUN apk add -U hugo && \
hugo --minify --environment production
hugo --minify --environment production --config config.toml
FROM docker.io/caddy:2-alpine

View file

@ -2,7 +2,7 @@
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
replicaCount: 2
image:
repository: code.icb4dc0.de/prskr/blog