Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
moodle_rebase10.1.2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Dmitry Blinov
moodle_rebase10.1.2
Commits
d2453c40
Commit
d2453c40
authored
Mar 15, 2020
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
randomsleep: simplify
parent
00261687
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
23 deletions
+9
-23
component/dcron/buildout.cfg
component/dcron/buildout.cfg
+1
-1
component/randomsleep/buildout.cfg
component/randomsleep/buildout.cfg
+8
-22
No files found.
component/dcron/buildout.cfg
View file @
d2453c40
...
@@ -20,7 +20,7 @@ make-options =
...
@@ -20,7 +20,7 @@ make-options =
post-make-hook = ${:_profile_base_location_}/dcron-hooks.py#d7985eef1ceef01af00ffb1d38708c8d:post_make_hook
post-make-hook = ${:_profile_base_location_}/dcron-hooks.py#d7985eef1ceef01af00ffb1d38708c8d:post_make_hook
environment =
environment =
PATH=${patch:location}/bin:%(PATH)s
PATH=${patch:location}/bin:%(PATH)s
randomsleep_install = ${randomsleep:location
}
dummy = ${randomsleep:recipe
}
[dcron-output]
[dcron-output]
# Shared binary location to ease migration
# Shared binary location to ease migration
...
...
component/randomsleep/buildout.cfg
View file @
d2453c40
...
@@ -4,26 +4,12 @@ extends =
...
@@ -4,26 +4,12 @@ extends =
../bash/buildout.cfg
../bash/buildout.cfg
[randomsleep]
[randomsleep]
recipe = slapos.recipe.
build
recipe = slapos.recipe.
template:jinja2
location = ${buildout:parts
-directory}/${:_buildout_section_name_}
rendered = ${buildout:bin
-directory}/${:_buildout_section_name_}
bin_dir = ${buildout:bin-directory}
template =
bash_script_code =
inline:#!${bash:location}/bin/bash
if [ "$#" -ne 1 ]; then
[ $# = 1 ] || {
echo "usage:
randomsleep
maxseconds"
echo "usage:
${:_buildout_section_name_}
maxseconds"
exit
exit
1
fi
}
exec ${coreutils:location}/bin/sleep $((RANDOM * $1 >> 15)).$((RANDOM * 100 >> 15))
exec ${coreutils:location}/bin/sleep $((RANDOM * $1 >> 15)).$((RANDOM * 100 >> 15))
wrapper_script_code =
#!${bash:location}/bin/bash
. ${:location}/randomsleep.bash
script =
os.makedirs(self.options['location'])
bash_script_path = os.path.join(self.options['location'], 'randomsleep.bash')
with open(bash_script_path, 'w') as f:
f.write(self.options['bash_script_code'])
wrapper_script_path = os.path.join(self.options['bin_dir'], 'randomsleep')
with open(wrapper_script_path, 'w') as f:
f.write(self.options['wrapper_script_code'])
os.chmod(wrapper_script_path, 0o750)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment