Skip to content

Commit f4dab8b

Browse files
authored
chore: import schema files and update ci (#103)
Signed-off-by: Ben Meier <ben.meier@humanitec.com>
1 parent a7389d1 commit f4dab8b

17 files changed

+547
-119
lines changed

.github/workflows/linkchecker.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: "Code Quality: Link Checker"
2+
name: "CI"
33

44
on:
55
pull_request:
@@ -18,3 +18,13 @@ jobs:
1818
fail: true
1919
env:
2020
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
21+
22+
- name: Setup Go
23+
uses: actions/setup-go@v5
24+
with:
25+
go-version: "1.22"
26+
27+
- name: Check Schema
28+
env:
29+
GOPATH: /home/runner/work/go
30+
run: make test

Makefile

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Disable all the default make stuff
2+
MAKEFLAGS += --no-builtin-rules
3+
.SUFFIXES:
4+
5+
SCORE_EXAMPLES_DIR ?= ./samples
6+
7+
## Display help menu
8+
.PHONY: help
9+
help:
10+
@echo Documented Make targets:
11+
@perl -e 'undef $$/; while (<>) { while ($$_ =~ /## (.*?)(?:\n# .*)*\n.PHONY:\s+(\S+).*/mg) { printf "\033[36m%-30s\033[0m %s\n", $$2, $$1 } }' $(MAKEFILE_LIST) | sort
12+
13+
# ------------------------------------------------------------------------------
14+
# NON-PHONY TARGETS
15+
# ------------------------------------------------------------------------------
16+
17+
${GOPATH}/bin/jv:
18+
ifeq ($(GOPATH),)
19+
$(error GOPATH must be set)
20+
endif
21+
go install github.com/santhosh-tekuri/jsonschema/cmd/jv@latest
22+
23+
# ------------------------------------------------------------------------------
24+
# PHONY TARGETS
25+
# ------------------------------------------------------------------------------
26+
27+
.PHONY: .ALWAYS
28+
.ALWAYS:
29+
30+
## Test that the score schema matches the json-schema reference
31+
.PHONY: test-schema
32+
test-schema: ${GOPATH}/bin/jv
33+
${GOPATH}/bin/jv --assert-format --assert-content https://json-schema.org/draft/2020-12/schema ./score-v1b1.json
34+
@echo "Schema is a valid jsonschema"
35+
36+
## Test that the given score examples in $SCORE_EXAMPLES_DIR match the schema
37+
.PHONY: test-examples
38+
test-examples: ${GOPATH}/bin/jv
39+
ifeq ($(SCORE_EXAMPLES_DIR),)
40+
$(error SCORE_EXAMPLES_DIR must be set)
41+
endif
42+
find ${SCORE_EXAMPLES_DIR} -name 'score*.yaml' -print -exec ${GOPATH}/bin/jv --assert-format --assert-content ./score-v1b1.json {} \;
43+
@echo "Schema matches all samples"
44+
45+
## Run all tests
46+
.PHONY: test
47+
test: test-schema test-examples

README.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
![Score banner](/docs/images/banner.png)
22

3+
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
4+
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md)
5+
36
## ![Score](/docs/images/logo.svg) The Score Specification
47

58
Score is an open-source workload specification designed to simplify development for cloud-native developers. The specification enables you to describe your workload's configuration in a vendor-neutral way, eliminating the need for tooling-specific syntax from platforms such as Docker Compose or Kubernetes. By leveraging familiar concepts and semantics, defining a workload’s configuration becomes as simple as stating, “I want a database of type X and an event queue of type Y to accompany my workload”.
@@ -56,7 +59,7 @@ Looking at the example above, you'll notice that the Score specification is:
5659

5760
* **declarative**: With Score, developers declare what their workload requires to run as part of the Score specification. The platform in the target environment is responsible for resolving individual runtime requirements. This establishes a contract between dev and ops: If the requirements listed in the spec are honoured, the workload will run as intended.
5861

