2022-12-14 15:31:53 +00:00
|
|
|
---
|
2022-12-14 15:51:42 +00:00
|
|
|
include:
|
|
|
|
- project: funkwhale/ci
|
|
|
|
file: /templates/pre-commit.yml
|
|
|
|
- project: funkwhale/ci
|
|
|
|
file: /templates/lychee.yml
|
2023-01-28 20:37:55 +00:00
|
|
|
- project: funkwhale/ci
|
|
|
|
file: /templates/ssh-agent.yml
|
2022-12-14 15:51:42 +00:00
|
|
|
|
2017-06-26 20:04:55 +00:00
|
|
|
variables:
|
2018-06-09 15:03:06 +00:00
|
|
|
PYTHONDONTWRITEBYTECODE: "true"
|
2022-12-14 15:31:53 +00:00
|
|
|
|
|
|
|
PIP_CACHE_DIR: $CI_PROJECT_DIR/.cache/pip
|
2022-12-17 18:04:45 +00:00
|
|
|
YARN_CACHE_FOLDER: $CI_PROJECT_DIR/.cache/yarn
|
2023-01-18 22:51:40 +00:00
|
|
|
POETRY_VIRTUALENVS_IN_PROJECT: "true"
|
2017-06-26 20:04:55 +00:00
|
|
|
|
2022-12-14 15:35:26 +00:00
|
|
|
.shared_variables:
|
|
|
|
# Keep the git files permissions during job setup
|
|
|
|
keep_git_files_permissions: &keep_git_files_permissions
|
|
|
|
GIT_STRATEGY: clone
|
|
|
|
GIT_DEPTH: "5"
|
|
|
|
FF_DISABLE_UMASK_FOR_DOCKER_EXECUTOR: "true"
|
|
|
|
|
2023-01-18 22:04:39 +00:00
|
|
|
.shared_caches:
|
|
|
|
# Cache for front related jobs
|
|
|
|
front_cache: &front_cache
|
|
|
|
- key: front-yarn
|
|
|
|
paths: [$YARN_CACHE_FOLDER]
|
|
|
|
- key:
|
|
|
|
prefix: front-node_modules
|
|
|
|
files: [front/yarn.lock]
|
|
|
|
paths: [front/node_modules]
|
2023-06-19 21:24:49 +00:00
|
|
|
- key:
|
|
|
|
prefix: front-lint
|
2023-06-19 21:30:33 +00:00
|
|
|
files:
|
|
|
|
- front/.eslintcache
|
|
|
|
- front/tsconfig.tsbuildinfo
|
2023-01-18 22:04:39 +00:00
|
|
|
|
2023-01-18 22:51:40 +00:00
|
|
|
# Cache for api related jobs
|
|
|
|
# Include the python version to prevent loosing caches in the test matrix
|
|
|
|
api_cache: &api_cache
|
|
|
|
- key: api-pip-$PYTHON_VERSION
|
|
|
|
paths: [$PIP_CACHE_DIR]
|
|
|
|
- key:
|
|
|
|
prefix: api-venv-$PYTHON_VERSION
|
|
|
|
files: [api/poetry.lock]
|
|
|
|
paths: [api/.venv]
|
|
|
|
|
2023-01-19 01:26:08 +00:00
|
|
|
# Cache for docs related jobs
|
|
|
|
docs_cache: &docs_cache
|
|
|
|
- key: docs-pip
|
|
|
|
paths: [$PIP_CACHE_DIR]
|
|
|
|
- key:
|
|
|
|
prefix: docs-venv
|
|
|
|
files: [docs/poetry.lock]
|
|
|
|
paths: [docs/.venv]
|
|
|
|
|
2022-12-14 15:46:25 +00:00
|
|
|
default:
|
2023-01-29 13:45:36 +00:00
|
|
|
interruptible: true
|
2022-12-14 15:46:25 +00:00
|
|
|
tags:
|
|
|
|
- docker
|
|
|
|
|
2022-09-08 12:09:51 +00:00
|
|
|
workflow:
|
|
|
|
rules:
|
2022-12-14 15:48:29 +00:00
|
|
|
# Run for any event on the default branches in the funkwhale namespace
|
|
|
|
- if: >
|
|
|
|
$CI_PROJECT_NAMESPACE == "funkwhale" &&
|
2023-01-20 14:19:43 +00:00
|
|
|
(
|
2023-06-09 09:33:49 +00:00
|
|
|
$CI_COMMIT_BRANCH =~ /^(stable|develop)$/ ||
|
2023-01-20 14:19:43 +00:00
|
|
|
$CI_COMMIT_TAG
|
|
|
|
)
|
2022-12-14 15:48:29 +00:00
|
|
|
# Run for merge requests from any repo or branches
|
2023-04-14 13:21:08 +00:00
|
|
|
- if: $CI_MERGE_REQUEST_ID
|
2022-09-08 12:09:51 +00:00
|
|
|
|
2017-06-25 17:12:23 +00:00
|
|
|
stages:
|
2022-12-14 15:36:53 +00:00
|
|
|
- review
|
2018-06-09 14:00:00 +00:00
|
|
|
- lint
|
2021-05-28 09:39:27 +00:00
|
|
|
- test
|
2022-09-08 12:09:51 +00:00
|
|
|
- build
|
|
|
|
- publish
|
2017-06-25 17:13:46 +00:00
|
|
|
|
2018-06-24 10:37:01 +00:00
|
|
|
review_front:
|
2018-06-23 14:51:31 +00:00
|
|
|
allow_failure: true
|
2022-12-17 18:13:55 +00:00
|
|
|
stage: review
|
2023-01-30 21:15:16 +00:00
|
|
|
needs: []
|
2022-12-17 18:13:55 +00:00
|
|
|
rules:
|
|
|
|
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
|
|
when: manual
|
|
|
|
|
|
|
|
image: $CI_REGISTRY/funkwhale/ci/node-python:18
|
2019-06-13 12:09:07 +00:00
|
|
|
variables:
|
|
|
|
BASE_URL: /-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/front-review/
|
|
|
|
VUE_APP_ROUTER_BASE_URL: /-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/front-review/
|
2022-12-15 16:16:57 +00:00
|
|
|
VUE_APP_INSTANCE_URL: https://demo.funkwhale.audio
|
2021-12-12 13:32:45 +00:00
|
|
|
NODE_ENV: review
|
2023-09-01 12:09:58 +00:00
|
|
|
NODE_OPTIONS: --max-old-space-size=4096
|
2022-12-17 18:13:55 +00:00
|
|
|
environment:
|
|
|
|
name: review/front/$CI_COMMIT_REF_NAME
|
|
|
|
url: http://$CI_PROJECT_NAMESPACE.pages.funkwhale.audio/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/front-review/index.html
|
2023-01-18 22:04:39 +00:00
|
|
|
cache: *front_cache
|
2018-06-23 14:51:31 +00:00
|
|
|
before_script:
|
2019-06-13 12:09:07 +00:00
|
|
|
- mkdir front-review
|
2018-06-23 14:51:31 +00:00
|
|
|
- cd front
|
2022-12-17 18:13:55 +00:00
|
|
|
- yarn install --frozen-lockfile
|
2018-06-23 14:51:31 +00:00
|
|
|
script:
|
2022-12-17 18:13:55 +00:00
|
|
|
- yarn run build --base ./
|
2019-06-13 12:09:07 +00:00
|
|
|
- cp -r dist/* ../front-review
|
|
|
|
artifacts:
|
|
|
|
expire_in: 2 weeks
|
|
|
|
paths:
|
|
|
|
- front-review
|
2018-06-24 10:37:01 +00:00
|
|
|
|
2019-06-13 12:50:31 +00:00
|
|
|
review_docs:
|
|
|
|
allow_failure: true
|
2023-01-19 01:15:43 +00:00
|
|
|
stage: review
|
2023-01-30 21:15:16 +00:00
|
|
|
needs: []
|
2023-01-19 01:15:43 +00:00
|
|
|
rules:
|
|
|
|
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
|
|
changes: [docs/**/*]
|
|
|
|
|
2023-07-17 19:35:44 +00:00
|
|
|
image: $CI_REGISTRY/funkwhale/ci/python-funkwhale-docs:3.11
|
2023-01-19 01:15:43 +00:00
|
|
|
environment:
|
|
|
|
name: review/docs/$CI_COMMIT_REF_NAME
|
|
|
|
url: http://$CI_PROJECT_NAMESPACE.pages.funkwhale.audio/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/docs-review/index.html
|
2023-01-19 01:26:08 +00:00
|
|
|
cache: *docs_cache
|
2019-06-13 12:50:31 +00:00
|
|
|
before_script:
|
|
|
|
- cd docs
|
2023-07-17 19:35:44 +00:00
|
|
|
- make install
|
2019-06-13 12:50:31 +00:00
|
|
|
script:
|
2023-07-17 19:35:44 +00:00
|
|
|
- make build BUILD_DIR=../docs-review
|
2019-06-13 12:50:31 +00:00
|
|
|
artifacts:
|
|
|
|
expire_in: 2 weeks
|
|
|
|
paths:
|
|
|
|
- docs-review
|
|
|
|
|
2022-11-22 20:52:06 +00:00
|
|
|
find_broken_links:
|
2023-01-29 13:59:36 +00:00
|
|
|
extends: [.lychee]
|
2023-01-11 14:58:19 +00:00
|
|
|
allow_failure:
|
|
|
|
exit_codes: 2
|
|
|
|
|
2022-11-22 20:52:06 +00:00
|
|
|
script:
|
|
|
|
- >
|
|
|
|
lychee
|
2022-12-06 14:52:09 +00:00
|
|
|
--cache
|
2023-01-11 14:58:19 +00:00
|
|
|
--no-progress
|
2022-11-22 20:52:06 +00:00
|
|
|
--exclude-all-private
|
|
|
|
--exclude 'demo\.funkwhale\.audio'
|
2022-12-16 13:42:10 +00:00
|
|
|
--exclude 'nginx\.com'
|
2022-11-22 20:52:06 +00:00
|
|
|
--exclude-path 'docs/_templates/'
|
2023-01-11 14:58:19 +00:00
|
|
|
-- . || exit $?
|
2022-11-22 20:52:06 +00:00
|
|
|
|
2022-12-16 01:42:53 +00:00
|
|
|
require_changelog:
|
2022-02-05 21:42:31 +00:00
|
|
|
stage: lint
|
|
|
|
rules:
|
2022-12-16 02:28:17 +00:00
|
|
|
# Don't run on merge request that mention NOCHANGELOG or renovate bot commits
|
|
|
|
- if: >
|
|
|
|
$CI_MERGE_REQUEST_TITLE =~ /NOCHANGELOG/ ||
|
|
|
|
$CI_COMMIT_AUTHOR == "Renovate Bot <bot@dev.funkwhale.audio>"
|
2022-02-05 21:42:31 +00:00
|
|
|
when: never
|
2022-12-16 02:28:17 +00:00
|
|
|
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
|
|
|
|
|
|
image: python:3.11
|
|
|
|
script:
|
2023-02-12 14:55:32 +00:00
|
|
|
- git diff --name-only $CI_MERGE_REQUEST_DIFF_BASE_SHA..$CI_COMMIT_SHA | grep "changes/changelog.d/*"
|
2022-02-05 21:42:31 +00:00
|
|
|
|
2022-11-18 21:24:50 +00:00
|
|
|
pre-commit:
|
2022-12-14 15:51:42 +00:00
|
|
|
extends: [.pre-commit]
|
2022-02-05 21:42:31 +00:00
|
|
|
|
2022-11-24 17:00:58 +00:00
|
|
|
lint_api:
|
|
|
|
allow_failure: true
|
|
|
|
stage: lint
|
2023-01-30 21:15:16 +00:00
|
|
|
needs: []
|
2023-01-30 18:19:16 +00:00
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_BRANCH =~ /(stable|develop)/
|
|
|
|
- changes: [api/**/*]
|
2022-11-24 17:00:58 +00:00
|
|
|
|
|
|
|
image: $CI_REGISTRY/funkwhale/ci/python-funkwhale-api:3.11
|
|
|
|
before_script:
|
|
|
|
- cd api
|
|
|
|
- make install
|
|
|
|
script:
|
|
|
|
- make lint
|
|
|
|
|
2022-12-16 01:42:53 +00:00
|
|
|
lint_front:
|
2021-07-16 18:34:46 +00:00
|
|
|
stage: lint
|
2023-01-30 21:15:16 +00:00
|
|
|
needs: []
|
2022-12-17 18:04:45 +00:00
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_BRANCH =~ /(stable|develop)/
|
|
|
|
- changes: [front/**/*]
|
|
|
|
|
|
|
|
image: $CI_REGISTRY/funkwhale/ci/node-python:18
|
2023-01-18 22:04:39 +00:00
|
|
|
cache: *front_cache
|
2021-07-16 18:34:46 +00:00
|
|
|
before_script:
|
|
|
|
- cd front
|
2022-12-17 18:04:45 +00:00
|
|
|
- yarn install --frozen-lockfile
|
2021-07-16 18:34:46 +00:00
|
|
|
script:
|
2021-12-08 18:48:06 +00:00
|
|
|
- yarn lint --max-warnings 0
|
2022-05-02 08:26:00 +00:00
|
|
|
- yarn lint:tsc
|
2021-07-16 18:34:46 +00:00
|
|
|
|
2023-02-12 14:41:10 +00:00
|
|
|
test_scripts:
|
|
|
|
stage: test
|
|
|
|
needs: []
|
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_BRANCH =~ /(stable|develop)/
|
|
|
|
- changes: [scripts/**/*]
|
|
|
|
|
|
|
|
image: $CI_REGISTRY/funkwhale/ci/python:3.11
|
|
|
|
cache:
|
|
|
|
- key: scripts-pip
|
|
|
|
paths: [$PIP_CACHE_DIR]
|
|
|
|
- key:
|
|
|
|
prefix: scripts-venv
|
|
|
|
files: [scripts/poetry.lock]
|
|
|
|
paths: [scripts/.venv]
|
|
|
|
before_script:
|
|
|
|
- cd scripts
|
|
|
|
- make install
|
|
|
|
script:
|
|
|
|
- make test
|
|
|
|
|
2022-02-05 17:26:10 +00:00
|
|
|
test_api:
|
2023-01-18 22:47:17 +00:00
|
|
|
retry: 1
|
|
|
|
stage: test
|
2023-01-30 21:15:16 +00:00
|
|
|
needs:
|
|
|
|
- job: lint_api
|
2023-01-18 22:47:17 +00:00
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_BRANCH =~ /(stable|develop)/
|
|
|
|
- changes: [api/**/*]
|
|
|
|
|
|
|
|
image: $CI_REGISTRY/funkwhale/ci/python-funkwhale-api:$PYTHON_VERSION
|
|
|
|
parallel:
|
|
|
|
matrix:
|
2023-12-01 19:34:10 +00:00
|
|
|
- PYTHON_VERSION: ["3.8", "3.9", "3.10", "3.11", "3.12"]
|
2017-12-28 21:59:43 +00:00
|
|
|
services:
|
2023-04-14 14:04:17 +00:00
|
|
|
- name: postgres:15-alpine
|
|
|
|
command:
|
|
|
|
- --fsync=off
|
|
|
|
- --full_page_writes=off
|
|
|
|
- --synchronous_commit=off
|
|
|
|
- name: redis:7-alpine
|
2023-01-18 22:51:40 +00:00
|
|
|
cache: *api_cache
|
2017-12-16 15:10:48 +00:00
|
|
|
variables:
|
2017-12-28 21:59:43 +00:00
|
|
|
DATABASE_URL: "postgresql://postgres@postgres/postgres"
|
2018-02-25 13:43:23 +00:00
|
|
|
FUNKWHALE_URL: "https://funkwhale.ci"
|
2018-04-02 17:16:34 +00:00
|
|
|
DJANGO_SETTINGS_MODULE: config.settings.local
|
2020-02-15 11:01:19 +00:00
|
|
|
POSTGRES_HOST_AUTH_METHOD: trust
|
2021-08-14 18:42:16 +00:00
|
|
|
CACHE_URL: "redis://redis:6379/0"
|
2017-06-25 17:13:46 +00:00
|
|
|
before_script:
|
2017-06-26 15:20:46 +00:00
|
|
|
- cd api
|
2023-11-24 13:04:44 +00:00
|
|
|
- make install
|
2017-06-25 17:13:46 +00:00
|
|
|
script:
|
2023-01-18 22:47:17 +00:00
|
|
|
- >
|
|
|
|
poetry run pytest
|
|
|
|
--junitxml=report.xml
|
|
|
|
--cov
|
|
|
|
--cov-config=pyproject.toml
|
|
|
|
--cov-report=term-missing:skip-covered
|
|
|
|
--cov-report=xml
|
|
|
|
tests
|
2021-04-22 13:57:15 +00:00
|
|
|
artifacts:
|
2022-11-03 07:27:03 +00:00
|
|
|
expire_in: 2 weeks
|
2021-04-22 13:57:15 +00:00
|
|
|
reports:
|
2021-04-22 15:04:16 +00:00
|
|
|
junit: api/report.xml
|
2022-06-08 12:12:55 +00:00
|
|
|
coverage_report:
|
|
|
|
coverage_format: cobertura
|
|
|
|
path: api/coverage.xml
|
2022-10-14 06:30:52 +00:00
|
|
|
coverage: '/TOTAL\s*\d*\s*\d*\s*(\d*%)/'
|
2022-01-13 10:48:47 +00:00
|
|
|
|
2023-01-28 20:19:57 +00:00
|
|
|
test_front:
|
|
|
|
stage: test
|
2023-01-30 21:15:16 +00:00
|
|
|
needs:
|
|
|
|
- job: lint_front
|
2023-01-28 20:19:57 +00:00
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_BRANCH =~ /(stable|develop)/
|
|
|
|
- changes: [front/**/*]
|
|
|
|
|
|
|
|
image: $CI_REGISTRY/funkwhale/ci/node-python:18
|
2023-01-18 22:04:39 +00:00
|
|
|
cache: *front_cache
|
2023-01-28 20:19:57 +00:00
|
|
|
before_script:
|
|
|
|
- cd front
|
|
|
|
- yarn install --frozen-lockfile
|
|
|
|
script:
|
|
|
|
- yarn test:unit
|
|
|
|
artifacts:
|
|
|
|
reports:
|
2023-06-11 09:29:39 +00:00
|
|
|
junit: front/test_results.xml
|
|
|
|
coverage_report:
|
|
|
|
coverage_format: cobertura
|
|
|
|
path: front/coverage/cobertura-coverage.xml
|
2024-02-21 10:13:32 +00:00
|
|
|
coverage: '/All files\s+(?:\|\s+((?:\d+\.)?\d+)\s+){4}.*/'
|
2017-06-25 17:13:46 +00:00
|
|
|
|
2023-06-08 09:51:51 +00:00
|
|
|
build_metadata:
|
|
|
|
stage: build
|
|
|
|
|
|
|
|
image: $CI_REGISTRY/funkwhale/ci/python:3.11
|
|
|
|
variables:
|
|
|
|
GIT_FETCH_EXTRA_FLAGS: --prune
|
|
|
|
script:
|
2023-06-13 10:40:38 +00:00
|
|
|
- make build-metadata
|
|
|
|
- make docker-metadata
|
2023-06-08 09:51:51 +00:00
|
|
|
artifacts:
|
|
|
|
reports:
|
|
|
|
dotenv: build_metadata.env
|
2023-06-13 10:40:38 +00:00
|
|
|
paths:
|
|
|
|
- docker-bake.json
|
|
|
|
- docker-bake.api.json
|
|
|
|
- docker-bake.front.json
|
2023-06-08 09:51:51 +00:00
|
|
|
|
2022-05-12 14:53:43 +00:00
|
|
|
test_integration:
|
|
|
|
stage: test
|
2023-06-21 08:04:50 +00:00
|
|
|
rules:
|
|
|
|
- if: $RUN_CYPRESS
|
|
|
|
interruptible: true
|
|
|
|
|
2023-11-13 09:43:18 +00:00
|
|
|
image:
|
2024-02-05 15:03:06 +00:00
|
|
|
name: cypress/included:13.6.4
|
2023-11-13 09:43:18 +00:00
|
|
|
entrypoint: [""]
|
2023-08-24 06:35:44 +00:00
|
|
|
cache:
|
|
|
|
- *front_cache
|
|
|
|
- key:
|
|
|
|
paths:
|
|
|
|
- /root/.cache/Cypress
|
2022-05-12 14:53:43 +00:00
|
|
|
before_script:
|
|
|
|
- cd front
|
|
|
|
- yarn install
|
|
|
|
script:
|
|
|
|
- yarn run cypress run
|
|
|
|
|
2022-12-16 01:42:53 +00:00
|
|
|
build_api_schema:
|
2022-01-28 12:33:39 +00:00
|
|
|
stage: build
|
2023-01-30 21:15:16 +00:00
|
|
|
needs:
|
|
|
|
- job: test_api
|
|
|
|
optional: true
|
2023-01-18 22:53:10 +00:00
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_BRANCH =~ /(stable|develop)/
|
|
|
|
- changes: [api/**/*]
|
2023-01-30 18:13:20 +00:00
|
|
|
# Add build_docs rules because it depends on the build_api_schema artifact
|
|
|
|
- changes: [docs/**/*]
|
2023-01-18 22:53:10 +00:00
|
|
|
|
|
|
|
image: $CI_REGISTRY/funkwhale/ci/python-funkwhale-api:3.11
|
2022-01-28 12:33:39 +00:00
|
|
|
services:
|
2022-10-28 05:25:22 +00:00
|
|
|
- postgres:15-alpine
|
2022-07-10 17:31:37 +00:00
|
|
|
- redis:7-alpine
|
2023-01-18 22:51:40 +00:00
|
|
|
cache: *api_cache
|
2022-01-28 12:33:39 +00:00
|
|
|
variables:
|
|
|
|
DATABASE_URL: "postgresql://postgres@postgres/postgres"
|
|
|
|
FUNKWHALE_URL: "https://funkwhale.ci"
|
|
|
|
DJANGO_SETTINGS_MODULE: config.settings.local
|
|
|
|
POSTGRES_HOST_AUTH_METHOD: trust
|
|
|
|
CACHE_URL: "redis://redis:6379/0"
|
2022-07-16 07:17:12 +00:00
|
|
|
API_TYPE: "v1"
|
2022-01-28 12:33:39 +00:00
|
|
|
before_script:
|
|
|
|
- cd api
|
2023-11-24 13:04:44 +00:00
|
|
|
- make install
|
2023-01-13 15:33:23 +00:00
|
|
|
- poetry run funkwhale-manage migrate
|
2022-01-28 12:33:39 +00:00
|
|
|
script:
|
2023-01-13 15:33:23 +00:00
|
|
|
- poetry run funkwhale-manage spectacular --file ../docs/schema.yml
|
2022-01-28 12:33:39 +00:00
|
|
|
artifacts:
|
2022-11-03 07:27:03 +00:00
|
|
|
expire_in: 2 weeks
|
2022-01-28 12:33:39 +00:00
|
|
|
paths:
|
|
|
|
- docs/schema.yml
|
|
|
|
|
2022-12-16 01:42:53 +00:00
|
|
|
build_docs:
|
2022-12-12 18:55:39 +00:00
|
|
|
stage: build
|
2023-01-30 21:15:16 +00:00
|
|
|
needs:
|
|
|
|
- job: build_api_schema
|
|
|
|
artifacts: true
|
2023-01-19 01:21:08 +00:00
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_BRANCH =~ /(stable|develop)/
|
|
|
|
- changes: [docs/**/*]
|
|
|
|
|
2023-07-17 19:35:44 +00:00
|
|
|
image: $CI_REGISTRY/funkwhale/ci/python-funkwhale-docs:3.11
|
2023-01-19 01:26:08 +00:00
|
|
|
cache: *docs_cache
|
2022-12-12 18:55:39 +00:00
|
|
|
before_script:
|
|
|
|
- cd docs
|
2023-07-17 19:35:44 +00:00
|
|
|
- make install
|
2022-12-12 18:55:39 +00:00
|
|
|
script:
|
2023-07-17 19:35:44 +00:00
|
|
|
- make build-all BUILD_DIR=../public
|
2022-12-12 18:55:39 +00:00
|
|
|
artifacts:
|
|
|
|
expire_in: 2 weeks
|
|
|
|
paths:
|
|
|
|
- public
|
|
|
|
|
2017-06-25 17:13:46 +00:00
|
|
|
build_front:
|
|
|
|
stage: build
|
2023-01-30 21:15:16 +00:00
|
|
|
needs:
|
|
|
|
# The test_front job is currently disabled
|
|
|
|
# - job: test_front
|
|
|
|
- job: lint_front
|
|
|
|
optional: true
|
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_BRANCH =~ /(stable|develop)/
|
|
|
|
- changes: [front/**/*]
|
2022-12-23 15:15:04 +00:00
|
|
|
|
|
|
|
image: $CI_REGISTRY/funkwhale/ci/node-python:18
|
2022-11-19 17:55:10 +00:00
|
|
|
variables:
|
2022-12-14 15:35:26 +00:00
|
|
|
<<: *keep_git_files_permissions
|
2023-09-01 12:09:58 +00:00
|
|
|
NODE_OPTIONS: --max-old-space-size=4096
|
2023-01-18 22:04:39 +00:00
|
|
|
cache: *front_cache
|
2017-06-25 17:13:46 +00:00
|
|
|
before_script:
|
|
|
|
- cd front
|
2022-12-23 15:15:04 +00:00
|
|
|
- yarn install --frozen-lockfile
|
2017-06-25 17:13:46 +00:00
|
|
|
script:
|
2022-12-23 15:15:04 +00:00
|
|
|
- yarn run build:deployment
|
2017-06-25 17:13:46 +00:00
|
|
|
artifacts:
|
2022-11-19 17:55:10 +00:00
|
|
|
name: front_${CI_COMMIT_REF_NAME}
|
2017-06-25 17:13:46 +00:00
|
|
|
paths:
|
2022-12-23 15:15:04 +00:00
|
|
|
- front/dist
|
2017-06-25 14:45:33 +00:00
|
|
|
|
2022-12-12 18:55:39 +00:00
|
|
|
build_api:
|
2022-03-30 10:08:43 +00:00
|
|
|
stage: build
|
2023-01-30 21:15:16 +00:00
|
|
|
needs:
|
|
|
|
- job: test_api
|
|
|
|
optional: true
|
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_BRANCH =~ /(stable|develop)/
|
|
|
|
- changes: [api/**/*]
|
2022-12-23 15:21:07 +00:00
|
|
|
|
|
|
|
image: $CI_REGISTRY/funkwhale/ci/python:3.11
|
2018-04-26 16:12:08 +00:00
|
|
|
variables:
|
2022-12-14 15:35:26 +00:00
|
|
|
<<: *keep_git_files_permissions
|
2018-06-24 21:42:38 +00:00
|
|
|
script:
|
2022-12-12 18:55:39 +00:00
|
|
|
- rm -rf api/tests
|
|
|
|
- >
|
2023-01-31 11:30:59 +00:00
|
|
|
if [[ -z "$CI_COMMIT_TAG" ]]; then
|
2022-12-12 18:55:39 +00:00
|
|
|
./scripts/set-api-build-metadata.sh $CI_COMMIT_SHORT_SHA;
|
|
|
|
fi
|
2017-06-25 17:05:31 +00:00
|
|
|
artifacts:
|
2022-12-12 18:55:39 +00:00
|
|
|
name: api_${CI_COMMIT_REF_NAME}
|
2017-06-25 17:05:31 +00:00
|
|
|
paths:
|
2022-12-12 18:55:39 +00:00
|
|
|
- api
|
2017-06-26 17:48:09 +00:00
|
|
|
|
2024-02-21 09:55:32 +00:00
|
|
|
build_tauri:
|
2024-02-02 12:27:28 +00:00
|
|
|
stage: build
|
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_BRANCH =~ /(stable|develop)/
|
|
|
|
- changes: [front/**/*]
|
|
|
|
|
|
|
|
image: $CI_REGISTRY/funkwhale/ci/node-tauri:18
|
|
|
|
variables:
|
|
|
|
<<: *keep_git_files_permissions
|
2024-02-05 09:47:45 +00:00
|
|
|
before_script:
|
2024-02-05 11:38:51 +00:00
|
|
|
- source /root/.cargo/env
|
2024-02-05 09:47:45 +00:00
|
|
|
- yarn install
|
2024-02-02 12:27:28 +00:00
|
|
|
script:
|
2024-02-14 09:12:05 +00:00
|
|
|
- yarn tauri build --verbose
|
2024-02-02 12:27:28 +00:00
|
|
|
artifacts:
|
|
|
|
name: desktop_${CI_COMMIT_REF_NAME}
|
|
|
|
paths:
|
2024-02-05 12:37:25 +00:00
|
|
|
- front/tauri/target/release/bundle/appimage/*.AppImage
|
2024-02-02 12:27:28 +00:00
|
|
|
|
2022-12-16 01:42:53 +00:00
|
|
|
deploy_docs:
|
2023-01-29 13:45:36 +00:00
|
|
|
interruptible: false
|
2023-01-28 20:37:55 +00:00
|
|
|
extends: .ssh-agent
|
2022-09-08 12:09:51 +00:00
|
|
|
stage: publish
|
2023-01-30 21:15:16 +00:00
|
|
|
needs:
|
|
|
|
- job: build_docs
|
|
|
|
artifacts: true
|
2023-01-28 20:37:55 +00:00
|
|
|
rules:
|
2023-04-05 18:53:10 +00:00
|
|
|
- if: $CI_COMMIT_BRANCH =~ /(stable|develop)/
|
2023-01-28 20:37:55 +00:00
|
|
|
|
|
|
|
image: $CI_REGISTRY/funkwhale/ci/python:3.11
|
2023-01-31 18:56:17 +00:00
|
|
|
variables:
|
|
|
|
GIT_STRATEGY: none
|
2023-06-08 10:49:57 +00:00
|
|
|
script:
|
2023-09-13 06:45:27 +00:00
|
|
|
- rsync -r --delete -e "ssh -p 2282" $CI_PROJECT_DIR/public/ docs@docs.funkwhale.audio:/htdocs/$CI_COMMIT_REF_NAME
|
2022-03-30 10:08:43 +00:00
|
|
|
|
2023-02-12 12:53:42 +00:00
|
|
|
docker:
|
2023-01-29 13:45:36 +00:00
|
|
|
interruptible: false
|
2023-02-12 12:53:42 +00:00
|
|
|
tags: [docker, privileged, multiarch]
|
2023-01-30 21:15:57 +00:00
|
|
|
stage: build
|
2023-01-30 21:15:16 +00:00
|
|
|
needs:
|
2023-06-13 10:40:38 +00:00
|
|
|
- job: build_metadata
|
|
|
|
artifacts: true
|
2023-01-30 21:15:16 +00:00
|
|
|
- job: test_api
|
|
|
|
optional: true
|
|
|
|
- job: test_front
|
|
|
|
optional: true
|
2023-02-12 12:53:42 +00:00
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_TAG
|
|
|
|
variables:
|
|
|
|
BUILD_ARGS: >
|
|
|
|
--set *.platform=linux/amd64,linux/arm64,linux/arm/v7
|
2023-11-29 11:09:15 +00:00
|
|
|
--no-cache
|
2023-02-12 12:53:42 +00:00
|
|
|
--push
|
|
|
|
|
|
|
|
- if: $CI_COMMIT_BRANCH =~ /(stable|develop)/
|
|
|
|
variables:
|
|
|
|
BUILD_ARGS: >
|
|
|
|
--set *.platform=linux/amd64,linux/arm64,linux/arm/v7
|
2023-11-07 12:53:09 +00:00
|
|
|
--set *.cache-from=type=registry,ref=$DOCKER_CACHE_IMAGE:$CI_COMMIT_BRANCH,oci-mediatypes=false
|
|
|
|
--set *.cache-to=type=registry,ref=$DOCKER_CACHE_IMAGE:$CI_COMMIT_BRANCH,mode=max,oci-mediatypes=false
|
2023-02-12 12:53:42 +00:00
|
|
|
--push
|
|
|
|
|
2024-01-10 11:08:40 +00:00
|
|
|
- if: $CI_PIPELINE_SOURCE == "merge_request_event" && $CI_PROJECT_NAMESPACE == "funkwhale"
|
2024-01-08 13:40:26 +00:00
|
|
|
# We don't provide priviledged runners to everyone, so we can only build docker images in the funkwhale group
|
2023-02-12 12:53:42 +00:00
|
|
|
variables:
|
|
|
|
BUILD_ARGS: >
|
|
|
|
--set *.platform=linux/amd64
|
2023-11-07 12:53:09 +00:00
|
|
|
--set *.cache-from=type=registry,ref=$DOCKER_CACHE_IMAGE:$CI_MERGE_REQUEST_TARGET_BRANCH_NAME,oci-mediatypes=false
|
2023-01-18 22:57:50 +00:00
|
|
|
|
2023-01-31 11:31:31 +00:00
|
|
|
image: $CI_REGISTRY/funkwhale/ci/docker:20
|
2023-01-18 22:57:50 +00:00
|
|
|
services:
|
|
|
|
- docker:20-dind
|
2022-12-12 18:55:39 +00:00
|
|
|
variables:
|
2022-12-14 15:35:26 +00:00
|
|
|
<<: *keep_git_files_permissions
|
2022-12-14 15:31:53 +00:00
|
|
|
DOCKER_HOST: tcp://docker:2375/
|
|
|
|
DOCKER_DRIVER: overlay2
|
|
|
|
DOCKER_TLS_CERTDIR: ""
|
2023-02-12 12:53:42 +00:00
|
|
|
BUILDKIT_PROGRESS: plain
|
|
|
|
|
|
|
|
DOCKER_CACHE_IMAGE: $CI_REGISTRY/funkwhale/funkwhale/cache
|
2017-06-26 17:48:09 +00:00
|
|
|
before_script:
|
2023-02-12 12:53:42 +00:00
|
|
|
- >
|
|
|
|
echo "$CI_REGISTRY_PASSWORD" | docker login --username "$CI_REGISTRY_USER" --password-stdin "$CI_REGISTRY";
|
|
|
|
if [[ "$BUILD_ARGS" =~ "--push" ]]; then
|
|
|
|
echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_LOGIN" --password-stdin docker.io;
|
|
|
|
fi
|
|
|
|
script:
|
2023-01-29 14:29:57 +00:00
|
|
|
- >
|
2023-01-31 11:30:59 +00:00
|
|
|
if [[ -z "$CI_COMMIT_TAG" ]]; then
|
2023-01-29 14:29:57 +00:00
|
|
|
./scripts/set-api-build-metadata.sh $CI_COMMIT_SHORT_SHA;
|
|
|
|
fi
|
2023-02-12 12:53:42 +00:00
|
|
|
- docker buildx create --use
|
|
|
|
- make docker-build BUILD_ARGS="--metadata-file metadata.json $BUILD_ARGS"
|
|
|
|
- cat metadata.json
|
|
|
|
artifacts:
|
2023-06-13 10:40:38 +00:00
|
|
|
name: docker_metadata_${CI_COMMIT_REF_NAME}
|
2022-08-22 17:40:31 +00:00
|
|
|
paths:
|
2023-02-12 12:53:42 +00:00
|
|
|
- metadata.json
|
2023-02-13 11:53:33 +00:00
|
|
|
|
2024-01-05 11:19:18 +00:00
|
|
|
package:
|
2023-02-13 11:53:33 +00:00
|
|
|
stage: publish
|
|
|
|
needs:
|
|
|
|
- job: build_metadata
|
|
|
|
artifacts: true
|
|
|
|
- job: build_api
|
|
|
|
artifacts: true
|
|
|
|
- job: build_front
|
|
|
|
artifacts: true
|
2024-02-21 09:55:32 +00:00
|
|
|
- job: build_tauri
|
|
|
|
artifacts: true
|
2024-01-05 11:19:18 +00:00
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_BRANCH =~ /(stable|develop)/
|
2023-02-13 11:53:33 +00:00
|
|
|
|
|
|
|
image: $CI_REGISTRY/funkwhale/ci/python:3.11
|
|
|
|
variables:
|
|
|
|
<<: *keep_git_files_permissions
|
|
|
|
script:
|
2024-01-05 11:19:18 +00:00
|
|
|
- make package
|
|
|
|
- scripts/ci-upload-packages.sh
|