-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_spec.yaml
73 lines (65 loc) · 2.07 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
65
66
67
68
69
70
71
72
73
version: 0.1
component: build
timeoutInSeconds: 6000
shell: bash
runAs: root
failImmediatelyOnError: true
env:
# these are local variables to the build config
variables:
key: "value"
# 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
- BUILD_RESULT
- ADB_CLI_VERSION
steps:
- type: Command
name: "Setup the environment variables"
timeoutInSeconds: 120
command: |
export BUILDRUN_HASH=`echo ${OCI_BUILD_RUN_ID} | rev | cut -c 1-7`
echo "BUILDRUN_HASH: " $BUILDRUN_HASH
export ADB_CLI_VERSION=0.4.3
echo "ADB_CLI_VERSION: " $ADB_CLI_VERSION
- type: Command
name: "Setup the build environment"
timeoutInSeconds: 6000
command: |
wget https://go.dev/dl/go1.23.2.linux-amd64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.23.2.linux-amd64.tar.gz
export PATH=/usr/local/go/bin:$PATH
# yum install -y oracle-golang-release-el7
# yum install -y golang
onFailure:
- type: Command
command: |
BUILD_RESULT=FAILURE
echo "Error during the setup of the build environment"
timeoutInSeconds: 400
- type: Command
name: "Build the source"
timeoutInSeconds: 6000
command: |
cd ${OCI_PRIMARY_SOURCE_DIR}
make build
onFailure:
- type: Command
command: |
BUILD_RESULT=FAILURE
echo "Error during the build phase"
timeoutInSeconds: 400
- type: Command
name: "Package the artifacts"
timeoutInSeconds: 600
command: |
zip adb-cli-package.zip executables/*
outputArtifacts:
- name: adb-cli-package
type: BINARY
location: ${OCI_PRIMARY_SOURCE_DIR}/adb-cli-package.zip