59-
The current version of the specification schema is stored [here](https://github.com/score-spec/schema/blob/main/score-v1b1.json). For a more detailed specification reference, check out our [developer documentation](https://docs.score.dev/docs/score-specification/score-spec-reference/).
62+
The current version of the specification schema is stored [here](./score-v1b1.json). For a more detailed specification reference, check out our [developer documentation](https://docs.score.dev/docs/score-specification/score-spec-reference/).
6063

6164
## ![Score](/docs/images/logo.svg) Implementation of the Score Specification
6265

@@ -112,11 +115,3 @@ See [Roadmap](roadmap.md). You can [submit an idea](https://github.com/score-spe
112115
### Contribution Guidelines and Governance
113116

114117
Our general contributor guidelines can be found in [CONTRIBUTING.md](CONTRIBUTING.md). Please note that some repositories may have additional guidelines. For more information on our governance model, please refer to [GOVERNANCE.md](GOVERNANCE.md).
115-
116-
### License
117-
118-
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
119-
120-
### Code of conduct
121-
122-
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md)

docs/questions/README.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/questions/are_config_files_generated_by_score_deployment_read.question.md

Lines changed: 0 additions & 19 deletions
This file was deleted.

docs/questions/how_do_I_install.question.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/questions/how_does_score_work.question.md

Lines changed: 0 additions & 7 deletions
This file was deleted.

docs/questions/how_is_score_platform_agnostic.question.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/questions/how_to_contanct.question.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/questions/what_do_I_need_to_know.question.md

Lines changed: 0 additions & 12 deletions
This file was deleted.

docs/questions/what_is_score.question.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

docs/questions/whats_the_difference.question.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/questions/who_should_adopt_score.question.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

docs/questions/why_should_I_use_score.question.md

Lines changed: 0 additions & 14 deletions
This file was deleted.

docs/questions/why_would_I_adpot_score.question.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

samples/score-full.yaml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
apiVersion: score.dev/v1b1
2+
metadata:
3+
name: example-workload-name123
4+
extra-key: extra-value
5+
annotations:
6+
prefix.com/Another-Key_Annotation.2: something else
7+
service:
8+
ports:
9+
port-one:
10+
port: 1000
11+
protocol: TCP
12+
targetPort: 10000
13+
port-two2:
14+
port: 8000
15+
containers:
16+
container-one1:
17+
image: localhost:4000/repo/my-image:tag
18+
command: ["/bin/sh", "-c"]
19+
args: ["hello", "world"]
20+
resources:
21+
requests:
22+
cpu: 1000m
23+
memory: 10Gi
24+
limits:
25+
cpu: "0.24"
26+
memory: 128M
27+
variables:
28+
SOME_VAR: some content here
29+
files:
30+
- target: /my/file
31+
mode: "0600"
32+
source: file.txt
33+
- target: /my/other/file
34+
content: |
35+
some multiline
36+
content
37+
volumes:
38+
- source: volume-name
39+
target: /mnt/something
40+
path: /sub/path
41+
readOnly: false
42+
- source: volume-two
43+
target: /mnt/something-else
44+
livenessProbe:
45+
httpGet:
46+
port: 8080
47+
path: /livez
48+
readinessProbe:
49+
httpGet:
50+
host: 127.0.0.1
51+
port: 80
52+
scheme: HTTP
53+
path: /readyz
54+
httpHeaders:
55+
- name: SOME_HEADER
56+
value: some-value-here
57+
container-two2:
58+
image: .
59+
resources:
60+
resource-one1:
61+
metadata:
62+
annotations:
63+
Default-Annotation: this is my annotation
64+
prefix.com/Another-Key_Annotation.2: something else
65+
extra-key: extra-value
66+
type: Resource-One
67+
class: default
68+
params:
69+
extra:
70+
data: here
71+
resource-two2:
72+
type: Resource-Two
73+
resource-three:
74+
type: Type-Three
75+
id: shared-type-three

0 commit comments

Comments
 (0)