jkawamoto/loci

View on GitHub
assets/entrypoint

Summary

Maintainability
Test Coverage
{{define "base"}}
#!/bin/bash
#
# entrypoint
#
# Copyright (c) 2016-2017 Junpei Kawamoto
#
# This software is released under the MIT License.
#
# http://opensource.org/licenses/mit-license.php
#

# Run before install steps, install steps, before script steps, and script
# steps in this order. If any parameters are given, execute the parameters
# instead. For example, to debug this script, run this with `bash` as the
# parameter and get a shell access.
set -e
{{block "env" .}}
{{end}}
if [[ $# != 0 ]]; then
  exec $@
fi
{{block "prepare" .}}
{{end}}

{{block "before_install" .}}
echo -e "\e[33mBefore Install Steps:\e[m"
{{range .BeforeInstall}}
echo "{{.}}"
({{.}})
{{end}}
{{end}}

{{block "install" .}}
echo -e "\e[33mInstall Steps:\e[m"
{{range .Install}}
echo "{{.}}"
({{.}})
{{end}}
{{end}}

{{block "before_script" .}}
echo -e "\e[33mBefore Script Steps:\e[m"
{{range .BeforeScript}}
echo "{{.}}"
({{.}})
{{end}}
{{end}}

{{block "script" .}}
echo -e "\e[33mScript Steps:\e[m"
{{range .Script}}
echo "{{.}}"
({{.}})
{{end}}
{{end}}

{{end}}