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-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
|
|
|
(
|
|
|
|
$CI_COMMIT_BRANCH =~ /(stable|develop)/ ||
|
|
|
|
$CI_COMMIT_TAG
|
|
|
|
)
|
2022-12-14 15:48:29 +00:00
|
|
|
# Run for merge requests from any repo or branches
|
2022-09-08 12:09:51 +00:00
|
|
|
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
|
|
|
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
|
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/**/*]
|
|
|
|
|
|
|
|
image: $CI_REGISTRY/funkwhale/ci/python:3.11
|
2019-06-13 12:50:31 +00:00
|
|
|
variables:
|
|
|
|
BUILD_PATH: "../docs-review"
|
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:
|
|
|
|
- mkdir docs-review
|
|
|
|
- cd docs
|
|
|
|
- apt-get update
|
2022-03-02 14:50:59 +00:00
|
|
|
- apt-get install -y graphviz git
|
|
|
|
- poetry install
|
2022-03-21 11:12:36 +00:00
|
|
|
- git switch develop && git pull
|
|
|
|
- git switch stable && git pull
|
|
|
|
- git switch $CI_COMMIT_BRANCH && git pull
|
2019-06-13 12:50:31 +00:00
|
|
|
script:
|
2023-01-13 14:22:05 +00:00
|
|
|
- poetry run python3 -m sphinx . $BUILD_PATH
|
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-mail
|
|
|
|
--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
|
2023-01-30 21:15:16 +00:00
|
|
|
needs: []
|
2022-02-05 21:42:31 +00:00
|
|
|
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:
|
|
|
|
- git fetch origin "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME"
|
|
|
|
- git diff --name-only FETCH_HEAD | 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
|
|
|
|
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:
|
|
|
|
- PYTHON_VERSION: ["3.8", "3.9", "3.10", "3.11"]
|
2017-12-28 21:59:43 +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
|
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-01-18 22:47:17 +00:00
|
|
|
- poetry 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:
|
|
|
|
# Disabled for now since no vitest dom emulation is providing
|
|
|
|
# AudioContext, which is required for our HTML audio player
|
|
|
|
- when: never
|
|
|
|
- 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:
|
|
|
|
junit: front/coverage/cobertura-coverage.xml
|
2017-06-25 17:13:46 +00:00
|
|
|
|
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
|
|
|
|
- poetry 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/**/*]
|
|
|
|
|
|
|
|
image: $CI_REGISTRY/funkwhale/ci/python:3.11
|
2022-12-12 18:55:39 +00:00
|
|
|
variables:
|
|
|
|
BUILD_PATH: "../public"
|
|
|
|
GIT_STRATEGY: clone
|
|
|
|
GIT_DEPTH: 0
|
2023-01-19 01:26:08 +00:00
|
|
|
cache: *docs_cache
|
2022-12-12 18:55:39 +00:00
|
|
|
before_script:
|
|
|
|
- cd docs
|
|
|
|
- apt-get update
|
|
|
|
- apt-get install -y graphviz
|
|
|
|
- poetry install
|
2023-01-27 14:48:53 +00:00
|
|
|
- poetry run pip install --no-deps --editable ../api
|
2022-12-12 18:55:39 +00:00
|
|
|
- git branch stable --track origin/stable || true
|
|
|
|
- git branch develop --track origin/develop || true
|
|
|
|
script:
|
|
|
|
- ./build_docs.sh
|
|
|
|
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-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
|
|
|
|
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:
|
|
|
|
- if: $CI_COMMIT_BRANCH == "stable"
|
|
|
|
|
|
|
|
image: $CI_REGISTRY/funkwhale/ci/python:3.11
|
2022-03-30 10:08:43 +00:00
|
|
|
script:
|
|
|
|
- rsync -r -e "ssh -p 2282" $CI_PROJECT_DIR/public/ docs@docs.funkwhale.audio:/htdocs/
|
|
|
|
|
2023-01-30 21:15:57 +00:00
|
|
|
.docker:
|
2023-01-29 13:45:36 +00:00
|
|
|
interruptible: false
|
2023-01-30 21:15:57 +00:00
|
|
|
stage: build
|
2023-01-30 21:15:16 +00:00
|
|
|
needs:
|
|
|
|
- job: test_api
|
|
|
|
optional: true
|
|
|
|
- job: test_front
|
|
|
|
optional: true
|
2023-01-18 22:57:50 +00:00
|
|
|
|
2023-01-31 11:31:31 +00:00
|
|
|
image: $CI_REGISTRY/funkwhale/ci/docker:20
|
2022-12-14 15:31:53 +00:00
|
|
|
parallel:
|
|
|
|
matrix:
|
|
|
|
- COMPONENT: ["api", "front"]
|
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-12 18:55:39 +00:00
|
|
|
IMAGE_NAME: funkwhale/$COMPONENT
|
2022-12-14 15:31:53 +00:00
|
|
|
IMAGE: $IMAGE_NAME:$CI_COMMIT_REF_NAME
|
|
|
|
IMAGE_LATEST: $IMAGE_NAME:latest
|
|
|
|
|
|
|
|
DOCKER_HOST: tcp://docker:2375/
|
|
|
|
DOCKER_DRIVER: overlay2
|
|
|
|
DOCKER_TLS_CERTDIR: ""
|
|
|
|
BUILD_PLATFORMS: linux/amd64,linux/arm64,linux/arm/v7
|
2021-11-06 21:55:25 +00:00
|
|
|
tags:
|
|
|
|
- multiarch
|
2017-06-26 17:48:09 +00:00
|
|
|
before_script:
|
2017-06-26 17:51:25 +00:00
|
|
|
- docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
|
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
|
2022-08-22 17:40:31 +00:00
|
|
|
cache:
|
|
|
|
key: docker_public_${CI_COMMIT_REF_NAME}
|
|
|
|
paths:
|
|
|
|
- ~/.cargo
|
2021-11-06 21:55:25 +00:00
|
|
|
|
2022-12-16 01:42:53 +00:00
|
|
|
docker_stable:
|
2023-01-30 21:15:57 +00:00
|
|
|
extends: .docker
|
2021-11-06 21:55:25 +00:00
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_TAG && $CI_COMMIT_REF_NAME =~ /^[0-9]+(.[0-9]+){1,2}$/
|
|
|
|
script:
|
|
|
|
- ./docs/get-releases-json.py | scripts/is-docker-latest.py $CI_COMMIT_TAG - && export DOCKER_LATEST_TAG="-t $IMAGE_LATEST" || export DOCKER_LATEST_TAG=;
|
2022-02-03 08:32:59 +00:00
|
|
|
- export major="$(echo $CI_COMMIT_REF_NAME | cut -d '.' -f 1)"
|
2021-12-29 19:20:29 +00:00
|
|
|
- export minor="$(echo $CI_COMMIT_REF_NAME | cut -d '.' -f 1,2)"
|
2022-06-28 13:55:54 +00:00
|
|
|
- cd $COMPONENT
|
2021-11-06 21:55:25 +00:00
|
|
|
- docker buildx create --use --name A$CI_COMMIT_SHORT_SHA
|
2021-12-29 19:20:29 +00:00
|
|
|
- docker buildx build --platform $BUILD_PLATFORMS --push -t $IMAGE $DOCKER_LATEST_TAG -t $IMAGE_NAME:$major -t $IMAGE_NAME:$minor .
|
2021-11-06 21:55:25 +00:00
|
|
|
|
2022-12-16 01:42:53 +00:00
|
|
|
docker_unstable:
|
2023-01-30 21:15:57 +00:00
|
|
|
extends: .docker
|
2021-11-06 21:55:25 +00:00
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_TAG && $CI_COMMIT_REF_NAME !~ /^[0-9]+(.[0-9]+){1,2}$/
|
|
|
|
script:
|
2022-06-28 13:55:54 +00:00
|
|
|
- cd $COMPONENT
|
2021-11-06 21:55:25 +00:00
|
|
|
- docker buildx create --use --name A$CI_COMMIT_SHORT_SHA
|
|
|
|
- docker buildx build --platform $BUILD_PLATFORMS --push -t $IMAGE .
|
|
|
|
|
2022-12-16 01:42:53 +00:00
|
|
|
docker_dev:
|
2023-01-30 21:15:57 +00:00
|
|
|
extends: .docker
|
2017-06-26 17:48:09 +00:00
|
|
|
only:
|
2018-04-22 12:06:13 +00:00
|
|
|
- develop@funkwhale/funkwhale
|
2021-09-21 11:36:16 +00:00
|
|
|
- stable@funkwhale/funkwhale
|
2021-11-06 21:55:25 +00:00
|
|
|
script:
|
2022-06-28 13:55:54 +00:00
|
|
|
- cd $COMPONENT
|
2021-11-06 21:55:25 +00:00
|
|
|
- docker buildx create --use --name A$CI_COMMIT_SHORT_SHA
|
|
|
|
- docker buildx build --platform $BUILD_PLATFORMS --push -t $IMAGE .
|