From 9f353a302f8c629f1e45d02d3e108f662b1c4136 Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Tue, 17 Mar 2020 09:25:10 -0400 Subject: [PATCH] improve CI Change-Id: I446391b689034e4f2e018fde5f4b1476cc1fa058 --- .zuul.yaml | 2 -- chart/values.yaml | 4 +--- location.txt | 1 - playbooks/functional/run.yaml | 36 ++++++++++++++--------------------- 4 files changed, 15 insertions(+), 28 deletions(-) delete mode 100644 location.txt diff --git a/.zuul.yaml b/.zuul.yaml index 986dd25..440e06b 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -4,8 +4,6 @@ run: playbooks/functional/run.yaml vars: minikube_dns_resolvers: ['1.1.1.1', '8.8.8.8'] - helm_charts: - nodepool: ./charts/nodepool - project: check: diff --git a/chart/values.yaml b/chart/values.yaml index 9c0c949..8b9d366 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -25,10 +25,8 @@ securityContext: {} # runAsUser: 1000 service: -# type: ClusterIP + type: ClusterIP port: 80 - type: NodePort - nodePort: 30009 ingress: enabled: false diff --git a/location.txt b/location.txt deleted file mode 100644 index e979707..0000000 --- a/location.txt +++ /dev/null @@ -1 +0,0 @@ -< Location: http://paste.openstack.org/show/790650/ diff --git a/playbooks/functional/run.yaml b/playbooks/functional/run.yaml index 89c45b9..0e65bb3 100644 --- a/playbooks/functional/run.yaml +++ b/playbooks/functional/run.yaml @@ -5,29 +5,21 @@ helm_release_name: lodgeit helm_chart: ./chart tasks: - - name: Get the Node Port command: > - kubectl get -o jsonpath="{.spec.ports[0].nodePort}" services lodgeit - register: nodePort - - - name: Get the Node IP - command: > - kubectl get nodes -o jsonpath="{.items[0].status.addresses[0].address}" - register: nodeIP + kubectl get svc/lodgeit -ojsonpath="http://{.spec.clusterIP}:{.spec.ports[0].port}" + register: _url - name: Post the paste - shell: "curl -vv --silent -d 'code=test&language=text&webpage=' http://{{ nodeIP.stdout }}:{{ nodePort.stdout }} 2>&1 |grep Location" - register: pasteLocationInfo - - - name: Get the pasteUrl - shell: "echo '{{ pasteLocationInfo.stdout }}' | cut -d' ' -f3" - register: pasteUrl - - - - name: Get the paste - command: > - curl -I {{ pasteUrl.stdout }} - register: getPaste - - + uri: + url: "{{ _url.stdout }}" + follow_redirects: all + method: POST + body_format: form-urlencoded + body: + code: test + language: text + webpage: "" + return_content: true + register: _paste + failed_when: "'test' not in _paste.content" \ No newline at end of file