Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add remote CI support for modules. #16908

Merged
merged 1 commit into from
Aug 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
53 changes: 47 additions & 6 deletions test/utils/shippable/remote-integration.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#!/bin/sh -e
#!/bin/sh

set -eux
env

# TODO: add support for other posix environments
container=freebsd
Expand Down Expand Up @@ -85,9 +88,11 @@ if [ ! -f "${HOME}/.ssh/id_rsa.pub" ]; then
done
fi

repo_name="${REPO_NAME:-ansible}"

if [ -d "${build_dir}" ]; then
cd "${build_dir}"
else
elif [ "${repo_name}" = "ansible" ]; then
git clone "${REPOSITORY_URL:-https://github.com/ansible/ansible.git}" "${build_dir}"
cd "${build_dir}"

Expand All @@ -99,13 +104,49 @@ else
git checkout -f FETCH_HEAD
git merge "origin/${BRANCH}"
fi
fi

git submodule init
git submodule sync
git submodule update
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

set +u
. hacking/env-setup
set -u

cd test/integration

Expand Down
1 change: 1 addition & 0 deletions test/utils/shippable/remote.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ test_remote() {
cat <<EOF
env \
REPOSITORY_URL='${REPOSITORY_URL:-}' \
REPO_NAME='${REPO_NAME:-}' \
PULL_REQUEST='${PULL_REQUEST:-}' \
BRANCH='${BRANCH:-}' \
COMMIT='${COMMIT:-}' \
Expand Down