2022-10-13 18:55:08 +00:00
|
|
|
include:
|
|
|
|
- local: '/backend/.gitlab-ci.yml'
|
|
|
|
- local: '/frontend/.gitlab-ci.yml'
|
|
|
|
|
2022-08-28 16:29:11 +00:00
|
|
|
stages:
|
|
|
|
- build
|
|
|
|
- package
|
2022-09-04 09:52:32 +00:00
|
|
|
- release
|
2022-08-28 16:29:11 +00:00
|
|
|
|
2022-09-04 09:52:32 +00:00
|
|
|
.package_server:
|
2022-09-04 09:29:49 +00:00
|
|
|
image: alpine:latest
|
2022-08-28 16:29:11 +00:00
|
|
|
stage: package
|
2022-09-04 12:41:21 +00:00
|
|
|
before_script:
|
|
|
|
- apk update
|
|
|
|
- apk add xz tar
|
2022-09-04 09:52:32 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2022-09-04 12:41:21 +00:00
|
|
|
- '*.tar.xz'
|
2022-09-04 09:52:32 +00:00
|
|
|
|
|
|
|
package_server_glibc:
|
|
|
|
extends: .package_server
|
2022-08-28 16:29:11 +00:00
|
|
|
needs:
|
2022-09-04 09:52:32 +00:00
|
|
|
- job: build_backend_glibc
|
2022-08-28 16:29:11 +00:00
|
|
|
artifacts: true
|
|
|
|
- job: test_and_build_frontend
|
|
|
|
artifacts: true
|
|
|
|
script:
|
|
|
|
- mkdir static
|
|
|
|
- mv frontend/dist/* static/
|
2022-09-04 12:41:21 +00:00
|
|
|
- tar -cvJf linux-x64-glibc.tar.xz server static
|
2022-09-04 09:52:32 +00:00
|
|
|
|
|
|
|
package_server_muslc:
|
|
|
|
extends: .package_server
|
|
|
|
needs:
|
|
|
|
- job: build_backend_muslc
|
|
|
|
artifacts: true
|
|
|
|
- job: test_and_build_frontend
|
|
|
|
artifacts: true
|
|
|
|
script:
|
|
|
|
- mkdir static
|
|
|
|
- mv frontend/dist/* static/
|
2022-09-04 12:41:21 +00:00
|
|
|
- tar -cvJf linux-x64-muslc.tar.xz server static
|
2022-09-04 09:52:32 +00:00
|
|
|
|
|
|
|
upload_assets:
|
|
|
|
stage: release
|
|
|
|
image: curlimages/curl:latest
|
|
|
|
needs:
|
|
|
|
- job: package_server_glibc
|
|
|
|
artifacts: true
|
|
|
|
- job: package_server_muslc
|
|
|
|
artifacts: true
|
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_TAG
|
|
|
|
script:
|
2022-09-04 12:41:21 +00:00
|
|
|
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file linux-x64-glibc.tar.xz "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/linux-x64-glibc/$CI_COMMIT_TAG/linux-x64-glibc.tar.xz"'
|
|
|
|
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file linux-x64-muslc.tar.xz "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/linux-x64-muslc/$CI_COMMIT_TAG/linux-x64-muslc.tar.xz"'
|
2022-09-04 09:52:32 +00:00
|
|
|
|
|
|
|
create_release:
|
|
|
|
stage: release
|
|
|
|
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
|
|
|
needs:
|
|
|
|
- upload_assets
|
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_TAG
|
|
|
|
script:
|
2022-09-04 11:30:03 +00:00
|
|
|
- echo "running release_job"
|
|
|
|
release: # See https://docs.gitlab.com/ee/ci/yaml/#release for available properties
|
|
|
|
tag_name: '$CI_COMMIT_TAG'
|
|
|
|
description: 'Release $CI_COMMIT_TAG'
|
|
|
|
assets:
|
|
|
|
links:
|
2022-09-04 12:41:21 +00:00
|
|
|
- name: 'linux-x64-glibc.tar.xz'
|
|
|
|
url: '${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/linux-x64-glibc/$CI_COMMIT_TAG/linux-x64-glibc.tar.xz'
|
2022-09-04 11:30:03 +00:00
|
|
|
link_type: package
|
2022-09-04 12:41:21 +00:00
|
|
|
- name: 'linux-x64-muslc.tar.xz'
|
|
|
|
url: '${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/linux-x64-muslc/$CI_COMMIT_TAG/linux-x64-muslc.tar.xz'
|
2022-09-04 11:30:03 +00:00
|
|
|
link_type: package
|