-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshippable.templates.yml
30 lines (25 loc) · 1.13 KB
/
shippable.templates.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
set_pipeline_triggerby_temp: &set_pipeline_triggerby
- |
echo "Project id - $PROJECT_ID"
echo "Job name - $JOB_NAME"
echo "Job id - $JOB_ID"
echo "Last successful build time - $LAST_SUCCESSFUL_BUILD_TIMESTAMP"
echo "Triggered by - $JOB_TRIGGERED_BY_NAME"
if [ $RESOURCE_ID -eq $JOB_TRIGGERED_BY_ID ]
then
WORKFLOW_TRIGGERED_BY_NAME=$JOB_TRIGGERED_BY_NAME
else
WORKFLOW_TRIGGERED_BY_NAME=$(shipctl get_resource_version_key "$JOB_TRIGGERED_BY_NAME" "WORKFLOW_TRIGGERED_BY_NAME")
fi
shipctl put_resource_state_multi $JOB_NAME "WORKFLOW_TRIGGERED_BY_NAME=$WORKFLOW_TRIGGERED_BY_NAME"
echo_some_random_stuff: &echo_some_random_stuff
- |
echo "This is the random stuff that we talked about.............."
if [[ $JOB_NAME = *"s1"* ]]; then
shipctl put_resource_state_multi "s1_state" "JOB_NAME=$JOB_NAME" "DEPLOY_USER=$JOB_TRIGGERED_BY_NAME"
elif [[ $JOB_NAME = *"s2"* ]]; then
shipctl put_resource_state_multi "s2_state" "JOB_NAME=$JOB_NAME" "DEPLOY_USER=$JOB_TRIGGERED_BY_NAME"
fi
final_script_temp: &final_script_temp
- *set_pipeline_triggerby
- *echo_some_random_stuff