forked from oracle-devrel/python-oci-bluegreen-oke-app
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build_spec.yaml
56 lines (46 loc) · 1.77 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
version: 0.1
component: build
timeoutInSeconds: 6000
runAs: root
shell: bash
env:
# these are local variables to the build config
variables:
# 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:
# 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
#Its a native way to fetch artifacts from external or artifact repo or a file path to use before a stage.
# More about buildspec formats - https://docs.oracle.com/en-us/iaas/Content/devops/using/build_specs.htm
inputArtifacts:
- name: golan-cli
type: URL
url: https://go.dev/dl/go1.17.8.linux-amd64.tar.gz
location: ${OCI_PRIMARY_SOURCE_DIR}/gocli.tar.gz
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: 1200
name: "Build container image"
command: |
cd ${OCI_PRIMARY_SOURCE_DIR}
docker build --pull --rm -t oke_app_base .
outputArtifacts:
- name: oke_app_base
type: DOCKER_IMAGE
# this location tag doesn't effect the tag used to deliver the container image
# to the Container Registry
location: oke_app_base:latest
- name: oke_deploy_manifest
type: BINARY
# this location tag doesn't effect the tag used to deliver the container image
# to the Container Registry
location: ${OCI_PRIMARY_SOURCE_DIR}/oci-oke-deployment.yaml