Files
Remsly/bitbucket-pipelines.yml
T
2022-01-24 22:00:12 +01:00

90 lines
2.6 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: openjdk:17
definitions:
services:
postgres:
image: postgres:14-alpine
variables:
POSTGRES_USER: 'develop'
POSTGRES_PASSWORD: 'develop'
POSTGRES_MULTIPLE_DATABASES: 'gradle:gradlepw:gradle,test:testpw:test'
ports:
- '6543:5432'
volumes:
- ./deploy/localDev/boxit/postgres/create-multiple-postgresql-databases.sh:/docker-entrypoint-initdb.d/create-multiple-postgresql-databases.sh
pipelines:
default:
- step:
name: Clean
image: openjdk:17
script:
- export TESTCONTAINERS_RYUK_DISABLED=true
- bash ./gradlew clean
- step:
name: Backend
image: openjdk:17
services:
- postgres
caches:
- gradle
script:
- export TESTCONTAINERS_RYUK_DISABLED=true
- bash ./gradlew :backend:build
- mv backend/build/libs/*.jar "backend/build/libs/backend-$(git describe --tags).jar"
artifacts:
- backend/build/libs/*.jar
- step:
name: FrontEnd
image: node:16.10
script:
- cd frontend
- npm install
- npm install -g @angular/cli
- ng build
tags:
v*:
- step:
name: Clean
image: openjdk:17
script:
- bash ./gradlew clean
- step:
name: Backend
image: openjdk:17
services:
- postgres
caches:
- gradle
script:
- bash ./gradlew :backend:build
- 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:16.10.0
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