mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-09 23:00:02 -07:00
Add remote CI support for modules. (#16908)
This commit is contained in:
parent
fc6b841b2f
commit
17e4629d52
2 changed files with 48 additions and 6 deletions
|
@ -1,4 +1,7 @@
|
||||||
#!/bin/sh -e
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -eux
|
||||||
|
env
|
||||||
|
|
||||||
# TODO: add support for other posix environments
|
# TODO: add support for other posix environments
|
||||||
container=freebsd
|
container=freebsd
|
||||||
|
@ -85,9 +88,11 @@ if [ ! -f "${HOME}/.ssh/id_rsa.pub" ]; then
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
repo_name="${REPO_NAME:-ansible}"
|
||||||
|
|
||||||
if [ -d "${build_dir}" ]; then
|
if [ -d "${build_dir}" ]; then
|
||||||
cd "${build_dir}"
|
cd "${build_dir}"
|
||||||
else
|
elif [ "${repo_name}" = "ansible" ]; then
|
||||||
git clone "${REPOSITORY_URL:-https://github.com/ansible/ansible.git}" "${build_dir}"
|
git clone "${REPOSITORY_URL:-https://github.com/ansible/ansible.git}" "${build_dir}"
|
||||||
cd "${build_dir}"
|
cd "${build_dir}"
|
||||||
|
|
||||||
|
@ -99,13 +104,49 @@ else
|
||||||
git checkout -f FETCH_HEAD
|
git checkout -f FETCH_HEAD
|
||||||
git merge "origin/${BRANCH}"
|
git merge "origin/${BRANCH}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
git submodule init
|
||||||
|
git submodule sync
|
||||||
|
git submodule update
|
||||||
|
else
|
||||||
|
case "${repo_name}" in
|
||||||
|
"ansible-modules-core")
|
||||||
|
this_module_group="core"
|
||||||
|
;;
|
||||||
|
"ansible-modules-extras")
|
||||||
|
this_module_group="extras"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unsupported repo name: ${repo_name}"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
git clone "https://github.com/ansible/ansible.git" "${build_dir}"
|
||||||
|
|
||||||
|
cd "${build_dir}"
|
||||||
|
|
||||||
|
git submodule init
|
||||||
|
git submodule sync
|
||||||
|
git submodule update
|
||||||
|
|
||||||
|
cd "${build_dir}/lib/ansible/modules/${this_module_group}"
|
||||||
|
|
||||||
|
if [ "${PULL_REQUEST:-false}" = "false" ]; then
|
||||||
|
echo "Only pull requests are supported for module repositories."
|
||||||
|
exit
|
||||||
|
else
|
||||||
|
git fetch origin "pull/${PULL_REQUEST}/head"
|
||||||
|
git checkout -f FETCH_HEAD
|
||||||
|
git merge "origin/${BRANCH}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
cd "${build_dir}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
git submodule init
|
set +u
|
||||||
git submodule sync
|
|
||||||
git submodule update
|
|
||||||
|
|
||||||
. hacking/env-setup
|
. hacking/env-setup
|
||||||
|
set -u
|
||||||
|
|
||||||
cd test/integration
|
cd test/integration
|
||||||
|
|
||||||
|
|
|
@ -131,6 +131,7 @@ test_remote() {
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
env \
|
env \
|
||||||
REPOSITORY_URL='${REPOSITORY_URL:-}' \
|
REPOSITORY_URL='${REPOSITORY_URL:-}' \
|
||||||
|
REPO_NAME='${REPO_NAME:-}' \
|
||||||
PULL_REQUEST='${PULL_REQUEST:-}' \
|
PULL_REQUEST='${PULL_REQUEST:-}' \
|
||||||
BRANCH='${BRANCH:-}' \
|
BRANCH='${BRANCH:-}' \
|
||||||
COMMIT='${COMMIT:-}' \
|
COMMIT='${COMMIT:-}' \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue