Files
Remsly/bitbucket-pipelines.yml
T
2019-12-04 17:09:13 +01:00

68 lines
1.9 KiB
YAML

# This is a sample build configuration for Java (Gradle).
# Check our guides at https://confluence.atlassian.com/x/zd-5Mw for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: java:8
pipelines:
default:
- step:
name: Clean
image: java:8
script:
- bash ./gradlew clean
- step:
name: Backend
caches:
- gradle
script:
- bash ./gradlew :backend:build
- bash mv backend/build/libs/*.jar backend/build/libs/backend-$(git describe --tags).jar
artifacts:
- backend/build/libs/*.jar
- step:
name: FrontEnd
image: node:12.7
script:
- cd frontend
- npm install
- npm install -g @angular/cli
- ng build
tags:
v*:
- step:
name: Clean
image: java:8
script:
- bash ./gradlew clean
- step:
name: Backend
caches:
- gradle
script:
- bash ./gradlew :backend:build
- bash mv backend/build/libs/*.jar backend/build/libs/backend-$(git describe --tags).jar
artifacts:
- backend/build/libs/*.jar
- step:
name: Prod-FE-Build
image: node:12.7
script:
- cd frontend
- npm install
- npm install -g @angular/cli
- ng build --prod --aot
- mv dist data
- chmod -R a+rwx data
- tar czvf "frontend-$(git describe --tags).tar.gz" data
- rm -rf data
- cd ..
artifacts:
- frontend/*.tar.gz
- step:
name: upload
script:
- scp backend/build/libs/*.jar root@app.boxi.ch:/boxit/dist
- scp frontend/*.tar.gz root@app.boxi.ch:/boxit/dist