Skip to content

Commit

Permalink
Merge pull request #6 from poblin-orange/master
Browse files Browse the repository at this point in the history
release 4
  • Loading branch information
poblin-orange authored Aug 3, 2022
2 parents a72b98d + 8ab22a0 commit 7237439
Show file tree
Hide file tree
Showing 10 changed files with 174 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .final_builds/jobs/scripting-list/index.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
builds:
2235bfea58235ef3e90e249831dbee62f4f9dcd768b98c028e6dd9873a63c5f9:
version: 2235bfea58235ef3e90e249831dbee62f4f9dcd768b98c028e6dd9873a63c5f9
blobstore_id: 4eb6b0ba-9e08-4930-4e87-08a047b3413b
sha1: sha256:0ca5eaff2c98383049678e89e836a86b379f77e8bda337a2965b75aa8601e1ff
format-version: "2"
File renamed without changes.
27 changes: 27 additions & 0 deletions jobs/scripting-list/spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: scripting-list
packages: []
templates:
post-deploy.erb: bin/post-deploy
post-start.erb: bin/post-start
pre-start.erb: bin/pre-start
post-stop.erb: bin/post-stop
pre-stop.erb: bin/pre-stop
consumes: []
provides: []
properties:
scripting-list.pre-start-scripts:
description: array of scripts to launch at job start
default: []
scripting-list.post-start-scripts:
description: array of scripts to launch after job start
default: []
scripting-list.post-deploy-scripts:
description: array of scripts to launch after deployment is complete
default: []
scripting-list.post-stop-scripts:
description: array of scripts to launch after job stop
default: []
scripting-list.pre-stop-scripts:
description: array of scripts to launch after job stop
default: []
23 changes: 23 additions & 0 deletions jobs/scripting-list/templates/post-deploy.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
set -e # Exit immediately if a simple command exits with a non-zero status
set -u # Report the usage of uninitialized variables

#--- Initialize context
echo "$(date -u "+%Y-%m-%d %H:%M:%S") => Begin post-deploy"

#--- Generate script list to run
<% i = 0 %>
<% if_p('scripting-list.post-deploy-scripts') do |value| %>
<% p('scripting-list.post-deploy-scripts').each do |script| %>
<% i = i + 1 %>

cat > /var/vcap/data/scripting-list/post-deploy-<%= i %>.sh <<'SCRIPTING_EOF'
<%= script %>
SCRIPTING_EOF

. /var/vcap/data/scripting-list/post-deploy-<%= i %>.sh
<% end %>
<% end %>

echo "$(date -u "+%Y-%m-%d %H:%M:%S") => End post-deploy"
exit 0
23 changes: 23 additions & 0 deletions jobs/scripting-list/templates/post-start.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
set -e # Exit immediately if a simple command exits with a non-zero status
set -u # Report the usage of uninitialized variables

#--- Initialize context
echo "$(date -u "+%Y-%m-%d %H:%M:%S") => Begin post-start"

#--- Generate/run scripts from list
<% i = 0 %>
<% if_p('scripting-list.post-start-scripts') do |value| %>
<% p('scripting-list.post-start-scripts').each do |script| %>
<% i = i + 1 %>

cat > /var/vcap/data/scripting-list/post-start-<%= i %>.sh <<'SCRIPTING_EOF'
<%= script %>
SCRIPTING_EOF

. /var/vcap/data/scripting-list/post-start-<%= i %>.sh
<% end %>
<% end %>

echo "$(date -u "+%Y-%m-%d %H:%M:%S") => End post-start"
exit 0
23 changes: 23 additions & 0 deletions jobs/scripting-list/templates/post-stop.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
set -e # Exit immediately if a simple command exits with a non-zero status
set -u # Report the usage of uninitialized variables

#--- Initialize context
echo "$(date -u "+%Y-%m-%d %H:%M:%S") => Begin post-stop"

#--- Generate script list to run
<% i = 0 %>
<% if_p('scripting-list.post-stop-scripts') do |value| %>
<% p('scripting-list.post-stop-scripts').each do |script| %>
<% i = i + 1 %>

cat > /var/vcap/data/scripting-list/post-stop-<%= i %>.sh <<'SCRIPTING_EOF'
<%= script %>
SCRIPTING_EOF

