-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: import schema files and update ci
Signed-off-by: Ben Meier <ben.meier@humanitec.com>
- Loading branch information
1 parent
a7389d1
commit 1374a77
Showing
17 changed files
with
540 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Disable all the default make stuff | ||
MAKEFLAGS += --no-builtin-rules | ||
.SUFFIXES: | ||
|
||
SCORE_EXAMPLES_DIR ?= ./samples | ||
|
||
## Display help menu | ||
.PHONY: help | ||
help: | ||
@echo Documented Make targets: | ||
@perl -e 'undef $$/; while (<>) { while ($$_ =~ /## (.*?)(?:\n# .*)*\n.PHONY:\s+(\S+).*/mg) { printf "\033[36m%-30s\033[0m %s\n", $$2, $$1 } }' $(MAKEFILE_LIST) | sort | ||
|
||
# ------------------------------------------------------------------------------ | ||
# NON-PHONY TARGETS | ||
# ------------------------------------------------------------------------------ | ||
|
||
${GOPATH}/bin/jv: | ||
ifeq ($(GOPATH),) | ||
$(error GOPATH must be set) | ||
endif | ||
go install github.com/santhosh-tekuri/jsonschema/cmd/jv@latest | ||
|
||
# ------------------------------------------------------------------------------ | ||
# PHONY TARGETS | ||
# ------------------------------------------------------------------------------ | ||
|
||
.PHONY: .ALWAYS | ||
.ALWAYS: | ||
|
||
## Test that the score schema matches the json-schema reference | ||
.PHONY: test-schema | ||
test-schema: ${GOPATH}/bin/jv | ||
${GOPATH}/bin/jv -assertformat -assertcontent https://json-schema.org/draft/2020-12/schema ./score-v1b1.json | ||
@echo "Schema is a valid jsonschema" | ||
|
||
## Test that the given score examples in $SCORE_EXAMPLES_DIR match the schema | ||
.PHONY: test-examples | ||
test-examples: ${GOPATH}/bin/jv | ||
ifeq ($(SCORE_EXAMPLES_DIR),) | ||
$(error SCORE_EXAMPLES_DIR must be set) | ||
endif | ||
find ${SCORE_EXAMPLES_DIR} -name 'score*.yaml' -print -exec ${GOPATH}/bin/jv -assertformat -assertcontent ./score-v1b1.json {} \; | ||
@echo "Schema matches all samples" | ||
|
||
## Run all tests | ||
.PHONY: test | ||
test: test-schema test-examples |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
docs/questions/are_config_files_generated_by_score_deployment_read.question.md
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
apiVersion: score.dev/v1b1 | ||
metadata: | ||
name: example-workload-name123 | ||
extra-key: extra-value | ||
annotations: | ||
prefix.com/Another-Key_Annotation.2: something else | ||
service: | ||
ports: | ||
port-one: | ||
port: 1000 | ||
protocol: TCP | ||
targetPort: 10000 | ||
port-two2: | ||
port: 8000 | ||
containers: | ||
container-one1: | ||
image: localhost:4000/repo/my-image:tag | ||
command: ["/bin/sh", "-c"] | ||
args: ["hello", "world"] | ||
resources: | ||
requests: | ||
cpu: 1000m | ||
memory: 10Gi | ||
limits: | ||
cpu: "0.24" | ||
memory: 128M | ||
variables: | ||
SOME_VAR: some content here | ||
files: | ||
- target: /my/file | ||
mode: "0600" | ||
source: file.txt | ||
- target: /my/other/file | ||
content: | | ||
some multiline | ||
content | ||
volumes: | ||
- source: volume-name | ||
target: /mnt/something | ||
path: /sub/path | ||
readOnly: false | ||
- source: volume-two | ||
target: /mnt/something-else | ||
livenessProbe: | ||
httpGet: | ||
port: 8080 | ||
path: /livez | ||
readinessProbe: | ||
httpGet: | ||
host: 127.0.0.1 | ||
port: 80 | ||
scheme: HTTP | ||
path: /readyz | ||
httpHeaders: | ||
- name: SOME_HEADER | ||
value: some-value-here | ||
container-two2: | ||
image: . | ||
resources: | ||
resource-one1: | ||
metadata: | ||
annotations: | ||
Default-Annotation: this is my annotation | ||
prefix.com/Another-Key_Annotation.2: something else | ||
extra-key: extra-value | ||
type: Resource-One | ||
class: default | ||
params: | ||
extra: | ||
data: here | ||
resource-two2: | ||
type: Resource-Two | ||
resource-three: | ||
type: Type-Three | ||
id: shared-type-three |
Oops, something went wrong.