generated from yahoo/.github
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathscrewdriver.yaml
72 lines (69 loc) · 2.75 KB
/
screwdriver.yaml
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
66
67
68
69
70
71
72
---
annotations:
screwdriver.cd/restrictPR: fork
shared:
image: openjdk:11
environment:
MAVEN_OPTS: -Xmx3G -Dscalatest.jvm.args='-Xmx9G'
REVISION: ''
MVN_FLAGS: -B --no-transfer-progress -Drevision=$REVISION
MVN_EXTRA_FLAGS: ''
MVN_TARGETS: -DwithTests -P shade-samplesource clean install
annotations:
screwdriver.cd/timeout: 40
screwdriver.cd/cpu: HIGH
screwdriver.cd/ram: HIGH
steps:
- compute-context: |
export SHORT_GIT_COMMIT=$(echo $SD_BUILD_SHA | cut -c1-7)
export BURST_BRANCH=$(echo $GIT_BRANCH | awk -F/ '{print $NF}')
if [ "$GIT_BRANCH" != "origin/main" ] && [ "$REVISION" == "" ]; then
export REVISION=-beta-${BURST_BRANCH}
fi
export TIMESTAMP=$(date +%s)
export MVN_FLAGS="$MVN_FLAGS -Djib.to.tags=$TIMESTAMP"
export VERSION_LBL=$(./mvnw -q -ntp help:evaluate -Drevision=$REVISION -Dexpression=project.version -DforceStdout)
echo "REVISION=$REVISION"
echo "VERSION_LBL=$VERSION_LBL"
echo "BRANCH=$BURST_BRANCH"
echo "TIMESTAMP=$TIMESTAMP"
- set-build-label: |
meta set label "${VERSION_LBL}"
echo "Build label: ${VERSION_LBL}"
- build: |
echo "./mvnw $MVN_FLAGS $MVN_EXTRA_FLAGS $MVN_TARGETS"
./mvnw $MVN_FLAGS $MVN_EXTRA_FLAGS $MVN_TARGETS
jobs:
pr:
requires: [ ~pr ]
environment:
REVISION: -alpha-$SD_PULL_REQUEST.$SD_BUILD_ID
main:
requires: [ ~commit ]
base-image: &build-base-image
requires: [ ~commit ]
sourcePaths: [ "screwdriver.yaml", "docker/corretto" ]
image: docker:dind
annotations:
screwdriver.cd/dockerEnabled: true
environment:
JAVA_VERSION: 11
steps:
- setup: &docker-setup |
export TIMESTAMP=$(date +%s)
# explain why we are building
echo Build triggered by source=$SD_SOURCE_PATH
- build: &docker-build |
docker_cmd="docker build docker/corretto --progress=plain \
--build-arg JAVA_VERSION=${JAVA_VERSION} \
-t burstsys/corretto-burst:${JAVA_VERSION} \
-t burstsys/corretto-burst:${JAVA_VERSION}-${TIMESTAMP}"
$docker_cmd
- push: |
echo 'docker image push --all-tags burstsys/corretto-burst'
base-image-pr-build:
<<: *build-base-image
requires: [ ~pr ]
steps:
- setup: *docker-setup
- build: *docker-build