Merge pull request 'CI improvements' (#3533) from ci-improvements into develop
Reviewed-on: https://git.pleroma.social/pleroma/pleroma-fe/pulls/3533
This commit is contained in:
commit
e9fb826820
7 changed files with 99 additions and 44 deletions
36
.woodpecker/build-package.yaml
Normal file
36
.woodpecker/build-package.yaml
Normal file
|
|
@ -0,0 +1,36 @@
|
||||||
|
when:
|
||||||
|
- event: push
|
||||||
|
branch: ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
- event: manual
|
||||||
|
branch: ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- test
|
||||||
|
- test-e2e
|
||||||
|
|
||||||
|
labels:
|
||||||
|
platform: linux/amd64
|
||||||
|
memory: 'high'
|
||||||
|
|
||||||
|
steps:
|
||||||
|
build:
|
||||||
|
image: docker.io/node:20-alpine
|
||||||
|
commands:
|
||||||
|
- apk add --no-cache zip git
|
||||||
|
- yarn --frozen-lockfile
|
||||||
|
- yarn build
|
||||||
|
- if [ "${CI_PIPELINE_EVENT}" = "push" ] || [ "${CI_PIPELINE_EVENT}" = "manual" ]; then zip -9qr ${CI_REPO_DEFAULT_BRANCH}.zip dist/; fi
|
||||||
|
|
||||||
|
upload-artifacts:
|
||||||
|
image: docker.io/woodpeckercommunity/plugin-gitea-package:0.5.0
|
||||||
|
settings:
|
||||||
|
user:
|
||||||
|
from_secret: pleroma-ci-user
|
||||||
|
password:
|
||||||
|
from_secret: pleroma-ci-password
|
||||||
|
update: true
|
||||||
|
owner: 'pleroma'
|
||||||
|
package_name: 'pleroma-fe-builds'
|
||||||
|
package_version: ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
file_source: ./${CI_REPO_DEFAULT_BRANCH}.zip
|
||||||
|
file_name: latest.zip
|
||||||
|
|
@ -6,38 +6,12 @@ when:
|
||||||
- event: manual
|
- event: manual
|
||||||
branch: ${CI_REPO_DEFAULT_BRANCH}
|
branch: ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
|
||||||
depends_on:
|
|
||||||
- test
|
|
||||||
- test-e2e
|
|
||||||
|
|
||||||
labels:
|
labels:
|
||||||
platform: linux/amd64
|
platform: linux/amd64
|
||||||
memory: 'high'
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
build:
|
build:
|
||||||
image: docker.io/node:20-alpine
|
image: docker.io/node:20-alpine
|
||||||
commands:
|
commands:
|
||||||
- apk add --no-cache zip git
|
|
||||||
- yarn --frozen-lockfile
|
- yarn --frozen-lockfile
|
||||||
- yarn build
|
- yarn build
|
||||||
- if [ "${CI_PIPELINE_EVENT}" = "push" ] || [ "${CI_PIPELINE_EVENT}" = "manual" ]; then zip -9qr ${CI_REPO_DEFAULT_BRANCH}.zip dist/; fi
|
|
||||||
|
|
||||||
upload-artifacts:
|
|
||||||
image: docker.io/woodpeckercommunity/plugin-gitea-package:0.5.0
|
|
||||||
when:
|
|
||||||
- event: push
|
|
||||||
branch: ${CI_REPO_DEFAULT_BRANCH}
|
|
||||||
- event: manual
|
|
||||||
branch: ${CI_REPO_DEFAULT_BRANCH}
|
|
||||||
settings:
|
|
||||||
user:
|
|
||||||
from_secret: pleroma-ci-user
|
|
||||||
password:
|
|
||||||
from_secret: pleroma-ci-password
|
|
||||||
update: true
|
|
||||||
owner: 'pleroma'
|
|
||||||
package_name: 'pleroma-fe-builds'
|
|
||||||
package_version: ${CI_REPO_DEFAULT_BRANCH}
|
|
||||||
file_source: ./${CI_REPO_DEFAULT_BRANCH}.zip
|
|
||||||
file_name: latest.zip
|
|
||||||
|
|
|
||||||
44
.woodpecker/code-analisys.yaml
Normal file
44
.woodpecker/code-analisys.yaml
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
when:
|
||||||
|
- event: push
|
||||||
|
branch: ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
- event: manual
|
||||||
|
branch: ${CI_REPO_DEFAULT_BRANCH}
|
||||||
|
|
||||||
|
labels:
|
||||||
|
platform: linux/amd64
|
||||||
|
memory: 'high'
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- build
|
||||||
|
- test
|
||||||
|
- test-e2e
|
||||||
|
|
||||||
|
clone:
|
||||||
|
- name: git
|
||||||
|
image: woodpeckerci/plugin-git
|
||||||
|
settings:
|
||||||
|
depth: 0
|
||||||
|
|
||||||
|
variables:
|
||||||
|
script_file_entrypoint: &script_file_entrypoint
|
||||||
|
- /bin/sh
|
||||||
|
- -c
|
||||||
|
- 'printf "%s" "$CI_SCRIPT" | base64 -d > /tmp/ci-script.sh && /bin/sh -xe /tmp/ci-script.sh'
|
||||||
|
|
||||||
|
steps:
|
||||||
|
generate-coverage:
|
||||||
|
image: mcr.microsoft.com/playwright:v1.61.0-jammy
|
||||||
|
environment:
|
||||||
|
FF_NETWORK_PER_BUILD: "true"
|
||||||
|
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "1"
|
||||||
|
entrypoint: *script_file_entrypoint
|
||||||
|
commands:
|
||||||
|
- yarn --frozen-lockfile
|
||||||
|
- yarn unit-ci-coverage
|
||||||
|
|
||||||
|
code-analysis:
|
||||||
|
image: sonarsource/sonar-scanner-cli:11
|
||||||
|
environment:
|
||||||
|
SONAR_TOKEN:
|
||||||
|
from_secret: sonarqube-token
|
||||||
|
entrypoint: sonar-scanner
|
||||||
|
|
@ -10,6 +10,10 @@ labels:
|
||||||
platform: linux/amd64
|
platform: linux/amd64
|
||||||
memory: 'high'
|
memory: 'high'
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- build
|
||||||
|
- test
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
artifacts_uploader_settings: &artifacts_uploader_settings
|
artifacts_uploader_settings: &artifacts_uploader_settings
|
||||||
user:
|
user:
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,9 @@ labels:
|
||||||
platform: linux/amd64
|
platform: linux/amd64
|
||||||
memory: 'high'
|
memory: 'high'
|
||||||
|
|
||||||
|
depends_on:
|
||||||
|
- build
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
artifacts_uploader_settings: &artifacts_uploader_settings
|
artifacts_uploader_settings: &artifacts_uploader_settings
|
||||||
user:
|
user:
|
||||||
|
|
@ -45,20 +48,6 @@ steps:
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
code-analysis:
|
|
||||||
image: sonarsource/sonar-scanner-cli:11
|
|
||||||
when:
|
|
||||||
- event: push
|
|
||||||
branch: ${CI_REPO_DEFAULT_BRANCH}
|
|
||||||
- event: manual
|
|
||||||
branch: ${CI_REPO_DEFAULT_BRANCH}
|
|
||||||
environment:
|
|
||||||
SONAR_TOKEN:
|
|
||||||
from_secret: sonarqube-token
|
|
||||||
entrypoint: *script_file_entrypoint
|
|
||||||
commands:
|
|
||||||
- sonar-scanner
|
|
||||||
|
|
||||||
upload-artifacts:
|
upload-artifacts:
|
||||||
image: docker.io/woodpeckercommunity/plugin-gitea-package:0.5.0
|
image: docker.io/woodpeckercommunity/plugin-gitea-package:0.5.0
|
||||||
when:
|
when:
|
||||||
|
|
|
||||||
13
README.md
13
README.md
|
|
@ -1,12 +1,14 @@
|
||||||
# Pleroma-FE
|
# Pleroma-FE
|
||||||
|
|
||||||
> Highly-customizable frontend designed for Pleroma.
|
> Highly-customizable frontend designed for Pleroma.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
[](https://ci.pleroma.com/repos/2) [](https://sonarqube.pleroma.dev/dashboard?id=Pleroma-FE) [](https://sonarqube.pleroma.dev/dashboard?id=Pleroma-FE) [](https://sonarqube.pleroma.dev/dashboard?id=Pleroma-FE) [](https://sonarqube.pleroma.dev/dashboard?id=Pleroma-FE) <a href="https://translate.pleroma.social/engage/pleroma/"><img src="https://translate.pleroma.social/widget/pleroma/pleroma-fe/svg-badge.svg" alt="Translation status"></a>
|
||||||
|
|
||||||
# For Translators
|
# For Translators
|
||||||
|
|
||||||
To translate Pleroma-FE, use our weblate server: https://translate.pleroma.social/. If you need to add your language it should be added as a json file in [src/i18n/](https://git.pleroma.social/pleroma/pleroma-fe/src/src/i18n/) folder and added in a list within [src/i18n/languages.js](https://git.pleroma.social/pleroma/pleroma-fe/src/src/i18n/languages.js).
|
To translate Pleroma-FE, use our weblate server: https://translate.pleroma.social/. If you need to add your language it should be added as a json file in [src/i18n/](https://git.pleroma.social/pleroma/pleroma-fe/src/src/i18n/) folder and added in a list within [src/i18n/languages.js](https://git.pleroma.social/pleroma/pleroma-fe/src/src/i18n/languages.js).
|
||||||
|
|
||||||
Pleroma-FE will set your language by your browser locale, but you can change language in settings.
|
Pleroma-FE will set your language by your browser locale, but you can change language in settings.
|
||||||
|
|
||||||
|
|
@ -32,9 +34,14 @@ yarn unit
|
||||||
|
|
||||||
# For Contributors:
|
# For Contributors:
|
||||||
|
|
||||||
|
You can make local build proxy requests to specific instance with an environment variable `VITE_PROXY_TARGET`, generally it is a good idea to also set port for that specific proxy, if you intend on testing multiple instances, i.e.:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
yarn && PORT=8080 VITE_PROXY_TARGET=https://coolinstance.tld yarn dev
|
||||||
|
```
|
||||||
|
|
||||||
You can create file `/config/local.json` (see [example](https://git.pleroma.social/pleroma/pleroma-fe/src/config/local.example.json)) to enable some convenience dev options:
|
You can create file `/config/local.json` (see [example](https://git.pleroma.social/pleroma/pleroma-fe/src/config/local.example.json)) to enable some convenience dev options:
|
||||||
|
|
||||||
* `target`: makes local dev server redirect to some existing instance's BE instead of local BE, useful for testing things in near-production environment and searching for real-life use-cases.
|
|
||||||
* `staticConfigPreference`: makes FE's `/static/config.json` take preference of BE-served `/api/pleroma/frontend_configurations`. Only works in dev mode.
|
* `staticConfigPreference`: makes FE's `/static/config.json` take preference of BE-served `/api/pleroma/frontend_configurations`. Only works in dev mode.
|
||||||
|
|
||||||
FE Build process also leaves current commit hash in global variable `___pleromafe_commit_hash` so that you can easily see which pleroma-fe commit instance is running, also helps pinpointing which commit was used when FE was bundled into BE.
|
FE Build process also leaves current commit hash in global variable `___pleromafe_commit_hash` so that you can easily see which pleroma-fe commit instance is running, also helps pinpointing which commit was used when FE was bundled into BE.
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,8 @@
|
||||||
"dev": "node build/update-emoji.js && vite dev",
|
"dev": "node build/update-emoji.js && vite dev",
|
||||||
"build": "node build/update-emoji.js && vite build",
|
"build": "node build/update-emoji.js && vite build",
|
||||||
"unit": "node build/update-emoji.js && vitest --run --coverage",
|
"unit": "node build/update-emoji.js && vitest --run --coverage",
|
||||||
"unit-ci": "node build/update-emoji.js && vitest --run --coverage --browser.headless",
|
"unit-ci": "node build/update-emoji.js && vitest --run --browser.headless",
|
||||||
|
"unit-ci-coverage": "node build/update-emoji.js && vitest --run --coverage --browser.headless",
|
||||||
"unit:watch": "node build/update-emoji.js && vitest --coverage",
|
"unit:watch": "node build/update-emoji.js && vitest --coverage",
|
||||||
"e2e:pw": "playwright test --config test/e2e-playwright/playwright.config.mjs",
|
"e2e:pw": "playwright test --config test/e2e-playwright/playwright.config.mjs",
|
||||||
"e2e": "sh ./tools/e2e/run.sh",
|
"e2e": "sh ./tools/e2e/run.sh",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue