2023-11-16 18:49:01 +08:00
|
|
|
kind: pipeline
|
|
|
|
type: docker
|
|
|
|
name: default
|
|
|
|
steps:
|
2023-11-17 11:11:29 +08:00
|
|
|
{{ $prepare_commands := .input.prepare_commands }}
|
2023-11-17 11:33:34 +08:00
|
|
|
{{ $before_commands := .input.before_commands }}
|
|
|
|
{{ $after_commands := .input.after_commands }}
|
2023-11-16 19:43:04 +08:00
|
|
|
{{ $default_build_types := .input.default_build_types }}
|
2023-11-17 11:37:45 +08:00
|
|
|
|
2023-11-16 19:22:21 +08:00
|
|
|
{{ range .input.builds }}
|
|
|
|
{{ $image_name := .image_name }}
|
|
|
|
- name: build {{ .image_name }}
|
|
|
|
image: dockcross/{{ .image_name }}
|
2023-11-16 18:49:01 +08:00
|
|
|
commands:
|
2023-11-17 11:11:29 +08:00
|
|
|
{{ range $prepare_commands }}
|
|
|
|
- {{ . }}
|
|
|
|
{{ end }}
|
|
|
|
|
2023-11-16 19:43:57 +08:00
|
|
|
{{ $build_types := $default_build_types }}
|
2023-11-16 19:39:19 +08:00
|
|
|
{{ if .build_types }}
|
|
|
|
{{ $build_types := .build_types }}
|
|
|
|
{{ end }}
|
2023-11-17 11:40:38 +08:00
|
|
|
|
2023-11-16 19:39:19 +08:00
|
|
|
{{ range $build_types }}
|
2023-11-17 11:40:38 +08:00
|
|
|
- export BUILD_TYPE={{.}}
|
2023-11-17 11:53:43 +08:00
|
|
|
- export BUILD_DIR=build-{{$image_name}}-{{.}}
|
2023-11-17 11:52:56 +08:00
|
|
|
- echo $BUILD_TYPE
|
|
|
|
- echo $CURRENT_BUILD_DIR
|
2023-11-17 11:33:34 +08:00
|
|
|
|
2023-11-17 11:40:38 +08:00
|
|
|
{{ range $before_commands }}
|
2023-11-17 11:33:34 +08:00
|
|
|
- {{ . }}
|
|
|
|
{{ end }}
|
2023-11-17 11:40:38 +08:00
|
|
|
|
2023-11-17 14:26:35 +08:00
|
|
|
- cmake . -B$BUILD_DIR -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_VERBOSE_MAKEFILE=ON
|
|
|
|
- cmake --build $BUILD_DIR --config $BUILD_TYPE -- -j`nproc`
|
2023-11-17 11:52:56 +08:00
|
|
|
|
|
|
|
{{ range $after_commands }}
|
|
|
|
- {{ . }}
|
|
|
|
{{ end }}
|
2023-11-17 11:40:38 +08:00
|
|
|
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
|
2023-11-16 19:25:54 +08:00
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
- name: list all build dir
|
|
|
|
image: alpine
|
|
|
|
commands:
|
2023-11-16 19:43:04 +08:00
|
|
|
- ls -l build-*
|
|
|
|
depends_on:
|
|
|
|
{{ range .input.builds }}
|
|
|
|
- build {{ .image_name }}
|
|
|
|
{{ end }}
|