. /var/vcap/data/scripting-list/post-stop-<%= i %>.sh
<% end %>
<% end %>

echo "$(date -u "+%Y-%m-%d %H:%M:%S") => End post-stop"
exit 0
23 changes: 23 additions & 0 deletions jobs/scripting-list/templates/pre-start.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
set -e # Exit immediately if a simple command exits with a non-zero status
set -u # Report the usage of uninitialized variables

#--- Initialize context
echo "$(date -u "+%Y-%m-%d %H:%M:%S") => Begin pre-start"

#--- Generate script list to run
<% i = 0 %>
<% if_p('scripting-list.pre-start-scripts') do |value| %>
<% p('scripting-list.pre-start-scripts').each do |script| %>
<% i = i + 1 %>

cat > /var/vcap/data/scripting-list/pre-start-<%= i %>.sh <<'SCRIPTING_EOF'
<%= script %>
SCRIPTING_EOF

. /var/vcap/data/scripting-list/pre-start-<%= i %>.sh
<% end %>
<% end %>

echo "$(date -u "+%Y-%m-%d %H:%M:%S") => End pre-start"
exit 0
23 changes: 23 additions & 0 deletions jobs/scripting-list/templates/pre-stop.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash
set -e # Exit immediately if a simple command exits with a non-zero status
set -u # Report the usage of uninitialized variables

#--- Initialize context
echo "$(date -u "+%Y-%m-%d %H:%M:%S") => Begin pre-stop"

#--- Generate script list to run
<% i = 0 %>
<% if_p('scripting-list.pre-stop-scripts') do |value| %>
<% p('scripting-list.pre-stop-scripts').each do |script| %>
<% i = i + 1 %>

cat > /var/vcap/data/scripting-list/pre-stop-<%= i %>.sh <<'SCRIPTING_EOF'
<%= script %>
SCRIPTING_EOF

. /var/vcap/data/scripting-list/pre-stop-<%= i %>.sh
<% end %>
<% end %>

echo "$(date -u "+%Y-%m-%d %H:%M:%S") => End pre-stop"
exit 0
24 changes: 24 additions & 0 deletions releases/generic-scripting/generic-scripting-4.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: generic-scripting
version: "4"
commit_hash: 75137d8
uncommitted_changes: false
jobs:
- name: errand-scripting
version: d35122717f862df72228fdb48b198b992af8716376e93361a5ed32eb70510283
fingerprint: d35122717f862df72228fdb48b198b992af8716376e93361a5ed32eb70510283
sha1: sha256:ca1a3f579b3011a1c1ba27f4a87209bb15ddc0caed5d209574e5478918d7318b
packages: []
- name: scripting
version: 819a2bf4af768a5ef3749415d866261370f0183c5c1034349d96f8151fd8ddb0
fingerprint: 819a2bf4af768a5ef3749415d866261370f0183c5c1034349d96f8151fd8ddb0
sha1: sha256:ec75700dc33321a06ffa356951be9504c8e644ec14b45a116409ae17112d4f04
packages: []
- name: scripting-list
version: 2235bfea58235ef3e90e249831dbee62f4f9dcd768b98c028e6dd9873a63c5f9
fingerprint: 2235bfea58235ef3e90e249831dbee62f4f9dcd768b98c028e6dd9873a63c5f9
sha1: sha256:0ca5eaff2c98383049678e89e836a86b379f77e8bda337a2965b75aa8601e1ff
packages: []
license:
version: c52a2c414b935147f0ccbe8d798edbbcd65c5e9084079f727b3fb5727a44e50d
fingerprint: c52a2c414b935147f0ccbe8d798edbbcd65c5e9084079f727b3fb5727a44e50d
sha1: sha256:d1dad55c014f213daa950c9d9ca01eb422cb97cc5b8b2997d1e1ba8efe5cf3ef
2 changes: 2 additions & 0 deletions releases/generic-scripting/index.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
builds:
762e28bd-589f-42d9-42e2-1d992a3b2523:
version: "4"
773185d4-9e0a-40f1-634d-63d112d930cd:
version: "2"
ad0d6a2a-2420-49ca-50ae-4440083a69a1:
Expand Down

0 comments on commit 7237439

Please sign in to comment.