blob: 47d31862d92d20057e407029631d9b31977145e2 [file] [log] [blame]
gioa40058c2024-04-12 10:20:49 +04001pipeline {
2 agent {
3 kubernetes {
giob7df27f2026-07-28 10:36:17 +04004 yaml '''
gioa40058c2024-04-12 10:20:49 +04005 apiVersion: v1
6 kind: Pod
7 spec:
8 containers:
9 - name: golang
10 image: golang:1.22.2-alpine3.19
11 tty: true
giod0026612025-05-08 13:00:36 +000012 - name: node
13 image: node:24.0.0-alpine3.20
14 tty: true
giob7df27f2026-07-28 10:36:17 +040015 - name: nix
16 image: giolekva/jenkins-nix-agent:latest
17 command: ["/usr/bin/tini", "-s", "-g", "--"]
18 args: ["/bin/sleep", "infinity"]
19 tty: true
20 env:
21 - name: HOME
22 value: /home/jenkins
gioa40058c2024-04-12 10:20:49 +040023 '''
giob7df27f2026-07-28 10:36:17 +040024 }
gioa40058c2024-04-12 10:20:49 +040025 }
26 stages {
gioc76baed2024-08-19 22:04:57 +040027 stage('build/test') {
gioa40058c2024-04-12 10:20:49 +040028 steps {
giob7df27f2026-07-28 10:36:17 +040029 container('nix') {
30 dir('core/auth/ui') {
31 sh '''
32 nix develop --accept-flake-config --command bash -euc '
33 go mod tidy
34 go build *.go
35 go test ./...
36 go test -tags=e2e -count=1 -timeout=10m -v ./e2e
37 '
38 '''
39 }
40 dir('apps/app-runner') {
41 sh '''
42 nix develop --accept-flake-config --command bash -euc '
43 go mod tidy
44 go build *.go
45 go test ./...
46 '
47 '''
48 }
49 dir('core/auth/memberships') {
50 sh '''
51 nix develop --accept-flake-config --command bash -euc '
52 go mod tidy
53 go build *.go
54 go test ./...
55 '
56 '''
57 }
58 dir('core/port-allocator') {
59 sh '''
60 nix develop --accept-flake-config --command bash -euc '
61 go mod tidy
62 go build *.go
63 go test ./...
64 '
65 '''
66 }
67 }
68 container('golang') {
69 dir('core/installer') {
70 sh 'go mod tidy'
71 sh 'go build cmd/*.go'
72 sh 'go run cuelang.org/go/cmd/cue fmt app_configs/*.cue --check'
73 sh 'go test ./...'
74 }
75 }
giod0026612025-05-08 13:00:36 +000076 container('node') {
77 sh "apk update"
78 sh "apk add gcc g++ make musl-dev python3 py3-setuptools"
gioc31bf142025-06-16 07:48:20 +000079 dir('apps/canvas/config') {
80 sh 'npm install'
81 sh 'npm run format-check'
82 sh 'npm run lint'
gio9b7421a2025-06-18 12:31:13 +000083 sh 'npm run test'
gioc31bf142025-06-16 07:48:20 +000084 }
giod0026612025-05-08 13:00:36 +000085 dir('apps/canvas/back') {
86 sh 'npm install'
87 sh 'npm run format-check'
gio8d0f6352025-05-11 13:29:33 +000088 sh 'npm run lint'
gio9b7421a2025-06-18 12:31:13 +000089 sh 'npm run test'
giod0026612025-05-08 13:00:36 +000090 }
91 dir('apps/canvas/front') {
92 sh 'npm install'
93 sh 'npm run format-check'
gio8d0f6352025-05-11 13:29:33 +000094 sh 'npm run lint'
giod0026612025-05-08 13:00:36 +000095 }
96 }
gioa40058c2024-04-12 10:20:49 +040097 }
98 }
99 }
giob7df27f2026-07-28 10:36:17 +0400100 post {
gioa40058c2024-04-12 10:20:49 +0400101 success {
102 gerritReview labels: [Verified: 1], message: env.BUILD_URL
103 }
104 unstable {
giob7df27f2026-07-28 10:36:17 +0400105 gerritReview labels: [Verified: 0], message: env.BUILD_URL
106 }
gioa40058c2024-04-12 10:20:49 +0400107 failure {
108 gerritReview labels: [Verified: -1], message: env.BUILD_URL
109 }
110 }
giob7df27f2026-07-28 10:36:17 +0400111}