Skip to content

Commit 99a3bd5

Browse files
committed
chore(quickwit): add woodpecker
1 parent 67c4527 commit 99a3bd5

6 files changed

Lines changed: 156 additions & 1 deletion

File tree

.woodpecker/build-linux.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
matrix:
2+
platform:
3+
- linux/amd64
4+
- linux/arm64
5+
6+
labels:
7+
type: exec
8+
platform: ${platform}
9+
10+
steps:
11+
- name: publish-linux
12+
image: bash
13+
commands:
14+
- export VERSION=$([ -z $CI_COMMIT_TAG ] && echo latest || echo $CI_COMMIT_TAG)-$(sed 's#/#-#g' <<< $CI_SYSTEM_PLATFORM)
15+
- echo $CONTAINER_PASSWORD | podman login $DRYCC_REGISTRY --username $CONTAINER_USERNAME --password-stdin > /dev/null 2>&1
16+
- make podman-build podman-immutable-push
17+
environment:
18+
CODENAME:
19+
from_secret: codename
20+
DEV_REGISTRY:
21+
from_secret: dev_registry
22+
DRYCC_REGISTRY:
23+
from_secret: drycc_registry
24+
CONTAINER_USERNAME:
25+
from_secret: container_username
26+
CONTAINER_PASSWORD:
27+
from_secret: container_password
28+
when:
29+
event:
30+
- push
31+
- tag
32+
- cron
33+
34+
depends_on:
35+
- test-linux

.woodpecker/chart.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
labels:
2+
type: exec
3+
platform: linux/amd64
4+
5+
steps:
6+
- name: generate-chart
7+
image: bash
8+
commands:
9+
- export VERSION=$(sed 's#v##' <<< $CI_COMMIT_TAG)
10+
- export IMAGE_TAG=$([ ! -z $CI_COMMIT_TAG ] && echo \"$VERSION\" || echo \"canary\")
11+
- export APP_VERSION=$([ -z $CI_COMMIT_TAG ] && echo $CI_COMMIT_SHA || echo $VERSION)
12+
- export CHART_VERSION=$([ -z $CI_COMMIT_TAG ] && echo 1.0.0 || echo $VERSION)
13+
- sed -i "s/imageTag:\ \"canary\"/imageTag:\ $IMAGE_TAG/g" charts/$${CI_REPO_NAME}/values.yaml
14+
- helm package -u charts/$${CI_REPO_NAME} --version $CHART_VERSION --app-version $APP_VERSION
15+
- echo $CONTAINER_PASSWORD | helm registry login $DRYCC_REGISTRY -u $CONTAINER_USERNAME --password-stdin
16+
- helm push $${CI_REPO_NAME}-$CHART_VERSION.tgz oci://$DRYCC_REGISTRY/$([ -z $CI_COMMIT_TAG ] && echo charts-testing || echo charts)
17+
environment:
18+
DEV_REGISTRY:
19+
from_secret: dev_registry
20+
DRYCC_REGISTRY:
21+
from_secret: drycc_registry
22+
CONTAINER_USERNAME:
23+
from_secret: container_username
24+
CONTAINER_PASSWORD:
25+
from_secret: container_password
26+
when:
27+
event:
28+
- push
29+
- tag
30+
- cron
31+
32+
depends_on:
33+
- manifest

.woodpecker/manifest.tmpl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
image: registry.drycc.cc/drycc/{{project}}:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}canary{{/if}}
2+
{{#if build.tags}}
3+
tags:
4+
{{#each build.tags}}
5+
- {{this}}
6+
{{/each}}
7+
{{/if}}
8+
manifests:
9+
-
10+
image: registry.drycc.cc/drycc/{{project}}:{{#if build.tag}}{{build.tag}}-{{else}}latest-{{/if}}linux-amd64
11+
platform:
12+
architecture: amd64
13+
os: linux
14+
-
15+
image: registry.drycc.cc/drycc/{{project}}:{{#if build.tag}}{{build.tag}}-{{else}}latest-{{/if}}linux-arm64
16+
platform:
17+
architecture: arm64
18+
os: linux

.woodpecker/manifest.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
labels:
2+
type: exec
3+
platform: linux/amd64
4+
5+
steps:
6+
- name: generate-manifest
7+
image: bash
8+
commands:
9+
- sed -i "s/{{project}}/$${CI_REPO_NAME}/g" .woodpecker/manifest.tmpl
10+
- sed -i "s/registry.drycc.cc/$${DRYCC_REGISTRY}/g" .woodpecker/manifest.tmpl
11+
environment:
12+
DRYCC_REGISTRY:
13+
from_secret: drycc_registry
14+
when:
15+
event:
16+
- tag
17+
- push
18+
- cron
19+
20+
- name: publish-manifest
21+
image: bash
22+
commands:
23+
- podman run --rm
24+
-e PLUGIN_SPEC=.woodpecker/manifest.tmpl
25+
-e PLUGIN_USERNAME=$CONTAINER_USERNAME
26+
-e PLUGIN_PASSWORD=$CONTAINER_PASSWORD
27+
-e DRONE_TAG=$CI_COMMIT_TAG
28+
-v $(pwd):$(pwd)
29+
-w $(pwd)
30+
plugins/manifest
31+
environment:
32+
CONTAINER_USERNAME:
33+
from_secret: container_username
34+
CONTAINER_PASSWORD:
35+
from_secret: container_password
36+
when:
37+
event:
38+
- tag
39+
- push
40+
- cron
41+
42+
depends_on:
43+
- build-linux

.woodpecker/test-linux.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
matrix:
2+
platform:
3+
- linux/amd64
4+
- linux/arm64
5+
6+
labels:
7+
type: exec
8+
platform: ${platform}
9+
10+
steps:
11+
- name: test-linux
12+
image: bash
13+
commands:
14+
- make test
15+
environment:
16+
CODENAME:
17+
from_secret: codename
18+
DEV_REGISTRY:
19+
from_secret: dev_registry
20+
CODECOV_TOKEN:
21+
from_secret: codecov_token
22+
when:
23+
event:
24+
- push
25+
- tag
26+
- cron

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ PLATFORM ?= linux/amd64,linux/arm64
88

99
include versioning.mk
1010

11-
SHELL_SCRIPTS = $(wildcard rootfs/bin/*)
11+
SHELL_SCRIPTS = $(wildcard rootfs/usr/local/bin/*)
1212
DEV_ENV_IMAGE := ${DEV_REGISTRY}/drycc/go-dev
1313
DEV_ENV_CMD := podman run --rm -v ${CURDIR}:${CURDIR} -w ${CURDIR} ${DEV_ENV_IMAGE}
1414

0 commit comments

Comments
 (0)