Initialize repo
This commit is contained in:
5
configure.sh
Executable file
5
configure.sh
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
cp .post-commit-hook .git/hooks/post-commit
|
||||||
|
git config set toolbox-dev-env.name voyager-base
|
||||||
|
git config set toolbox-dev-env.base-image.name registry.fedoraproject.org/fedora-toolbox
|
||||||
|
git config set toolbox-dev-env.base-image.version-script 'cat /etc/os-release | grep VERSION_ID | cut -d = -f 2'
|
||||||
|
git config unset toolbox-dev-env.base-image.version
|
||||||
38
setup.sh
38
setup.sh
@@ -1,38 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
function configure() {
|
|
||||||
echo "cp .post-commit-hook .git/hooks/post-commit">./configure.sh
|
|
||||||
|
|
||||||
read -p "Enter a name for this environment [development]: " envName
|
|
||||||
local envName=${envName:-development}
|
|
||||||
echo "git config set toolbox-dev-env.name ${envName}">>./configure.sh
|
|
||||||
|
|
||||||
read -p "Enter path of base image [registry.fedoraproject.org/fedora-toolbox]: " baseImage
|
|
||||||
local baseImage=${baseImage:-registry.fedoraproject.org/fedora-toolbox}
|
|
||||||
echo "git config set toolbox-dev-env.base-image.name ${baseImage}">>./configure.sh
|
|
||||||
|
|
||||||
read -p "Would you like to use a command to determine the base image version [y/N] " -n 1 -r
|
|
||||||
echo
|
|
||||||
if [[ $REPLY =~ ^[Yy]$ ]]; then
|
|
||||||
read -p "Enter command to determine base image version: " baseImageVersionCommand
|
|
||||||
echo "git config set toolbox-dev-env.base-image.version-script '${baseImageVersionCommand}'">>./configure.sh
|
|
||||||
echo "git config unset toolbox-dev-env.base-image.version">>./configure.sh
|
|
||||||
else
|
|
||||||
read -p "Enter base image version: " baseImageVersion
|
|
||||||
echo "git config set toolbox-dev-env.base-image.version ${baseImageVersion}">>./configure.sh
|
|
||||||
echo "git config unset toolbox-dev-env.base-image.version-script">>./configure.sh
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function main() {
|
|
||||||
trap "rm -f configure.sh" 1 2 3
|
|
||||||
|
|
||||||
configure
|
|
||||||
chmod +x ./configure.sh
|
|
||||||
bash ./configure.sh
|
|
||||||
|
|
||||||
echo "Setup is now completed. Please commit 'configure.sh' to persist the configuration"
|
|
||||||
rm setup.sh
|
|
||||||
}
|
|
||||||
|
|
||||||
main $@
|
|
||||||
Reference in New Issue
Block a user