Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kubespray
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
Kubespray
Commits
09f93d9e
Unverified
Commit
09f93d9e
authored
Apr 10, 2018
by
Matthew Mosesohn
Committed by
GitHub
Apr 10, 2018
Browse files
Options
Downloads
Patches
Plain Diff
Fix CI upgrade scenario by using dynamic inventory file (#2635)
Also updates the commit ID we use as a basis for upgrade tests.
parent
45f15bf7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+13
-12
13 additions, 12 deletions
.gitlab-ci.yml
tests/Makefile
+1
-1
1 addition, 1 deletion
tests/Makefile
tests/support/aws.groovy
+2
-2
2 additions, 2 deletions
tests/support/aws.groovy
with
16 additions
and
15 deletions
.gitlab-ci.yml
+
13
−
12
View file @
09f93d9e
...
@@ -20,6 +20,7 @@ variables:
...
@@ -20,6 +20,7 @@ variables:
GCE_PREEMPTIBLE
:
"
false"
GCE_PREEMPTIBLE
:
"
false"
ANSIBLE_KEEP_REMOTE_FILES
:
"
1"
ANSIBLE_KEEP_REMOTE_FILES
:
"
1"
ANSIBLE_CONFIG
:
./tests/ansible.cfg
ANSIBLE_CONFIG
:
./tests/ansible.cfg
ANSIBLE_INVENTORY
:
./inventory/sample/${CI_JOB_NAME}-${BUILD_NUMBER}.ini
IDEMPOT_CHECK
:
"
false"
IDEMPOT_CHECK
:
"
false"
RESET_CHECK
:
"
false"
RESET_CHECK
:
"
false"
UPGRADE_TEST
:
"
false"
UPGRADE_TEST
:
"
false"
...
@@ -90,9 +91,9 @@ before_script:
...
@@ -90,9 +91,9 @@ before_script:
-
cd tests && make create-${CI_PLATFORM} -s ; cd -
-
cd tests && make create-${CI_PLATFORM} -s ; cd -
# Check out latest tag if testing upgrade
# Check out latest tag if testing upgrade
# Uncomment when gitlab k
argo
repo has tags
# Uncomment when gitlab k
ubespray
repo has tags
#- test "${UPGRADE_TEST}" != "false" && git fetch --all && git checkout $(git describe --tags $(git rev-list --tags --max-count=1))
#- test "${UPGRADE_TEST}" != "false" && git fetch --all && git checkout $(git describe --tags $(git rev-list --tags --max-count=1))
-
test "${UPGRADE_TEST}" != "false" && git checkout
ba0a03a8ba2d97a73d06242ec4bb3c7e2012e58c
-
test "${UPGRADE_TEST}" != "false" && git checkout
f7d52564aad2ff8e337634951beb4a881c0e8aa6
# Checkout the CI vars file so it is available
# Checkout the CI vars file so it is available
-
test "${UPGRADE_TEST}" != "false" && git checkout "${CI_BUILD_REF}" tests/files/${CI_JOB_NAME}.yml
-
test "${UPGRADE_TEST}" != "false" && git checkout "${CI_BUILD_REF}" tests/files/${CI_JOB_NAME}.yml
# Workaround https://github.com/kubernetes-incubator/kubespray/issues/2021
# Workaround https://github.com/kubernetes-incubator/kubespray/issues/2021
...
@@ -102,7 +103,7 @@ before_script:
...
@@ -102,7 +103,7 @@ before_script:
# Create cluster
# Create cluster
-
>
-
>
ansible-playbook
ansible-playbook
-i
inventory/sample/hosts.ini
-i
${ANSIBLE_INVENTORY}
-b --become-user=root
-b --become-user=root
--private-key=${HOME}/.ssh/id_rsa
--private-key=${HOME}/.ssh/id_rsa
-u $SSH_USER
-u $SSH_USER
...
@@ -121,7 +122,7 @@ before_script:
...
@@ -121,7 +122,7 @@ before_script:
test "${UPGRADE_TEST}" == "graceful" && PLAYBOOK="upgrade-cluster.yml";
test "${UPGRADE_TEST}" == "graceful" && PLAYBOOK="upgrade-cluster.yml";
git checkout "${CI_BUILD_REF}";
git checkout "${CI_BUILD_REF}";
ansible-playbook
ansible-playbook
-i
inventory/sample/hosts.ini
-i
${ANSIBLE_INVENTORY}
-b --become-user=root
-b --become-user=root
--private-key=${HOME}/.ssh/id_rsa
--private-key=${HOME}/.ssh/id_rsa
-u $SSH_USER
-u $SSH_USER
...
@@ -137,20 +138,20 @@ before_script:
...
@@ -137,20 +138,20 @@ before_script:
# Tests Cases
# Tests Cases
## Test Master API
## Test Master API
-
>
-
>
ansible-playbook -i
inventory/sample/hosts.ini
-e ansible_python_interpreter=${PYPATH} -u $SSH_USER -e ansible_ssh_user=$SSH_USER $SSH_ARGS -b --become-user=root --limit "all:!fake_hosts" tests/testcases/010_check-apiserver.yml $LOG_LEVEL
ansible-playbook -i
${ANSIBLE_INVENTORY}
-e ansible_python_interpreter=${PYPATH} -u $SSH_USER -e ansible_ssh_user=$SSH_USER $SSH_ARGS -b --become-user=root --limit "all:!fake_hosts" tests/testcases/010_check-apiserver.yml $LOG_LEVEL
-e "{kubeadm_enabled: ${KUBEADM_ENABLED}}"
-e "{kubeadm_enabled: ${KUBEADM_ENABLED}}"
## Ping the between 2 pod
## Ping the between 2 pod
-
ansible-playbook -i
inventory/sample/hosts.ini
-e ansible_python_interpreter=${PYPATH} -u $SSH_USER -e ansible_ssh_user=$SSH_USER $SSH_ARGS -b --become-user=root --limit "all:!fake_hosts" tests/testcases/030_check-network.yml $LOG_LEVEL
-
ansible-playbook -i
${ANSIBLE_INVENTORY}
-e ansible_python_interpreter=${PYPATH} -u $SSH_USER -e ansible_ssh_user=$SSH_USER $SSH_ARGS -b --become-user=root --limit "all:!fake_hosts" tests/testcases/030_check-network.yml $LOG_LEVEL
## Advanced DNS checks
## Advanced DNS checks
-
ansible-playbook -i
inventory/sample/hosts.ini
-e ansible_python_interpreter=${PYPATH} -u $SSH_USER -e ansible_ssh_user=$SSH_USER $SSH_ARGS -b --become-user=root --limit "all:!fake_hosts" tests/testcases/040_check-network-adv.yml $LOG_LEVEL
-
ansible-playbook -i
${ANSIBLE_INVENTORY}
-e ansible_python_interpreter=${PYPATH} -u $SSH_USER -e ansible_ssh_user=$SSH_USER $SSH_ARGS -b --become-user=root --limit "all:!fake_hosts" tests/testcases/040_check-network-adv.yml $LOG_LEVEL
## Idempotency checks 1/5 (repeat deployment)
## Idempotency checks 1/5 (repeat deployment)
-
>
-
>
if [ "${IDEMPOT_CHECK}" = "true" ]; then
if [ "${IDEMPOT_CHECK}" = "true" ]; then
ansible-playbook
ansible-playbook
-i
inventory/sample/hosts.ini
-i
${ANSIBLE_INVENTORY}
-b --become-user=root
-b --become-user=root
--private-key=${HOME}/.ssh/id_rsa
--private-key=${HOME}/.ssh/id_rsa
-u $SSH_USER
-u $SSH_USER
...
@@ -167,7 +168,7 @@ before_script:
...
@@ -167,7 +168,7 @@ before_script:
-
>
-
>
if [ "${IDEMPOT_CHECK}" = "true" ]; then
if [ "${IDEMPOT_CHECK}" = "true" ]; then
ansible-playbook
ansible-playbook
-i
inventory/sample/hosts.ini
-i
${ANSIBLE_INVENTORY}
-b --become-user=root
-b --become-user=root
--private-key=${HOME}/.ssh/id_rsa
--private-key=${HOME}/.ssh/id_rsa
-u $SSH_USER
-u $SSH_USER
...
@@ -182,7 +183,7 @@ before_script:
...
@@ -182,7 +183,7 @@ before_script:
-
>
-
>
if [ "${IDEMPOT_CHECK}" = "true" -a "${RESET_CHECK}" = "true" ]; then
if [ "${IDEMPOT_CHECK}" = "true" -a "${RESET_CHECK}" = "true" ]; then
ansible-playbook
ansible-playbook
-i
inventory/sample/hosts.ini
-i
${ANSIBLE_INVENTORY}
-b --become-user=root
-b --become-user=root
--private-key=${HOME}/.ssh/id_rsa
--private-key=${HOME}/.ssh/id_rsa
-u $SSH_USER
-u $SSH_USER
...
@@ -199,7 +200,7 @@ before_script:
...
@@ -199,7 +200,7 @@ before_script:
-
>
-
>
if [ "${IDEMPOT_CHECK}" = "true" -a "${RESET_CHECK}" = "true" ]; then
if [ "${IDEMPOT_CHECK}" = "true" -a "${RESET_CHECK}" = "true" ]; then
ansible-playbook
ansible-playbook
-i
inventory/sample/hosts.ini
-i
${ANSIBLE_INVENTORY}
-b --become-user=root
-b --become-user=root
--private-key=${HOME}/.ssh/id_rsa
--private-key=${HOME}/.ssh/id_rsa
-u $SSH_USER
-u $SSH_USER
...
@@ -215,7 +216,7 @@ before_script:
...
@@ -215,7 +216,7 @@ before_script:
## Idempotency checks 5/5 (Advanced DNS checks)
## Idempotency checks 5/5 (Advanced DNS checks)
-
>
-
>
if [ "${IDEMPOT_CHECK}" = "true" -a "${RESET_CHECK}" = "true" ]; then
if [ "${IDEMPOT_CHECK}" = "true" -a "${RESET_CHECK}" = "true" ]; then
ansible-playbook -i
inventory/sample/hosts.ini
-e ansible_python_interpreter=${PYPATH}
ansible-playbook -i
${ANSIBLE_INVENTORY}
-e ansible_python_interpreter=${PYPATH}
-u $SSH_USER -e ansible_ssh_user=$SSH_USER $SSH_ARGS -b --become-user=root
-u $SSH_USER -e ansible_ssh_user=$SSH_USER $SSH_ARGS -b --become-user=root
--limit "all:!fake_hosts"
--limit "all:!fake_hosts"
tests/testcases/040_check-network-adv.yml $LOG_LEVEL;
tests/testcases/040_check-network-adv.yml $LOG_LEVEL;
...
...
This diff is collapsed.
Click to expand it.
tests/Makefile
+
1
−
1
View file @
09f93d9e
INVENTORY
=
$(
PWD
)
/../inventory/sample/
hosts
.ini
INVENTORY
=
$(
PWD
)
/../inventory/sample/
${
CI_JOB_NAME
}
-
${
BUILD_NUMBER
}
.ini
$(HOME)/.ssh/id_rsa
:
$(HOME)/.ssh/id_rsa
:
mkdir
-p
$(
HOME
)
/.ssh
mkdir
-p
$(
HOME
)
/.ssh
...
...
This diff is collapsed.
Click to expand it.
tests/support/aws.groovy
+
2
−
2
View file @
09f93d9e
def
run
(
username
,
credentialsId
,
ami
,
network_plugin
,
aws_access
,
aws_secret
)
{
def
run
(
username
,
credentialsId
,
ami
,
network_plugin
,
aws_access
,
aws_secret
)
{
def
inventory_path
=
pwd
()
+
"/inventory/sample/
hosts
.ini"
def
inventory_path
=
pwd
()
+
"/inventory/sample/
${env.CI_JOB_NAME}-${env.BUILD_NUMBER}
.ini"
dir
(
'tests'
)
{
dir
(
'tests'
)
{
wrap
([
$class
:
'AnsiColorBuildWrapper'
,
colorMapName:
"xterm"
])
{
wrap
([
$class
:
'AnsiColorBuildWrapper'
,
colorMapName:
"xterm"
])
{
try
{
try
{
create_vm
(
"${env.JOB_NAME}-${env.BUILD_NUMBER}"
,
inventory_path
,
ami
,
username
,
network_plugin
,
aws_access
,
aws_secret
)
create_vm
(
"${env.
CI_
JOB_NAME}-${env.BUILD_NUMBER}"
,
inventory_path
,
ami
,
username
,
network_plugin
,
aws_access
,
aws_secret
)
install_cluster
(
inventory_path
,
credentialsId
,
network_plugin
)
install_cluster
(
inventory_path
,
credentialsId
,
network_plugin
)
test_apiserver
(
inventory_path
,
credentialsId
)
test_apiserver
(
inventory_path
,
credentialsId
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment