-
Notifications
You must be signed in to change notification settings - Fork 42
/
Taskfile.yaml
116 lines (106 loc) · 4.69 KB
/
Taskfile.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
version: '3'
tasks:
k3d:cluster:create:
status:
- k3d cluster get podcast-server
cmds:
- k3d cluster create podcast-server --port 80:80@loadbalancer --port 443:443@loadbalancer --k3s-arg "--disable=traefik@server:*"
- kubectl apply -k distribution/kubernetes/.infrastructure/contour/ --server-side=true
- kubectl wait --for condition=established crd
gatewayclasses.gateway.networking.k8s.io
contourdeployments.projectcontour.io
gateways.gateway.networking.k8s.io
- kubectl apply -k distribution/kubernetes/.infrastructure/gateway/ --server-side=true
skaffold:dev:
dir: ~/Workspace/gitlab.com/davinkevin/Podcast-Server
env:
SKAFFOLD: true
deps:
- task: k3d:cluster:create
cmds:
- skaffold dev --status-check=false
certificates:generate:
cmds:
- cmd: |
export PROJECT_DIR=$(pwd)
cd $(mktemp -d)
mkcert -cert-file=tls.crt -key-file=tls.key '*.k8s.local' '*.podcast.k8s.local' 'podcast.k8s.local'
cp tls.crt tls.key $PROJECT_DIR/distribution/kubernetes/.infrastructure/contour/
cp tls.crt tls.key $PROJECT_DIR/distribution/kubernetes/overlays/docker-for-desktop/ingress/certs/
database:start:
env:
DATABASE_PASSWORD: nAAdo5wNs7WEF1UxUobpJDfS9Si62PHa
DATABASE_USERNAME: podcast-server-user
DATABASE_NAME: podcast-server
cmds:
- docker run --rm
-e POSTGRES_USER=$DATABASE_USERNAME
-e POSTGRES_PASSWORD=$DATABASE_PASSWORD
-e POSTGRES_DB=$DATABASE_NAME
-p 5432:5432
--name db-for-local-dev
postgres:16.2-alpine
minio:start:
vars:
TEMP_MINIO_DATA_FOLDER:
sh: mktemp -d
MINIO_VERSION:
sh: cat storage/Dockerfile | sd 'FROM.*:' ''
cmd: docker run
-p 9000:9000
-p 9001:9001
-v {{.TEMP_MINIO_DATA_FOLDER}}:/data
-e "MINIO_ROOT_USER=podcast-server-user"
-e "MINIO_ROOT_PASSWORD=nAAdo5wNs7WEF1UxUobpJDfS9Si62PHa"
quay.io/minio/minio:{{.MINIO_VERSION}} server /data --console-address ":9001"
release:
env:
CURRENT_VERSION:
sh: jq .version -r frontend-angularjs/package.json
NEW_VERSION: "{{.CLI_ARGS}}"
cmds:
- sd $CURRENT_VERSION $NEW_VERSION
backend/build.gradle.kts
backend-lib-database/build.gradle.kts
backend-lib-youtubedl/build.gradle.kts
build-logic/build-plugin-database/build.gradle.kts
build-logic/build-plugin-docker-images/build.gradle.kts
frontend-angular/build.gradle.kts
frontend-angular/package.json
frontend-angularjs/build.gradle.kts
frontend-angularjs/npm-shrinkwrap.json
frontend-angularjs/package.json
- git cliff -t $NEW_VERSION > CHANGELOG.md
- git add .
- 'git ci -m "chore(release): release version $NEW_VERSION"'
- 'git tag $NEW_VERSION -m "chore(release): release version $NEW_VERSION"'
release:publish:
env:
PROJECT_ID: 13640563
CI_SERVER_URL: https://gitlab.com
CI_COMMIT_TAG:
sh: git describe --abbrev=0
cmds:
- cmd: |-
UI_SHA=$(crane digest podcastserver/ui:$CI_COMMIT_TAG)
BACKEND_SHA=$(crane digest podcastserver/backend:$CI_COMMIT_TAG)
INIT_DB_SHA=$(crane digest podcastserver/init-db:$CI_COMMIT_TAG)
STORAGE_SHA=$(crane digest podcastserver/storage:$CI_COMMIT_TAG)
release-cli --project-id=$PROJECT_ID create \
--name $CI_COMMIT_TAG \
--tag-name "$CI_COMMIT_TAG" --ref "$CI_COMMIT_TAG" \
--assets-link "{\"name\":\"ui\",\"url\":\"https://hub.docker.com/layers/podcastserver/ui/$CI_COMMIT_TAG/images/sha256-${UI_SHA/sha256:/}\",\"link_type\":\"image\"}" \
--assets-link "{\"name\":\"backend\",\"url\":\"https://hub.docker.com/layers/podcastserver/backend/$CI_COMMIT_TAG/images/sha256-${BACKEND_SHA/sha256:/}\",\"link_type\":\"image\"}" \
--assets-link "{\"name\":\"init-db\",\"url\":\"https://hub.docker.com/layers/podcastserver/init-db/$CI_COMMIT_TAG/images/sha256-${INIT_DB_SHA/sha256:/}\",\"link_type\":\"image\"}" \
--assets-link "{\"name\":\"storage\",\"url\":\"https://hub.docker.com/layers/podcastserver/storage/$CI_COMMIT_TAG/images/sha256-${STORAGE_SHA/sha256:/}\",\"link_type\":\"image\"}" \
--description "$(git-cliff -l --strip all | tail -n +3)"
push-to-github:
env:
GITLAB_DIRECTORY:
sh: mktemp -d
cmds:
- |
cd $GITLAB_DIRECTORY
git clone --bare [email protected]:davinkevin/Podcast-Server.git
cd Podcast-Server.git
git push --mirror --repo [email protected]:davinkevin/Podcast-Server.git