Skip to content
Snippets Groups Projects
Commit 067a56af authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Merge branch 'review-apps' into 'develop'

Review apps

See merge request funkwhale/funkwhale!786
parents 663600d5 a6f5dd02
No related branches found
No related tags found
No related merge requests found
...@@ -20,91 +20,73 @@ review_front: ...@@ -20,91 +20,73 @@ review_front:
image: node:9 image: node:9
when: manual when: manual
allow_failure: true allow_failure: true
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/
VUE_APP_INSTANCE_URL: $REVIEW_INSTANCE_URL
before_script: before_script:
- curl -L -o /usr/local/bin/jq https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 - curl -L -o /usr/local/bin/jq https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64
- chmod +x /usr/local/bin/jq - chmod +x /usr/local/bin/jq
- rm -rf front-review
- mkdir front-review
- cd front - cd front
script: script:
- yarn install - yarn install
- yarn run i18n-compile - yarn run i18n-compile
# this is to ensure we don't have any errors in the output, # this is to ensure we don't have any errors in the output,
# cf https://dev.funkwhale.audio/funkwhale/funkwhale/issues/169 # cf https://dev.funkwhale.audio/funkwhale/funkwhale/issues/169
- VUE_APP_INSTANCE_URL=$REVIEW_INSTANCE_URL yarn run build | tee /dev/stderr | (! grep -i 'ERROR in') - yarn run build | tee /dev/stderr | (! grep -i 'ERROR in')
- mkdir -p /static/front/$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG - cp -r dist/* ../front-review
- cp -r dist/* /static/front/$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG artifacts:
expire_in: 2 weeks
paths:
- front-review
cache: cache:
key: "funkwhale__front_dependencies" key: "funkwhale__front_dependencies"
paths: paths:
- front/node_modules - front/node_modules
- front/yarn.lock - front/yarn.lock
environment:
name: review/front/$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG
url: http://front-$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG.$REVIEW_DOMAIN
on_stop: stop_front_review
only: only:
- branches - branches
tags: tags:
- funkwhale-review - docker
stop_front_review:
stage: review
script:
- rm -rf /static/front/$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG/
variables:
GIT_STRATEGY: none
when: manual
only:
- branches
environment: environment:
name: review/front/$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG name: review/front/$CI_COMMIT_REF_NAME
action: stop url: http://$CI_PROJECT_NAMESPACE.pages.funkwhale.audio/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/front-review/index.html
tags:
- funkwhale-review
review_docs: review_docs:
stage: review stage: review
image: python:3.6
when: manual when: manual
allow_failure: true allow_failure: true
image: python:3.6
variables: variables:
BUILD_PATH: "../public" BUILD_PATH: "../docs-review"
before_script: before_script:
- rm -rf docs-review
- mkdir docs-review
- cd docs - cd docs
- apt-get update - apt-get update
- apt-get install -y graphviz - apt-get install -y graphviz
- pip install sphinx - pip install sphinx
script:
- ./build_docs.sh
cache: cache:
key: "$CI_PROJECT_ID__sphinx" key: "$CI_PROJECT_ID__sphinx"
paths: paths:
- "$PIP_CACHE_DIR" - "$PIP_CACHE_DIR"
script: artifacts:
- ./build_docs.sh expire_in: 2 weeks
- mkdir -p /static/docs/$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG paths:
- cp -r $CI_PROJECT_DIR/public/* /static/docs/$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG - docs-review
environment:
name: review/docs/$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG
url: http://docs-$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG.$REVIEW_DOMAIN
on_stop: stop_docs_review
only: only:
- branches - branches
tags: tags:
- funkwhale-review - docker
stop_docs_review:
stage: review
script:
- rm -rf /static/docs/$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG/
variables:
GIT_STRATEGY: none
when: manual
only:
- branches
environment: environment:
name: review/docs/$CI_PROJECT_PATH_SLUG-$CI_BUILD_REF_SLUG name: review/docs/$CI_COMMIT_REF_NAME
action: stop url: http://$CI_PROJECT_NAMESPACE.pages.funkwhale.audio/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts/docs-review/index.html
tags:
- funkwhale-review
black: black:
image: python:3.6 image: python:3.6
......
...@@ -3,9 +3,11 @@ import Router from 'vue-router' ...@@ -3,9 +3,11 @@ import Router from 'vue-router'
Vue.use(Router) Vue.use(Router)
console.log('PROCESS', process.env)
export default new Router({ export default new Router({
mode: 'history', mode: 'history',
linkActiveClass: 'active', linkActiveClass: 'active',
base: process.env.VUE_APP_ROUTER_BASE_URL || '/',
routes: [ routes: [
{ {
path: '/', path: '/',
...@@ -552,6 +554,10 @@ export default new Router({ ...@@ -552,6 +554,10 @@ export default new Router({
}, },
] ]
}, },
{
path: '*/index.html',
redirect: '/'
},
{ {
path: '*', path: '*',
component: () => component: () =>
......
...@@ -10,7 +10,7 @@ if (process.env.BUNDLE_ANALYZE === '1') { ...@@ -10,7 +10,7 @@ if (process.env.BUNDLE_ANALYZE === '1') {
plugins.push(new BundleAnalyzerPlugin()) plugins.push(new BundleAnalyzerPlugin())
} }
module.exports = { module.exports = {
baseUrl: '/front/', baseUrl: process.env.BASE_URL || '/front/',
pages: { pages: {
embed: { embed: {
entry: 'src/embed.js', entry: 'src/embed.js',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment