Skip to content

Commit 6dc03bf

Browse files
committed
Add conventions for app source metadata
Signed-off-by: Javier Romero <[email protected]>
1 parent f66a95f commit 6dc03bf

File tree

8 files changed

+235
-8
lines changed

8 files changed

+235
-8
lines changed

content/docs/app-developer-guide/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
+++
2-
title="App Developer's Guide"
2+
title="App Developer Guide"
33
weight=4
44
include_summaries=true
55
expand=true

content/docs/buildpack-author-guide/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
+++
2-
title="Buildpack Author's Guide"
2+
title="Buildpack Author Guide"
33
weight=4
44
include_summaries=true
55
expand=true

content/docs/operator-guide/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
+++
2-
title="Operator's Guide"
2+
title="Operator Guide"
33
weight=5
44
include_summaries=true
55
expand=true

content/docs/platform-guide/_index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
+++
2+
title="Platform Guide"
3+
weight=6
4+
include_summaries=true
5+
expand=true
6+
+++
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
+++
2+
title="Conventions"
3+
weight=1
4+
include_summaries=true
5+
expand=false
6+
+++
Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
+++
2+
title="Source Metadata"
3+
weight=1
4+
summary="Conventions for declaring app source information in the app image."
5+
tags=["spec:platform/0.6", "spec:project-descriptor/0.2"]
6+
+++
7+
8+
## Summary
9+
10+
The following are conventions for declaring different type of source inputs. This information is provided to the [lifecycle][lifecycle] using [project-metadata.toml][project-metadata].
11+
12+
## Sources
13+
14+
### Types
15+
16+
The following types are concrete source types and can use any keys as long as they don't overlap with [additive](#additive) sources.
17+
18+
#### Git
19+
20+
- #### `type` _(string,required)_
21+
Must be `git`
22+
23+
- #### `source` _(required)_
24+
25+
- `version` _(required)_
26+
27+
- `commit` _(string,required)_\
28+
Full commit hash
29+
30+
- `describe` _(string,optional)_\
31+
Description of commit (see `git describe`)
32+
33+
- `metadata` _(optional)_
34+
35+
- `repository` _(string,optional)_\
36+
Repository URL
37+
38+
- `refs` _(string,optional)_\
39+
Additional relevant Git references
40+
41+
###### Example
42+
43+
```toml
44+
[source]
45+
type = "git"
46+
47+
[source.version]
48+
commit = "63a73f1b0f2a4f6978c19184b0ea33ad3f092913"
49+
describe = "v0.18.1-2-g3f092913"
50+
51+
[source.metadata]
52+
repository = "https://github.com/myorg/myrepo.git"
53+
refs = ["master", "v3.0"]
54+
```
55+
56+
#### Image
57+
58+
- #### `type` _(string,required)_
59+
Must be `image`
60+
61+
- #### `source` _(required)_
62+
63+
- `version` _(required)_
64+
65+
- `digest` _(string,required)_\
66+
Image digest
67+
68+
- `metadata` _(optional)_
69+
70+
- `path` _(string,optional)_\
71+
Absolute path to source in image
72+
73+
- `repository` _(string,optional)_\
74+
Fully-qualified image name
75+
76+
- `refs` _(string,optional)_\
77+
Additional relevant image names/tags
78+
79+
###### Example
80+
81+
```toml
82+
[source]
83+
type = "image"
84+
85+
[source.version]
86+
digest = "146c4bce42545e6a4575283b32a7f01924ef86ce848273079693a42b52b27321"
87+
88+
[source.metadata]
89+
path = "/source"
90+
repository = "index.docker.io/example/image:latest"
91+
refs = ["index.docker.io/example/image:mytag", "index.docker.io/example/image@sha256:146c4bce42545e6a4575283b32a7f01924ef86ce848273079693a42b52b27321"]
92+
```
93+
94+
### Additive
95+
96+
The following source information is considered additive and should not overlap with source [types](#types).
97+
98+
#### `project.toml`
99+
100+
- #### `type` _(string,required)_
101+
Must be `project` **(only if no other type is present)**
102+
103+
- #### `source` _(required)_
104+
105+
- `version` _(required)_
106+
107+
- `version` _(string,optional)_\
108+
Version as declared in `_.version`
109+
110+
- `metadata` _(optional)_
111+
112+
- `url` _(string,optional)_\
113+
URL as declared in `_.source-url`
114+
115+
###### Example (standalone)
116+
117+
```toml
118+
[source]
119+
type = "project"
120+
121+
[source.version]
122+
version = "1.2.3"
123+
124+
[source.metadata]
125+
url = "https://github.com/example/repo"
126+
```
127+
128+
###### Example (w/ Image)
129+
130+
```toml
131+
[source]
132+
type = "image"
133+
134+
[source.version]
135+
digest = "146c4bce42545e6a4575283b32a7f01924ef86ce848273079693a42b52b27321"
136+
version = "1.2.3"
137+
138+
[source.metadata]
139+
path = "/source"
140+
repository = "index.docker.io/example/image:latest"
141+
refs = ["index.docker.io/example/image:mytag", "index.docker.io/example/image@sha256:146c4bce42545e6a4575283b32a7f01924ef86ce848273079693a42b52b27321"]
142+
url = "https://github.com/example/repo"
143+
```
144+
145+
[lifecycle]: /docs/concepts/components/lifecycle/
146+
[project-metadata]: https://github.com/buildpacks/spec/blob/platform/0.7/platform.md#project-metadatatoml-toml

tools/go.mod

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,23 @@ go 1.14
44

55
require (
66
github.com/Azure/azure-sdk-for-go v42.3.0+incompatible // indirect
7-
github.com/buildpacks/pack v0.19.0
7+
github.com/buildpacks/pack v0.20.0
88
github.com/containerd/containerd v1.5.0-beta.4 // indirect
99
github.com/containerd/stargz-snapshotter/estargz v0.5.0 // indirect
1010
github.com/docker/cli v20.10.5+incompatible // indirect
11-
github.com/docker/docker v20.10.5+incompatible // indirect
1211
github.com/gohugoio/hugo v0.82.0
1312
github.com/hashicorp/golang-lru v0.5.3 // indirect
1413
github.com/jromero/ugo v0.0.0-20200909162226-1fa70f1e3823 // indirect
1514
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect
1615
github.com/moby/term v0.0.0-20201216013528-df9cb8a40635 // indirect
1716
github.com/sabhiram/go-gitignore v0.0.0-20201211210132-54b8a0bf510f // indirect
1817
github.com/sirupsen/logrus v1.8.1 // indirect
19-
github.com/spf13/cobra v1.1.3
18+
github.com/spf13/cobra v1.2.1
2019
github.com/vdemeester/k8s-pkg-credentialprovider v1.18.1-0.20201019120933-f1d16962a4db // indirect
2120
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 // indirect
2221
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
2322
golang.org/x/term v0.0.0-20210317153231-de623e64d2a6 // indirect
2423
gonum.org/v1/netlib v0.0.0-20190331212654-76723241ea4e // indirect
25-
google.golang.org/genproto v0.0.0-20210325224202-eed09b1b5210 // indirect
26-
google.golang.org/grpc v1.36.1 // indirect
2724
k8s.io/code-generator v0.20.1 // indirect
2825
sigs.k8s.io/structured-merge-diff v0.0.0-20190525122527-15d366b2352e // indirect
2926
)

0 commit comments

Comments
 (0)