mirror of
https://github.com/freeipa/ansible-freeipa.git
synced 2026-07-31 11:54:47 +00:00
utils/build-galaxy-release.sh: Add "-i" to install generated collection
The "-i" option can be used to install the generated collection using the ansible-galaxy collection install command. It is using the force flag to install the collection if there is already a collection with the same name and namespace. The ansible-galaxy collection build command is already using the force flag to create the collection.
This commit is contained in:
@@ -19,6 +19,7 @@ be givedn without the other one.
|
|||||||
Options:
|
Options:
|
||||||
-a Add all files, no only files known to git repo
|
-a Add all files, no only files known to git repo
|
||||||
-k Keep build directory
|
-k Keep build directory
|
||||||
|
-i Install the generated collection
|
||||||
-h Print this help
|
-h Print this help
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
@@ -26,7 +27,8 @@ EOF
|
|||||||
|
|
||||||
all=0
|
all=0
|
||||||
keep=0
|
keep=0
|
||||||
while getopts "ahk" arg; do
|
install=0
|
||||||
|
while getopts "ahki" arg; do
|
||||||
case $arg in
|
case $arg in
|
||||||
a)
|
a)
|
||||||
all=1
|
all=1
|
||||||
@@ -38,6 +40,9 @@ while getopts "ahk" arg; do
|
|||||||
k)
|
k)
|
||||||
keep=1
|
keep=1
|
||||||
;;
|
;;
|
||||||
|
i)
|
||||||
|
install=1
|
||||||
|
;;
|
||||||
\?)
|
\?)
|
||||||
echo
|
echo
|
||||||
usage
|
usage
|
||||||
@@ -70,7 +75,7 @@ if [ -z "$galaxy_version" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Builing galaxy release: ${namespace}-${collection}-${galaxy_version}"
|
echo "Building collection: ${namespace}-${collection}-${galaxy_version}"
|
||||||
|
|
||||||
GALAXY_BUILD=".galaxy-build"
|
GALAXY_BUILD=".galaxy-build"
|
||||||
|
|
||||||
@@ -182,3 +187,8 @@ if [ $keep == 0 ]; then
|
|||||||
else
|
else
|
||||||
echo "Keeping build dir $GALAXY_BUILD"
|
echo "Keeping build dir $GALAXY_BUILD"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ $install == 1 ]; then
|
||||||
|
echo "Installing collection ${namespace}-${collection}-${galaxy_version}.tar.gz ..."
|
||||||
|
ansible-galaxy collection install "${namespace}-${collection}-${galaxy_version}.tar.gz" --force
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user