From f2a6fd40b41522c33f52ac0f4f55db735055c5bd Mon Sep 17 00:00:00 2001 From: Kavitha Thulasiraman Date: Fri, 23 Apr 2021 11:27:03 -0400 Subject: [PATCH] bigbang compliant --- .gitlab-ci.yml | 4 +++ CHANGELOG.md | 2 ++ CONTRIBUTING.md | 22 ++++++++++++++++ chart/templates/bigbang/virtualservice.yaml | 2 +- tests/README.md | 1 + tests/cypress.json | 10 +++++++ tests/cypress/integration/nexus-healthspec.js | 5 ++++ tests/cypress/look_other_packages_for_example | 0 tests/main-test-gateway.yaml | 26 +++++++++++++++++++ tests/test-values.yml | 7 +++++ 10 files changed, 78 insertions(+), 1 deletion(-) create mode 100644 .gitlab-ci.yml create mode 100644 CHANGELOG.md create mode 100644 CONTRIBUTING.md create mode 100644 tests/README.md create mode 100644 tests/cypress.json create mode 100644 tests/cypress/integration/nexus-healthspec.js delete mode 100644 tests/cypress/look_other_packages_for_example create mode 100644 tests/main-test-gateway.yaml create mode 100644 tests/test-values.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..6e9f482 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,4 @@ +include: + - project: 'platform-one/big-bang/pipeline-templates/pipeline-templates' + ref: master + file: '/templates/package-tests.yml' diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..4dc68c6 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,2 @@ +# Changelog + diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..dd0eeba --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,22 @@ +# Contributing + +Thanks for contributing to this repository! + +This repository follows the following conventions: + +* [Semantic Versioning](https://semver.org/) +* [Keep a Changelog](https://keepachangelog.com/) +* [Conventional Commits](https://www.conventionalcommits.org/) + +Development requires the Kubernetes CLI tool as well as a local Kubernetes cluster. [k3d](https://k3d.io) is recommended as a lightweight local option for standing up Kubernetes clusters. + +To contribute a change: + +1. Create a branch on the cloned repository +2. Make the changes in code. +3. Write tests using [cypress](https://www.cypress.io) and [Conftest](https://conftest.dev) +4. Make commits using the [Conventional Commits](https://www.conventionalcommits.org/) format. This helps with automation for changelog. Update `CHANGELOG.md` in the same commit using the [Keep a Changelog](https://keepachangelog.com). Depending on tooling maturity, this step may be automated. +5. Open a merge request using one of the provided templates. If this merge request is solving a preexisting issue, add the issue reference into the description of the MR. +6. During this time, ensure that all new commits are rebased into your branch so that it remains up to date with the `main` branch. +7. Wait for a maintainer of the repository (see CODEOWNERS) to approve. +8. If you have permissions to merge, you are responsible for merging. Otherwise, a CODEOWNER will merge the commit. diff --git a/chart/templates/bigbang/virtualservice.yaml b/chart/templates/bigbang/virtualservice.yaml index b5e29fc..952e2a2 100644 --- a/chart/templates/bigbang/virtualservice.yaml +++ b/chart/templates/bigbang/virtualservice.yaml @@ -14,7 +14,7 @@ metadata: app.kubernetes.io/component: {{ include "nexus.name" . }} spec: gateways: - - main.istio-system.svc.cluster.local + - istio-system/main hosts: - "{{ .Values.hostname }}.{{ .Values.domain }}" http: diff --git a/tests/README.md b/tests/README.md new file mode 100644 index 0000000..d735775 --- /dev/null +++ b/tests/README.md @@ -0,0 +1 @@ +Cypress tests run headless calling the script cy-run.sh \ No newline at end of file diff --git a/tests/cypress.json b/tests/cypress.json new file mode 100644 index 0000000..43b18da --- /dev/null +++ b/tests/cypress.json @@ -0,0 +1,10 @@ +{ + + "pluginsFile": false, + "supportFile": false, + "fixturesFolder": false, + "env": { + "nexus_url": "nexus.bigbang.dev" + + } +} diff --git a/tests/cypress/integration/nexus-healthspec.js b/tests/cypress/integration/nexus-healthspec.js new file mode 100644 index 0000000..dbaa644 --- /dev/null +++ b/tests/cypress/integration/nexus-healthspec.js @@ -0,0 +1,5 @@ +describe('Basic prometheus', function() { + it('Visits the prometheus sign in page', function() { + cy.visit(Cypress.env('nexus_url')) + }) +}) diff --git a/tests/cypress/look_other_packages_for_example b/tests/cypress/look_other_packages_for_example deleted file mode 100644 index e69de29..0000000 diff --git a/tests/main-test-gateway.yaml b/tests/main-test-gateway.yaml new file mode 100644 index 0000000..1c7d7d1 --- /dev/null +++ b/tests/main-test-gateway.yaml @@ -0,0 +1,26 @@ +apiVersion: networking.istio.io/v1beta1 +kind: Gateway +metadata: + name: main + namespace: istio-system +spec: + selector: + istio: ingressgateway + servers: + - hosts: + - '*' + port: + name: http + number: 80 + protocol: HTTP + tls: + httpsRedirect: true + - hosts: + - '*.bigbang.dev' + port: + name: https + number: 443 + protocol: HTTPS + tls: + credentialName: wildcard-cert + mode: SIMPLE diff --git a/tests/test-values.yml b/tests/test-values.yml new file mode 100644 index 0000000..51a51c8 --- /dev/null +++ b/tests/test-values.yml @@ -0,0 +1,7 @@ + +istio: + enabled: true +nexus: + imagePullSecrets: [name: private-registry] + + -- GitLab