From 1b193d522b0f85b11dff65104afce0334dec644d Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Fri, 8 Sep 2023 14:22:22 -0400 Subject: [PATCH 1/3] CI + route --- .github/workflows/ci.yaml | 37 +++++++++++++++++++++++++++++ score/app1/sh-demo-extensions.yaml | 13 ++++++++++ score/{ => app1}/sh-demo.yaml | 14 +++++++---- score/app2/sh-demo2-extensions.yaml | 13 ++++++++++ score/{ => app2}/sh-demo2.yaml | 14 +++++++---- score/sh-demo-extensions.yaml | 20 ---------------- score/sh-demo2-extensions.yaml | 20 ---------------- 7 files changed, 83 insertions(+), 48 deletions(-) create mode 100644 .github/workflows/ci.yaml create mode 100644 score/app1/sh-demo-extensions.yaml rename score/{ => app1}/sh-demo.yaml (88%) create mode 100644 score/app2/sh-demo2-extensions.yaml rename score/{ => app2}/sh-demo2.yaml (87%) delete mode 100644 score/sh-demo-extensions.yaml delete mode 100644 score/sh-demo2-extensions.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..13e60d7 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,37 @@ +name: ci +permissions: + contents: read + id-token: write +on: + push: +env: + SCORE_HUMANITEC_VERSION: 'latest' +jobs: + job: + runs-on: ubuntu-22.04 + steps: + - name: checkout code + uses: actions/checkout@v3 + - name: install score-humanitec + uses: score-spec/setup-score@v2 + with: + file: score-humanitec + token: ${{ secrets.GITHUB_TOKEN }} + version: ${{ env.SCORE_HUMANITEC_VERSION }} + - name: score-humanitec run - app1 + run: | + score-humanitec run \ + --env development \ + -f score/app1/sh-demo.yaml \ + --extensions score/app1/humanitec.score.yaml + - name: score-humanitec run - app2 + run: | + score-humanitec run \ + --env development \ + -f score/app2/score.yaml \ + --extensions score/app2/humanitec.score.yaml + - name: terraform validate + run: | + cd humanitec + terraform init -backend=false + terraform validate \ No newline at end of file diff --git a/score/app1/sh-demo-extensions.yaml b/score/app1/sh-demo-extensions.yaml new file mode 100644 index 0000000..4a5b8e1 --- /dev/null +++ b/score/app1/sh-demo-extensions.yaml @@ -0,0 +1,13 @@ +--- +apiVersion: humanitec.org/v1b1 + +resources: + dns: + scope: shared + +spec: + replicas: 2 + labels: + "labelkey": "value" + annotations: + "annotationkey": "value" diff --git a/score/sh-demo.yaml b/score/app1/sh-demo.yaml similarity index 88% rename from score/sh-demo.yaml rename to score/app1/sh-demo.yaml index 81b6431..2158dda 100644 --- a/score/sh-demo.yaml +++ b/score/app1/sh-demo.yaml @@ -43,12 +43,18 @@ containers: memory: "64Mi" cpu: "251m" resources: - "mydns": + mydns: type: dns - "okta": + route: + type: route + params: + host: ${resources.mydns.host} + path: / + port: 80 + okta: #class: specialoktaforApp1 type: oauth-client-identity - "mongo": + mongo: type: mongodb - "mypvc": + mypvc: type: volume diff --git a/score/app2/sh-demo2-extensions.yaml b/score/app2/sh-demo2-extensions.yaml new file mode 100644 index 0000000..4a5b8e1 --- /dev/null +++ b/score/app2/sh-demo2-extensions.yaml @@ -0,0 +1,13 @@ +--- +apiVersion: humanitec.org/v1b1 + +resources: + dns: + scope: shared + +spec: + replicas: 2 + labels: + "labelkey": "value" + annotations: + "annotationkey": "value" diff --git a/score/sh-demo2.yaml b/score/app2/sh-demo2.yaml similarity index 87% rename from score/sh-demo2.yaml rename to score/app2/sh-demo2.yaml index 03dfd20..2c8b8b7 100644 --- a/score/sh-demo2.yaml +++ b/score/app2/sh-demo2.yaml @@ -43,11 +43,17 @@ containers: memory: "64Mi" cpu: "251m" resources: - "mydns": + mydns: type: dns - "okta": + route: + type: route + params: + host: ${resources.mydns.host} + path: / + port: 80 + okta: type: oauth-client-identity - "mongo": + mongo: type: mongodb - "mypvc": + mypvc: type: volume diff --git a/score/sh-demo-extensions.yaml b/score/sh-demo-extensions.yaml deleted file mode 100644 index 9a7acdf..0000000 --- a/score/sh-demo-extensions.yaml +++ /dev/null @@ -1,20 +0,0 @@ ---- -apiVersion: humanitec.org/v1b1 - -resources: - "dns": - scope: shared - -spec: - replicas: 2 - "labels": - "labelkey": "value" - "annotations": - "annotationkey": "value" - "ingress": - rules: - "${resources.mydns}": - http: - "/": - type: prefix - port: 80 diff --git a/score/sh-demo2-extensions.yaml b/score/sh-demo2-extensions.yaml deleted file mode 100644 index 9a7acdf..0000000 --- a/score/sh-demo2-extensions.yaml +++ /dev/null @@ -1,20 +0,0 @@ ---- -apiVersion: humanitec.org/v1b1 - -resources: - "dns": - scope: shared - -spec: - replicas: 2 - "labels": - "labelkey": "value" - "annotations": - "annotationkey": "value" - "ingress": - rules: - "${resources.mydns}": - http: - "/": - type: prefix - port: 80 From 92e8bf263a065f5f77f17882d985322ba2e41ac9 Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Fri, 8 Sep 2023 14:23:41 -0400 Subject: [PATCH 2/3] Renaming score files --- score/app1/{sh-demo-extensions.yaml => humanitec.score.yaml} | 0 score/app1/{sh-demo.yaml => score.yaml} | 0 score/app2/{sh-demo2-extensions.yaml => humanitec.score.yaml} | 0 score/app2/{sh-demo2.yaml => score.yaml} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename score/app1/{sh-demo-extensions.yaml => humanitec.score.yaml} (100%) rename score/app1/{sh-demo.yaml => score.yaml} (100%) rename score/app2/{sh-demo2-extensions.yaml => humanitec.score.yaml} (100%) rename score/app2/{sh-demo2.yaml => score.yaml} (100%) diff --git a/score/app1/sh-demo-extensions.yaml b/score/app1/humanitec.score.yaml similarity index 100% rename from score/app1/sh-demo-extensions.yaml rename to score/app1/humanitec.score.yaml diff --git a/score/app1/sh-demo.yaml b/score/app1/score.yaml similarity index 100% rename from score/app1/sh-demo.yaml rename to score/app1/score.yaml diff --git a/score/app2/sh-demo2-extensions.yaml b/score/app2/humanitec.score.yaml similarity index 100% rename from score/app2/sh-demo2-extensions.yaml rename to score/app2/humanitec.score.yaml diff --git a/score/app2/sh-demo2.yaml b/score/app2/score.yaml similarity index 100% rename from score/app2/sh-demo2.yaml rename to score/app2/score.yaml From 448062637daa63d5793c1fc6e15bf32c0eeb03b3 Mon Sep 17 00:00:00 2001 From: Mathieu Benoit Date: Fri, 8 Sep 2023 14:24:29 -0400 Subject: [PATCH 3/3] Fix score file --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 13e60d7..0d74932 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -22,7 +22,7 @@ jobs: run: | score-humanitec run \ --env development \ - -f score/app1/sh-demo.yaml \ + -f score/app1/score.yaml \ --extensions score/app1/humanitec.score.yaml - name: score-humanitec run - app2 run: |