-
Notifications
You must be signed in to change notification settings - Fork 0
/
build_spec.yaml
64 lines (57 loc) · 2.06 KB
/
build_spec.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
version: 0.1
component: build
timeoutInSeconds: 6000
runAs: root
shell: bash
env:
# these are local variables to the build config
variables:
graal_vm_version: "21.3.0"
code_repo_name: "oci-java-graalvm-devops-example"
# the value of a vaultVariable is the secret-id (in OCI ID format) stored in the OCI Vault service
# you can then access the value of that secret in your build_spec.yaml commands
vaultVariables:
# EXAMPLE_SECRET: "YOUR-SECRET-OCID"
# exportedVariables are made available to use as parameters in sucessor Build Pipeline stages
# For this Build to run, the Build Pipeline needs to have a BUILDRUN_HASH parameter set
exportedVariables:
- BUILDRUN_HASH
steps:
- type: Command
name: "Define unique image tag"
timeoutInSeconds: 40
command: |
export BUILDRUN_HASH=`echo ${OCI_BUILD_RUN_ID} | rev | cut -c 1-7`
echo "BUILDRUN_HASH: " $BUILDRUN_HASH
- type: Command
timeoutInSeconds: 600
name: "Build the app"
command: |
cd ${OCI_WORKSPACE_DIR}/${code_repo_name}
java -version
wget -q https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-${graal_vm_version}/graalvm-ce-java17-linux-amd64-${graal_vm_version}.tar.gz
tar zxf graalvm-ce-java17-linux-amd64-${graal_vm_version}.tar.gz
export java_graal_home=./graalvm-ce-java17-${graal_vm_version}/bin/
${java_graal_home}/gu list
ls -ltr
npm install
ls -ltr
onFailure:
- type: Command
command: |
echo "Handling Failure"
echo "Failure successfully handled"
timeoutInSeconds: 40
runAs: root
- type: Command
timeoutInSeconds: 1200
name: "Build container image"
command: |
cd ${OCI_WORKSPACE_DIR}/${code_repo_name}
docker build --pull --rm -t graal_polyglot_sample_app .
outputArtifacts:
- name: graal_polyglot_docker_image
type: DOCKER_IMAGE
# this location tag doesn't effect the tag used to deliver the container image
# to the Container Registry
location: graal_polyglot_sample_pp:latest