-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbitbucket-pipelines.yml
65 lines (57 loc) · 2.04 KB
/
bitbucket-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
image:
name: ternau/bb-python:3.8.1-alpine
# cloning another repo in pipeline
# https://bitbucket.org/blog/cloning-another-bitbucket-repository-in-bitbucket-pipelines
# TODO: I like the node cache ... need to do something about tern-react pkg caching .... properly version it?
definitions:
# define custom cache for frontend/node_modules
caches:
clojure: ~/.clojure
frontend-node-modules: frontend/node_modules
# generic re-usable steps
steps:
- step: &envstep
# use a multiline step to set environment variables
- script: &setenv |
export IMAGE_NAME=ternau/data-submission-tool
- step: &build-frontend-step
caches:
- maven
- clojure
- frontend-node-modules
image:
name: theasp/clojurescript-nodejs:shadow-cljs-alpine
run-as-user: 1000
script:
- cd frontend
# clean
- rm -fR src/gen/* resources/public/js/*
# release build
- yarn
- yarn run build
- yarn shadow-cljs release tern
# copy-static step
- npx sass --load-path=. --style compressed src/js/index.scss resources/public/css/style.npm-packaged.css
- mkdir -p resources/public/resources/icons resources/public/css/images
- cp -fR node_modules/@blueprintjs/icons/resources/icons resources/public/resources/icons
- cp -vr node_modules/leaflet-draw/dist/images/* resources/public/css/images
- echo "$BITBUCKET_COMMIT `date -Iseconds`" > resources/public/version.txt
artifacts:
- frontend/resources/public/**
- step: &build-test-step
script: &build-test
- *setenv
- make build
- docker login --username $DOCKER_USERNAME --password $DOCKER_PASSWORD
- make push
# - CI=true npm test
services:
- docker
pipelines:
branches:
development-release:
- step: *build-frontend-step
- step: *build-test-step
# pull-requests:
# '**':
# - step: *build-test-step