orange-cloudfoundry/cf-ops-automation

View on GitHub
ci/tasks/run-ITs/task.yml

Summary

Maintainability
Test Coverage
---
#
# Copyright (C) 2015-2020 Orange
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

platform: linux
image_resource:
  type: registry-image
  source: {repository: coabot/cf-ops-automation, tag: develop-latest}
inputs:
  - name: cf-ops-automation
outputs:
  - name: coa-logs
  - name: prereqs
run:
  path: /bin/bash
  args:
    - -ce
    - |
      echo "Setup pre-requisites"
      cp cf-ops-automation/ci/bootstrap_coa_env/manual-ITs/*.* prereqs/
      ls prereqs
      PREREQS_FILE="prereqs/pipeline-dynamic-vars-prereqs.yml"
      echo "pipeline_vars:" > ${PREREQS_FILE}
      echo "  bot-github-access-token: ((cf-ops-automation-git-hub-token))" >> ${PREREQS_FILE}
      echo "  slack-webhook: ((slack-webhook))" >> ${PREREQS_FILE}
      echo "  slack-channel: ((slack-channel))" >> ${PREREQS_FILE}
      echo "  slack-disable: ((slack-disable-it))" >> ${PREREQS_FILE}
      printenv INTEGRATION_TEST_PREREQS > prereqs/integration-test-prereqs.yml
      cf-ops-automation/ci/scripts/deploy-bosh-releases.rb prereqs/bosh-deployment-manifest-prereqs.yml
      cd cf-ops-automation
      git config --global user.email "manual-IT@test.com"
      git config --global user.name "Local IT execution"
      git init .
      git submodule update --init
      git add .
      git commit -m "Manual IT tests"
      cd ..
      echo "removing existing releases and deployment"
      bosh delete-deployment --force -d bosh-deployment-sample --non-interactive
      bosh delete-release --non-interactive ntp
      bosh deployments
      bosh releases
      bosh stemcells
      echo "Setup DONE"
      echo "Starting intergation tests ($(TZ="Europe/Paris" date))"
      ./cf-ops-automation/scripts/run_integration_tests.rb
      if [ -f ./coa-logs/stdout.log ];then
        cat ./coa-logs/stdout.log
      fi
# it is not possible to include it as config param, otherwise we get an deserialization error
params:
  INTEGRATION_TEST_PREREQS: ((integration-test-prereqs))
  PREREQS_PATHS_RAW: "./prereqs/*.yml"
  COA_LOG_PATH: "../../../../coa-logs"
  BOSH_ENVIRONMENT: ((integration-test-prereqs.bosh.bosh_environment))
  BOSH_CLIENT: ((integration-test-prereqs.bosh.bosh_client))
  BOSH_CLIENT_SECRET: "((integration-test-prereqs.bosh.bosh_client_secret))"
  BOSH_CA_CERT: ((integration-test-prereqs.bosh.bosh_ca_cert))