-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathapply-changes.yml
54 lines (46 loc) · 1.55 KB
/
apply-changes.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
# The inputs, outputs, params, filename, and filepath
# of this task file are part of its semantically versioned API.
# See our documentation for a detailed discussion of our semver API.
# See www.semver.org for an explanation of semantic versioning.
# code_snippet apply-changes start yaml
---
platform: linux
inputs:
- name: config # contains the product configuration file
- name: env # contains the env file with target OpsMan Information
params:
ENV_FILE: env.yml
# - Filepath of the env config YAML
# - The path is relative to root of the `env` input
PRODUCT_NAMES:
# - Optional
# - Specify the comma delimited product name(s) to enable selective apply-changes
# - Example: "pivotal-container-service,harbor-container-registry"
ERRAND_CONFIG_FILE:
# - Optional
# - Config file, based on `config/`, to turn on/off errands for products you are deploying
# - Example: "dev/errands/harbor-container-registry.yml"
# - Ref: https://github.com/pivotal-cf/om/tree/master/docs/apply-changes
run:
path: bash
args:
- "-c"
- |
cat /var/version && echo ""
set -eux
product_names=""
if [ "${PRODUCT_NAMES}" ];
then
for product_name in ${PRODUCT_NAMES//,/ }
do
product_names+="--product-name ${product_name} "
done
fi
errand_config_file=""
if [ -f "config/${ERRAND_CONFIG_FILE}" ];
then
errand_config_file="--config config/"${ERRAND_CONFIG_FILE}" ";
fi
om --env env/"${ENV_FILE}" apply-changes \
${product_names} ${errand_config_file}
# code_snippet apply-changes end