fix(ci): fix CI build_documentation job swagger-UI generation and remove leftovers NOCHANGELOG
This commit is contained in:
parent
5356e9f268
commit
05cb102b21
6 changed files with 71 additions and 3107 deletions
117
.gitlab-ci.yml
117
.gitlab-ci.yml
|
|
@ -250,9 +250,9 @@ test_api:
|
|||
# - if: $CI_COMMIT_REF_PROTECTED == "true"
|
||||
# when: always
|
||||
|
||||
build_docs:
|
||||
build_openapi_schema:
|
||||
stage: build
|
||||
image: $CI_REGISTRY/funkwhale/backend-test-docker:3.10
|
||||
image: $CI_REGISTRY/funkwhale/backend-test-docker:3.11
|
||||
services:
|
||||
- postgres:15-alpine
|
||||
- redis:7-alpine
|
||||
|
|
@ -281,6 +281,44 @@ build_docs:
|
|||
paths:
|
||||
- docs/schema.yml
|
||||
|
||||
build_documentation:
|
||||
stage: build
|
||||
image: python:3.11
|
||||
needs:
|
||||
- build_openapi_schema
|
||||
dependencies:
|
||||
- build_openapi_schema
|
||||
variables:
|
||||
BUILD_PATH: "../public"
|
||||
GIT_STRATEGY: clone
|
||||
GIT_DEPTH: 0
|
||||
before_script:
|
||||
- cd docs
|
||||
- apt-get update
|
||||
- apt-get install -y graphviz
|
||||
- pip install poetry
|
||||
- poetry install
|
||||
- git branch stable --track origin/stable || true
|
||||
- git branch develop --track origin/develop || true
|
||||
script:
|
||||
- ./build_docs.sh
|
||||
cache:
|
||||
key: "$CI_PROJECT_ID__sphinx"
|
||||
paths:
|
||||
- "$PIP_CACHE_DIR"
|
||||
artifacts:
|
||||
expire_in: 2 weeks
|
||||
paths:
|
||||
- public
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == "stable" || $CI_COMMIT_BRANCH == "develop"
|
||||
when: always
|
||||
- changes:
|
||||
- docs/**/*
|
||||
when: always
|
||||
tags:
|
||||
- docker
|
||||
|
||||
build_front:
|
||||
stage: build
|
||||
image: node:18-alpine
|
||||
|
|
@ -308,39 +346,28 @@ build_front:
|
|||
tags:
|
||||
- docker
|
||||
|
||||
build_documentation:
|
||||
build_api:
|
||||
stage: build
|
||||
image: python:3.11
|
||||
image: bash
|
||||
variables:
|
||||
BUILD_PATH: "../public"
|
||||
before_script:
|
||||
- cd docs
|
||||
- apt-get update
|
||||
- apt-get install -y graphviz git
|
||||
- pip install poetry
|
||||
- poetry install
|
||||
- git switch develop && git pull
|
||||
- git switch stable && git pull
|
||||
- git switch $CI_COMMIT_BRANCH && git pull
|
||||
# Keep the git files attributes during job setup
|
||||
GIT_STRATEGY: clone
|
||||
GIT_DEPTH: "5"
|
||||
FF_DISABLE_UMASK_FOR_DOCKER_EXECUTOR: "true"
|
||||
script:
|
||||
- ./build_docs.sh
|
||||
cache:
|
||||
key: "$CI_PROJECT_ID__sphinx"
|
||||
paths:
|
||||
- "$PIP_CACHE_DIR"
|
||||
- rm -rf api/tests
|
||||
- >
|
||||
if [ "$CI_COMMIT_REF_NAME" == "develop" ] || [ "$CI_COMMIT_REF_NAME" == "stable" ]; then
|
||||
./scripts/set-api-build-metadata.sh $CI_COMMIT_SHORT_SHA;
|
||||
fi
|
||||
artifacts:
|
||||
expire_in: 2 weeks
|
||||
name: api_${CI_COMMIT_REF_NAME}
|
||||
paths:
|
||||
- public
|
||||
rules:
|
||||
- if: $CI_COMMIT_BRANCH == "stable"
|
||||
when: always
|
||||
- if: $CI_COMMIT_BRANCH == "develop"
|
||||
changes:
|
||||
- docs/**/*
|
||||
when: always
|
||||
tags:
|
||||
- docker
|
||||
- api
|
||||
only:
|
||||
- tags@funkwhale/funkwhale
|
||||
- stable@funkwhale/funkwhale
|
||||
- develop@funkwhale/funkwhale
|
||||
|
||||
deploy_documentation:
|
||||
stage: publish
|
||||
|
|
@ -362,6 +389,9 @@ deploy_documentation:
|
|||
.docker_publish:
|
||||
stage: publish
|
||||
image: egon0/docker-with-buildx-and-git:bash
|
||||
variables:
|
||||
IMAGE_NAME: funkwhale/$COMPONENT
|
||||
FF_DISABLE_UMASK_FOR_DOCKER_EXECUTOR: "true"
|
||||
tags:
|
||||
- multiarch
|
||||
services:
|
||||
|
|
@ -372,13 +402,10 @@ deploy_documentation:
|
|||
key: docker_public_${CI_COMMIT_REF_NAME}
|
||||
paths:
|
||||
- ~/.cargo
|
||||
script:
|
||||
|
||||
docker_publish_stable_release:
|
||||
# Publish a docker image for releases
|
||||
extends: .docker_publish
|
||||
variables:
|
||||
IMAGE_NAME: funkwhale/$COMPONENT
|
||||
rules:
|
||||
- if: $CI_COMMIT_TAG && $CI_COMMIT_REF_NAME =~ /^[0-9]+(.[0-9]+){1,2}$/
|
||||
script:
|
||||
|
|
@ -425,27 +452,3 @@ docker_publish_non-release:
|
|||
parallel:
|
||||
matrix:
|
||||
- COMPONENT: ["api", "front"]
|
||||
|
||||
build_api:
|
||||
# Simply publish a zip containing api/ directory
|
||||
stage: publish
|
||||
image: bash
|
||||
variables:
|
||||
# Keep the git files attributes during job setup
|
||||
GIT_STRATEGY: clone
|
||||
GIT_DEPTH: "5"
|
||||
FF_DISABLE_UMASK_FOR_DOCKER_EXECUTOR: "true"
|
||||
script:
|
||||
- rm -rf api/tests
|
||||
- >
|
||||
if [ "$CI_COMMIT_REF_NAME" == "develop" ] || [ "$CI_COMMIT_REF_NAME" == "stable" ]; then
|
||||
./scripts/set-api-build-metadata.sh $(echo $CI_COMMIT_SHA | cut -c 1-8);
|
||||
fi
|
||||
artifacts:
|
||||
name: api_${CI_COMMIT_REF_NAME}
|
||||
paths:
|
||||
- api
|
||||
only:
|
||||
- tags@funkwhale/funkwhale
|
||||
- stable@funkwhale/funkwhale
|
||||
- develop@funkwhale/funkwhale
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue