Compare commits
84 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
60a0d343a0 | ||
|
b3bc5a6d84 | ||
|
e6e95c28a4 | ||
|
9ec63a7555 | ||
|
6970301b80 | ||
|
d155f767a3 | ||
|
b5b2c1dec6 | ||
|
a64d0487d7 | ||
|
68e4cac93d | ||
|
7ba3606742 | ||
|
2331fdf258 | ||
|
24ce540669 | ||
|
d729db4f91 | ||
|
f7b4ed1238 | ||
|
33c4e25305 | ||
|
b83177b368 | ||
|
839b70f9d5 | ||
|
dbacb9a831 | ||
|
247cc9691a | ||
|
4c92c35ca9 | ||
|
9ca1efb941 | ||
|
0170173c39 | ||
|
dab39f1537 | ||
|
f402fd6ae4 | ||
|
b0bbce7f66 | ||
|
2ee3d3070b | ||
|
6e3a986a06 | ||
|
4fde7ad49c | ||
|
24b670ad98 | ||
|
1294d94f8e | ||
|
4ab8e580e1 | ||
|
3617daf484 | ||
|
b5cd5676d4 | ||
|
204ddf0626 | ||
|
588ab464f7 | ||
|
6ed49e6282 | ||
|
499da83ec1 | ||
|
1bc39885c1 | ||
|
c314eea2b2 | ||
|
22d80c023d | ||
|
38b3677383 | ||
|
3c91de3093 | ||
|
75359341f6 | ||
|
2432cf717c | ||
|
c77859c8ba | ||
|
60ab7b421c | ||
|
7ce1a14667 | ||
|
d06e52bc52 | ||
|
66f0185bb8 | ||
|
232fc64e3a | ||
|
1b08479748 | ||
|
3a28db68be | ||
|
6bb43c8680 | ||
|
41050ffe08 | ||
|
8e5442c4ef | ||
|
eda41b71bf | ||
|
388c08f740 | ||
|
dbef88086f | ||
|
b73e7a71ac | ||
|
b9fba690eb | ||
|
ac82374ba6 | ||
|
c92519a44e | ||
|
3b4179d34d | ||
|
0784993ef8 | ||
|
52c3e9e410 | ||
|
82a5e6726c | ||
|
41e1fe3437 | ||
|
48cce1cba0 | ||
|
61879b94bc | ||
|
36ea4ee555 | ||
|
74fa878183 | ||
|
9dc751fe24 | ||
|
c94c54c4e6 | ||
|
187f09259d | ||
|
6d6eaf3451 | ||
|
1484a7ec95 | ||
|
31cebacef4 | ||
|
394bbab10c | ||
|
ee4c9054ec | ||
|
e6428a5c4e | ||
|
26b4721af7 | ||
|
352ce8b7fe | ||
|
cb0becceaf | ||
|
91224bc155 |
@@ -1,2 +1,12 @@
|
|||||||
/coverage
|
/coverage
|
||||||
/node_modules
|
|
||||||
|
# Dependency directories
|
||||||
|
node_modules/
|
||||||
|
jspm_packages/
|
||||||
|
|
||||||
|
# yarn v2
|
||||||
|
.yarn/cache
|
||||||
|
.yarn/unplugged
|
||||||
|
.yarn/build-state.yml
|
||||||
|
.yarn/install-state.gz
|
||||||
|
.pnp.*
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
],
|
],
|
||||||
"parser": "@typescript-eslint/parser",
|
"parser": "@typescript-eslint/parser",
|
||||||
"parserOptions": {
|
"parserOptions": {
|
||||||
"ecmaVersion": "latest",
|
"ecmaVersion": 2023,
|
||||||
"sourceType": "module"
|
"sourceType": "module"
|
||||||
},
|
},
|
||||||
"plugins": [
|
"plugins": [
|
||||||
|
2
.gitattributes
vendored
2
.gitattributes
vendored
@@ -1,3 +1,5 @@
|
|||||||
|
/.yarn/releases/** binary
|
||||||
|
/.yarn/plugins/** binary
|
||||||
/__tests__/fixtures/** -linguist-detectable
|
/__tests__/fixtures/** -linguist-detectable
|
||||||
/dist/** linguist-generated=true
|
/dist/** linguist-generated=true
|
||||||
/lib/** linguist-generated=true
|
/lib/** linguist-generated=true
|
||||||
|
156
.github/workflows/ci.yml
vendored
156
.github/workflows/ci.yml
vendored
@@ -17,6 +17,7 @@ on:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
DOCKER_IMAGE: localhost:5000/name/app
|
DOCKER_IMAGE: localhost:5000/name/app
|
||||||
|
BUILDX_VERSION: latest
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
multi-images:
|
multi-images:
|
||||||
@@ -25,6 +26,12 @@ jobs:
|
|||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
with:
|
||||||
|
version: ${{ env.BUILDX_VERSION }}
|
||||||
|
driver: docker
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -56,6 +63,12 @@ jobs:
|
|||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
with:
|
||||||
|
version: ${{ env.BUILDX_VERSION }}
|
||||||
|
driver: docker
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -86,6 +99,12 @@ jobs:
|
|||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
with:
|
||||||
|
version: ${{ env.BUILDX_VERSION }}
|
||||||
|
driver: docker
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -114,6 +133,12 @@ jobs:
|
|||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
with:
|
||||||
|
version: ${{ env.BUILDX_VERSION }}
|
||||||
|
driver: docker
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -139,6 +164,12 @@ jobs:
|
|||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
with:
|
||||||
|
version: ${{ env.BUILDX_VERSION }}
|
||||||
|
driver: docker
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -156,6 +187,12 @@ jobs:
|
|||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
with:
|
||||||
|
version: ${{ env.BUILDX_VERSION }}
|
||||||
|
driver: docker
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -165,12 +202,18 @@ jobs:
|
|||||||
name=ghcr.io/name/app,enable=${{ github.event_name == 'pull_request' }}
|
name=ghcr.io/name/app,enable=${{ github.event_name == 'pull_request' }}
|
||||||
name=ghcr.io/name/release,enable=${{ startsWith(github.ref, 'refs/tags/') }}
|
name=ghcr.io/name/release,enable=${{ startsWith(github.ref, 'refs/tags/') }}
|
||||||
|
|
||||||
labels:
|
custom-labels-annotations:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
with:
|
||||||
|
version: ${{ env.BUILDX_VERSION }}
|
||||||
|
driver: docker
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -183,6 +226,11 @@ jobs:
|
|||||||
org.opencontainers.image.title=MyCustomTitle
|
org.opencontainers.image.title=MyCustomTitle
|
||||||
org.opencontainers.image.description=this is a "good" example
|
org.opencontainers.image.description=this is a "good" example
|
||||||
org.opencontainers.image.vendor=MyCompany
|
org.opencontainers.image.vendor=MyCompany
|
||||||
|
annotations: |
|
||||||
|
maintainer=Foo
|
||||||
|
org.opencontainers.image.title=MyFooTitle
|
||||||
|
org.opencontainers.image.description=this is a "foo" example
|
||||||
|
org.opencontainers.image.vendor=MyFooCompany
|
||||||
|
|
||||||
global-exps:
|
global-exps:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -190,6 +238,12 @@ jobs:
|
|||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
with:
|
||||||
|
version: ${{ env.BUILDX_VERSION }}
|
||||||
|
driver: docker
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -211,6 +265,12 @@ jobs:
|
|||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
with:
|
||||||
|
version: ${{ env.BUILDX_VERSION }}
|
||||||
|
driver: docker
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
@@ -240,6 +300,12 @@ jobs:
|
|||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
with:
|
||||||
|
version: ${{ env.BUILDX_VERSION }}
|
||||||
|
driver-opts: network=host
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
id: docker_meta
|
id: docker_meta
|
||||||
@@ -256,17 +322,9 @@ jobs:
|
|||||||
type=semver,pattern=v{{major}}.{{minor}}
|
type=semver,pattern=v{{major}}.{{minor}}
|
||||||
type=semver,pattern=v{{major}}
|
type=semver,pattern=v{{major}}
|
||||||
type=sha
|
type=sha
|
||||||
-
|
|
||||||
name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
-
|
|
||||||
name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
with:
|
|
||||||
driver-opts: network=host
|
|
||||||
-
|
-
|
||||||
name: Build and push to local registry
|
name: Build and push to local registry
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: ./test
|
context: ./test
|
||||||
file: ./test/Dockerfile
|
file: ./test/Dockerfile
|
||||||
@@ -294,6 +352,11 @@ jobs:
|
|||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
with:
|
||||||
|
version: ${{ env.BUILDX_VERSION }}
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
id: docker_meta
|
id: docker_meta
|
||||||
@@ -311,15 +374,9 @@ jobs:
|
|||||||
type=semver,pattern={{major}}.{{minor}}
|
type=semver,pattern={{major}}.{{minor}}
|
||||||
type=semver,pattern={{major}}
|
type=semver,pattern={{major}}
|
||||||
type=sha
|
type=sha
|
||||||
-
|
|
||||||
name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
-
|
|
||||||
name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
-
|
-
|
||||||
name: Build
|
name: Build
|
||||||
uses: docker/bake-action@v4
|
uses: docker/bake-action@v5
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
./test/docker-bake.hcl
|
./test/docker-bake.hcl
|
||||||
@@ -340,6 +397,12 @@ jobs:
|
|||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
with:
|
||||||
|
version: ${{ env.BUILDX_VERSION }}
|
||||||
|
driver: docker
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
@@ -362,6 +425,12 @@ jobs:
|
|||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
with:
|
||||||
|
version: ${{ env.BUILDX_VERSION }}
|
||||||
|
driver: docker
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
@@ -372,9 +441,11 @@ jobs:
|
|||||||
ghcr.io/name/app
|
ghcr.io/name/app
|
||||||
labels: |
|
labels: |
|
||||||
maintainer=CrazyMax
|
maintainer=CrazyMax
|
||||||
|
annotations: |
|
||||||
|
maintainer=Foo
|
||||||
-
|
-
|
||||||
name: Build
|
name: Build
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: ./test
|
context: ./test
|
||||||
file: ./test/output.Dockerfile
|
file: ./test/output.Dockerfile
|
||||||
@@ -382,6 +453,7 @@ jobs:
|
|||||||
DOCKER_METADATA_OUTPUT_VERSION
|
DOCKER_METADATA_OUTPUT_VERSION
|
||||||
DOCKER_METADATA_OUTPUT_TAGS
|
DOCKER_METADATA_OUTPUT_TAGS
|
||||||
DOCKER_METADATA_OUTPUT_LABELS
|
DOCKER_METADATA_OUTPUT_LABELS
|
||||||
|
DOCKER_METADATA_OUTPUT_ANNOTATIONS
|
||||||
DOCKER_METADATA_OUTPUT_JSON
|
DOCKER_METADATA_OUTPUT_JSON
|
||||||
|
|
||||||
bake-annotations:
|
bake-annotations:
|
||||||
@@ -390,6 +462,11 @@ jobs:
|
|||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
with:
|
||||||
|
version: ${{ env.BUILDX_VERSION }}
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
id: docker_meta
|
id: docker_meta
|
||||||
@@ -409,17 +486,9 @@ jobs:
|
|||||||
type=sha
|
type=sha
|
||||||
env:
|
env:
|
||||||
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
|
DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index
|
||||||
-
|
|
||||||
name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
-
|
|
||||||
name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
with:
|
|
||||||
version: v0.12.0-rc1
|
|
||||||
-
|
-
|
||||||
name: Build
|
name: Build
|
||||||
uses: docker/bake-action@v4
|
uses: docker/bake-action@v5
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
./test/docker-bake.hcl
|
./test/docker-bake.hcl
|
||||||
@@ -434,6 +503,12 @@ jobs:
|
|||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
with:
|
||||||
|
version: ${{ env.BUILDX_VERSION }}
|
||||||
|
driver: docker
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
uses: ./
|
uses: ./
|
||||||
@@ -447,3 +522,30 @@ jobs:
|
|||||||
-
|
-
|
||||||
name: Print envs
|
name: Print envs
|
||||||
run: env|sort
|
run: env|sort
|
||||||
|
|
||||||
|
bake-cwd:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
-
|
||||||
|
name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
with:
|
||||||
|
version: latest
|
||||||
|
-
|
||||||
|
name: Docker meta
|
||||||
|
id: docker_meta
|
||||||
|
uses: ./
|
||||||
|
-
|
||||||
|
name: Build
|
||||||
|
uses: docker/bake-action@v5
|
||||||
|
with:
|
||||||
|
source: "{{defaultContext}}"
|
||||||
|
files: |
|
||||||
|
./test/docker-bake.hcl
|
||||||
|
cwd://${{ steps.docker_meta.outputs.bake-file-tags }}
|
||||||
|
cwd://${{ steps.docker_meta.outputs.bake-file-labels }}
|
||||||
|
targets: |
|
||||||
|
release
|
||||||
|
5
.github/workflows/test.yml
vendored
5
.github/workflows/test.yml
vendored
@@ -20,11 +20,12 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Test
|
name: Test
|
||||||
uses: docker/bake-action@v4
|
uses: docker/bake-action@v5
|
||||||
with:
|
with:
|
||||||
targets: test
|
targets: test
|
||||||
-
|
-
|
||||||
name: Upload coverage
|
name: Upload coverage
|
||||||
uses: codecov/codecov-action@v3
|
uses: codecov/codecov-action@v4
|
||||||
with:
|
with:
|
||||||
file: ./coverage/clover.xml
|
file: ./coverage/clover.xml
|
||||||
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
2
.github/workflows/validate.yml
vendored
2
.github/workflows/validate.yml
vendored
@@ -40,6 +40,6 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Validate
|
name: Validate
|
||||||
uses: docker/bake-action@v4
|
uses: docker/bake-action@v5
|
||||||
with:
|
with:
|
||||||
targets: ${{ matrix.target }}
|
targets: ${{ matrix.target }}
|
||||||
|
71
.gitignore
vendored
71
.gitignore
vendored
@@ -1,12 +1,5 @@
|
|||||||
/.dev
|
# https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore
|
||||||
node_modules/
|
|
||||||
lib
|
|
||||||
|
|
||||||
# Jetbrains
|
|
||||||
/.idea
|
|
||||||
/*.iml
|
|
||||||
|
|
||||||
# Rest of the file pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
|
|
||||||
# Logs
|
# Logs
|
||||||
logs
|
logs
|
||||||
*.log
|
*.log
|
||||||
@@ -14,6 +7,7 @@ npm-debug.log*
|
|||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
yarn-error.log*
|
yarn-error.log*
|
||||||
lerna-debug.log*
|
lerna-debug.log*
|
||||||
|
.pnpm-debug.log*
|
||||||
|
|
||||||
# Diagnostic reports (https://nodejs.org/api/report.html)
|
# Diagnostic reports (https://nodejs.org/api/report.html)
|
||||||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
|
||||||
@@ -24,34 +18,14 @@ pids
|
|||||||
*.seed
|
*.seed
|
||||||
*.pid.lock
|
*.pid.lock
|
||||||
|
|
||||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
|
||||||
lib-cov
|
|
||||||
|
|
||||||
# Coverage directory used by tools like istanbul
|
# Coverage directory used by tools like istanbul
|
||||||
coverage
|
coverage
|
||||||
*.lcov
|
*.lcov
|
||||||
|
|
||||||
# nyc test coverage
|
|
||||||
.nyc_output
|
|
||||||
|
|
||||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
|
||||||
.grunt
|
|
||||||
|
|
||||||
# Bower dependency directory (https://bower.io/)
|
|
||||||
bower_components
|
|
||||||
|
|
||||||
# node-waf configuration
|
|
||||||
.lock-wscript
|
|
||||||
|
|
||||||
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
|
||||||
build/Release
|
|
||||||
|
|
||||||
# Dependency directories
|
# Dependency directories
|
||||||
|
node_modules/
|
||||||
jspm_packages/
|
jspm_packages/
|
||||||
|
|
||||||
# TypeScript v1 declaration files
|
|
||||||
typings/
|
|
||||||
|
|
||||||
# TypeScript cache
|
# TypeScript cache
|
||||||
*.tsbuildinfo
|
*.tsbuildinfo
|
||||||
|
|
||||||
@@ -61,36 +35,19 @@ typings/
|
|||||||
# Optional eslint cache
|
# Optional eslint cache
|
||||||
.eslintcache
|
.eslintcache
|
||||||
|
|
||||||
# Optional REPL history
|
|
||||||
.node_repl_history
|
|
||||||
|
|
||||||
# Output of 'npm pack'
|
|
||||||
*.tgz
|
|
||||||
|
|
||||||
# Yarn Integrity file
|
# Yarn Integrity file
|
||||||
.yarn-integrity
|
.yarn-integrity
|
||||||
|
|
||||||
# dotenv environment variables file
|
# dotenv environment variable files
|
||||||
.env
|
.env
|
||||||
.env.test
|
.env.development.local
|
||||||
|
.env.test.local
|
||||||
|
.env.production.local
|
||||||
|
.env.local
|
||||||
|
|
||||||
# parcel-bundler cache (https://parceljs.org/)
|
# yarn v2
|
||||||
.cache
|
.yarn/cache
|
||||||
|
.yarn/unplugged
|
||||||
# next.js build output
|
.yarn/build-state.yml
|
||||||
.next
|
.yarn/install-state.gz
|
||||||
|
.pnp.*
|
||||||
# nuxt.js build output
|
|
||||||
.nuxt
|
|
||||||
|
|
||||||
# vuepress build output
|
|
||||||
.vuepress/dist
|
|
||||||
|
|
||||||
# Serverless directories
|
|
||||||
.serverless/
|
|
||||||
|
|
||||||
# FuseBox cache
|
|
||||||
.fusebox/
|
|
||||||
|
|
||||||
# DynamoDB Local files
|
|
||||||
.dynamodb/
|
|
||||||
|
6
.prettierignore
Normal file
6
.prettierignore
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# Dependency directories
|
||||||
|
node_modules/
|
||||||
|
jspm_packages/
|
||||||
|
|
||||||
|
# yarn v2
|
||||||
|
.yarn/
|
541
.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
vendored
Normal file
541
.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
vendored
Normal file
File diff suppressed because one or more lines are too long
13
.yarnrc.yml
Normal file
13
.yarnrc.yml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
logFilters:
|
||||||
|
- code: YN0013
|
||||||
|
level: discard
|
||||||
|
- code: YN0019
|
||||||
|
level: discard
|
||||||
|
- code: YN0076
|
||||||
|
level: discard
|
||||||
|
|
||||||
|
nodeLinker: node-modules
|
||||||
|
|
||||||
|
plugins:
|
||||||
|
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
|
||||||
|
spec: "@yarnpkg/plugin-interactive-tools"
|
64
README.md
64
README.md
@@ -47,7 +47,7 @@ ___
|
|||||||
* [`{{date '<format>' tz='<timezone>'}}`](#date-format-tztimezone)
|
* [`{{date '<format>' tz='<timezone>'}}`](#date-format-tztimezone)
|
||||||
* [Major version zero](#major-version-zero)
|
* [Major version zero](#major-version-zero)
|
||||||
* [JSON output object](#json-output-object)
|
* [JSON output object](#json-output-object)
|
||||||
* [Overwrite labels](#overwrite-labels)
|
* [Overwrite labels and annotations](#overwrite-labels-and-annotations)
|
||||||
* [Annotations](#annotations)
|
* [Annotations](#annotations)
|
||||||
* [Contributing](#contributing)
|
* [Contributing](#contributing)
|
||||||
|
|
||||||
@@ -223,7 +223,7 @@ jobs:
|
|||||||
type=sha
|
type=sha
|
||||||
-
|
-
|
||||||
name: Build
|
name: Build
|
||||||
uses: docker/bake-action@v3
|
uses: docker/bake-action@v4
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
./docker-bake.hcl
|
./docker-bake.hcl
|
||||||
@@ -270,7 +270,7 @@ similar to the previous one:
|
|||||||
```yaml
|
```yaml
|
||||||
-
|
-
|
||||||
name: Build
|
name: Build
|
||||||
uses: docker/bake-action@v3
|
uses: docker/bake-action@v4
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
./docker-bake.hcl
|
./docker-bake.hcl
|
||||||
@@ -279,6 +279,23 @@ similar to the previous one:
|
|||||||
targets: build
|
targets: build
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If you're building a [remote Bake definition](https://docs.docker.com/build/bake/remote-definition/)
|
||||||
|
using a [Git context](https://github.com/docker/bake-action?tab=readme-ov-file#git-context),
|
||||||
|
you must specify the location of the metadata-only bake file using a `cwd://`
|
||||||
|
prefix:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
-
|
||||||
|
name: Build
|
||||||
|
uses: docker/bake-action@v4
|
||||||
|
with:
|
||||||
|
source: "${{ github.server_url }}/${{ github.repository }}.git#${{ github.ref }}"
|
||||||
|
files: |
|
||||||
|
./docker-bake.hcl
|
||||||
|
cwd://${{ steps.meta.outputs.bake-file }}
|
||||||
|
targets: build
|
||||||
|
```
|
||||||
|
|
||||||
## Customizing
|
## Customizing
|
||||||
|
|
||||||
### inputs
|
### inputs
|
||||||
@@ -293,16 +310,18 @@ The following inputs can be used as `step.with` keys:
|
|||||||
> org.opencontainers.image.vendor=MyCompany
|
> org.opencontainers.image.vendor=MyCompany
|
||||||
> ```
|
> ```
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
|---------------|--------|-------------------------------------------------------------------------------|
|
|-------------------|--------|------------------------------------------------------------------------------|
|
||||||
| `context` | String | Where to get context data. Allowed options are: `workflow` (default), `git`. |
|
| `context` | String | Where to get context data. Allowed options are: `workflow` (default), `git`. |
|
||||||
| `images` | List | List of Docker images to use as base name for tags |
|
| `images` | List | List of Docker images to use as base name for tags |
|
||||||
| `tags` | List | List of [tags](#tags-input) as key-value pair attributes |
|
| `tags` | List | List of [tags](#tags-input) as key-value pair attributes |
|
||||||
| `flavor` | List | [Flavor](#flavor-input) to apply |
|
| `flavor` | List | [Flavor](#flavor-input) to apply |
|
||||||
| `labels` | List | List of custom labels |
|
| `labels` | List | List of custom labels |
|
||||||
| `sep-tags` | String | Separator to use for tags output (default `\n`) |
|
| `annotations` | List | List of custom anntoations |
|
||||||
| `sep-labels` | String | Separator to use for labels output (default `\n`) |
|
| `sep-tags` | String | Separator to use for tags output (default `\n`) |
|
||||||
| `bake-target` | String | Bake target name (default `docker-metadata-action`) |
|
| `sep-labels` | String | Separator to use for labels output (default `\n`) |
|
||||||
|
| `sep-annotations` | String | Separator to use for annotations output (default `\n`) |
|
||||||
|
| `bake-target` | String | Bake target name (default `docker-metadata-action`) |
|
||||||
|
|
||||||
### outputs
|
### outputs
|
||||||
|
|
||||||
@@ -893,10 +912,11 @@ that you can reuse them further in your workflow using the [`fromJSON` function]
|
|||||||
REVISION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
|
REVISION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.revision'] }}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Overwrite labels
|
### Overwrite labels and annotations
|
||||||
|
|
||||||
If some [OCI Image Format Specification](https://github.com/opencontainers/image-spec/blob/master/annotations.md)
|
If some [OCI Image Format Specification](https://github.com/opencontainers/image-spec/blob/master/annotations.md)
|
||||||
labels generated are not suitable, you can overwrite them like this:
|
generated are not suitable as labels/annotations, you can overwrite them like
|
||||||
|
this:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
-
|
-
|
||||||
@@ -945,7 +965,7 @@ The same can be done with the [`bake-action`](https://github.com/docker/bake-act
|
|||||||
images: name/app
|
images: name/app
|
||||||
-
|
-
|
||||||
name: Build
|
name: Build
|
||||||
uses: docker/bake-action@v3
|
uses: docker/bake-action@v4
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
./docker-bake.hcl
|
./docker-bake.hcl
|
||||||
@@ -954,9 +974,17 @@ The same can be done with the [`bake-action`](https://github.com/docker/bake-act
|
|||||||
targets: build
|
targets: build
|
||||||
```
|
```
|
||||||
|
|
||||||
If you want to set specific level(s) for your annotations, you can use the
|
Note that annotations can be attached at many different levels within a manifest.
|
||||||
|
By default, the generated annotations will be attached to image manifests,
|
||||||
|
but different registries may expect annotations at different places;
|
||||||
|
a common practice is to read annotations at _image indexes_ if present,
|
||||||
|
which are often used by multi-arch builds to index platform-specific images.
|
||||||
|
If you want to specify level(s) for your annotations, you can use the
|
||||||
[`DOCKER_METADATA_ANNOTATIONS_LEVELS` environment variable](#environment-variables)
|
[`DOCKER_METADATA_ANNOTATIONS_LEVELS` environment variable](#environment-variables)
|
||||||
with a comma separated list of levels (defaults to `manifest`):
|
with a comma separated list of all levels the annotations should be attached to (defaults to `manifest`).
|
||||||
|
The following configuration demonstrates the ability to attach annotations to both image manifests and image indexes,
|
||||||
|
though your registry may only need annotations at the index level. (That is, `index` alone may be enough.)
|
||||||
|
Please consult the documentation of your registry.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
-
|
-
|
||||||
|
@@ -39,8 +39,10 @@ describe('getInputs', () => {
|
|||||||
githubToken: '',
|
githubToken: '',
|
||||||
images: ['moby/buildkit', 'ghcr.io/moby/mbuildkit'],
|
images: ['moby/buildkit', 'ghcr.io/moby/mbuildkit'],
|
||||||
labels: [],
|
labels: [],
|
||||||
|
annotations: [],
|
||||||
sepLabels: '\n',
|
sepLabels: '\n',
|
||||||
sepTags: '\n',
|
sepTags: '\n',
|
||||||
|
sepAnnotations: '\n',
|
||||||
tags: [],
|
tags: [],
|
||||||
} as Inputs
|
} as Inputs
|
||||||
],
|
],
|
||||||
@@ -51,6 +53,7 @@ describe('getInputs', () => {
|
|||||||
['images', 'moby/buildkit'],
|
['images', 'moby/buildkit'],
|
||||||
['sep-labels', ','],
|
['sep-labels', ','],
|
||||||
['sep-tags', ','],
|
['sep-tags', ','],
|
||||||
|
['sep-annotations', ',']
|
||||||
]),
|
]),
|
||||||
{
|
{
|
||||||
context: ContextSource.workflow,
|
context: ContextSource.workflow,
|
||||||
@@ -59,8 +62,10 @@ describe('getInputs', () => {
|
|||||||
githubToken: '',
|
githubToken: '',
|
||||||
images: ['moby/buildkit'],
|
images: ['moby/buildkit'],
|
||||||
labels: [],
|
labels: [],
|
||||||
|
annotations: [],
|
||||||
sepLabels: ',',
|
sepLabels: ',',
|
||||||
sepTags: ',',
|
sepTags: ',',
|
||||||
|
sepAnnotations: ',',
|
||||||
tags: [],
|
tags: [],
|
||||||
} as Inputs
|
} as Inputs
|
||||||
],
|
],
|
||||||
@@ -76,8 +81,10 @@ describe('getInputs', () => {
|
|||||||
githubToken: '',
|
githubToken: '',
|
||||||
images: ['moby/buildkit', 'ghcr.io/moby/mbuildkit'],
|
images: ['moby/buildkit', 'ghcr.io/moby/mbuildkit'],
|
||||||
labels: [],
|
labels: [],
|
||||||
|
annotations: [],
|
||||||
sepLabels: '\n',
|
sepLabels: '\n',
|
||||||
sepTags: '\n',
|
sepTags: '\n',
|
||||||
|
sepAnnotations: '\n',
|
||||||
tags: [],
|
tags: [],
|
||||||
} as Inputs
|
} as Inputs
|
||||||
],
|
],
|
||||||
|
@@ -49,7 +49,7 @@ describe('isRawStatement', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
const tagsLabelsTest = async (name: string, envFile: string, inputs: Inputs, exVersion: Version, exTags: Array<string>, exLabels: Array<string>) => {
|
const tagsLabelsTest = async (name: string, envFile: string, inputs: Inputs, exVersion: Version, exTags: Array<string>, exLabels: Array<string>, exAnnotations: Array<string> | undefined) => {
|
||||||
process.env = dotenv.parse(fs.readFileSync(path.join(__dirname, 'fixtures', envFile)));
|
process.env = dotenv.parse(fs.readFileSync(path.join(__dirname, 'fixtures', envFile)));
|
||||||
const toolkit = new Toolkit();
|
const toolkit = new Toolkit();
|
||||||
const repo = await toolkit.github.repoData();
|
const repo = await toolkit.github.repoData();
|
||||||
@@ -63,6 +63,9 @@ const tagsLabelsTest = async (name: string, envFile: string, inputs: Inputs, exV
|
|||||||
|
|
||||||
const labels = meta.getLabels();
|
const labels = meta.getLabels();
|
||||||
expect(labels).toEqual(exLabels);
|
expect(labels).toEqual(exLabels);
|
||||||
|
|
||||||
|
const annotations = meta.getAnnotations();
|
||||||
|
expect(annotations).toEqual(exAnnotations ?? exLabels);
|
||||||
};
|
};
|
||||||
|
|
||||||
describe('null', () => {
|
describe('null', () => {
|
||||||
@@ -90,7 +93,8 @@ describe('null', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version="
|
"org.opencontainers.image.version="
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'null02',
|
'null02',
|
||||||
@@ -117,7 +121,8 @@ describe('null', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version="
|
"org.opencontainers.image.version="
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
])('given %p with %p event', tagsLabelsTest);
|
])('given %p with %p event', tagsLabelsTest);
|
||||||
});
|
});
|
||||||
@@ -149,7 +154,8 @@ describe('push', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=dev"
|
"org.opencontainers.image.version=dev"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'push02',
|
'push02',
|
||||||
@@ -177,7 +183,8 @@ describe('push', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=edge"
|
"org.opencontainers.image.version=edge"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'push03',
|
'push03',
|
||||||
@@ -202,7 +209,8 @@ describe('push', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=master"
|
"org.opencontainers.image.version=master"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'push04',
|
'push04',
|
||||||
@@ -230,7 +238,8 @@ describe('push', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=edge"
|
"org.opencontainers.image.version=edge"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'push05',
|
'push05',
|
||||||
@@ -256,7 +265,8 @@ describe('push', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=dev"
|
"org.opencontainers.image.version=dev"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'push06',
|
'push06',
|
||||||
@@ -285,7 +295,8 @@ describe('push', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=edge"
|
"org.opencontainers.image.version=edge"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'push07',
|
'push07',
|
||||||
@@ -317,7 +328,8 @@ describe('push', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=dev"
|
"org.opencontainers.image.version=dev"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'push08',
|
'push08',
|
||||||
@@ -349,7 +361,8 @@ describe('push', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=edge"
|
"org.opencontainers.image.version=edge"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'push09',
|
'push09',
|
||||||
@@ -381,7 +394,8 @@ describe('push', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=edge"
|
"org.opencontainers.image.version=edge"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'push10',
|
'push10',
|
||||||
@@ -411,7 +425,8 @@ describe('push', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=sha-2665741"
|
"org.opencontainers.image.version=sha-2665741"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'push11',
|
'push11',
|
||||||
@@ -441,7 +456,8 @@ describe('push', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=sha-983315b"
|
"org.opencontainers.image.version=sha-983315b"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'push12',
|
'push12',
|
||||||
@@ -469,7 +485,8 @@ describe('push', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version="
|
"org.opencontainers.image.version="
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'push13',
|
'push13',
|
||||||
@@ -499,7 +516,8 @@ describe('push', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=master"
|
"org.opencontainers.image.version=master"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'push14',
|
'push14',
|
||||||
@@ -531,7 +549,8 @@ describe('push', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=1.2.3"
|
"org.opencontainers.image.version=1.2.3"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'push15',
|
'push15',
|
||||||
@@ -562,7 +581,8 @@ describe('push', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=1.2.3"
|
"org.opencontainers.image.version=1.2.3"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'push16',
|
'push16',
|
||||||
@@ -591,7 +611,8 @@ describe('push', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=edge"
|
"org.opencontainers.image.version=edge"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'push17',
|
'push17',
|
||||||
@@ -635,7 +656,8 @@ describe('push', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=mytag-master"
|
"org.opencontainers.image.version=mytag-master"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'push18',
|
'push18',
|
||||||
@@ -667,7 +689,8 @@ describe('push', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=dev"
|
"org.opencontainers.image.version=dev"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'push19',
|
'push19',
|
||||||
@@ -699,7 +722,8 @@ describe('push', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=sha-860c1904a1ce19322e91ac35af1ab07466440c37"
|
"org.opencontainers.image.version=sha-860c1904a1ce19322e91ac35af1ab07466440c37"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'push20',
|
'push20',
|
||||||
@@ -732,7 +756,8 @@ describe('push', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=sha-860c1904a1ce19322e91ac35af1ab07466440c37"
|
"org.opencontainers.image.version=sha-860c1904a1ce19322e91ac35af1ab07466440c37"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'push21',
|
'push21',
|
||||||
@@ -776,7 +801,8 @@ describe('push', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=mytag-master"
|
"org.opencontainers.image.version=mytag-master"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
]
|
]
|
||||||
])('given %p with %p event', tagsLabelsTest);
|
])('given %p with %p event', tagsLabelsTest);
|
||||||
});
|
});
|
||||||
@@ -809,7 +835,8 @@ describe('tag', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=release1"
|
"org.opencontainers.image.version=release1"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'tag02',
|
'tag02',
|
||||||
@@ -835,7 +862,8 @@ describe('tag', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=20200110-RC2"
|
"org.opencontainers.image.version=20200110-RC2"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'tag03',
|
'tag03',
|
||||||
@@ -866,7 +894,8 @@ describe('tag', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=20200110"
|
"org.opencontainers.image.version=20200110"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'tag04',
|
'tag04',
|
||||||
@@ -897,7 +926,8 @@ describe('tag', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=20200110"
|
"org.opencontainers.image.version=20200110"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'tag05',
|
'tag05',
|
||||||
@@ -928,7 +958,8 @@ describe('tag', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=1.1.1"
|
"org.opencontainers.image.version=1.1.1"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'tag06',
|
'tag06',
|
||||||
@@ -959,7 +990,8 @@ describe('tag', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=1.1.1"
|
"org.opencontainers.image.version=1.1.1"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'tag07',
|
'tag07',
|
||||||
@@ -990,7 +1022,8 @@ describe('tag', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=2.0.8-beta.67"
|
"org.opencontainers.image.version=2.0.8-beta.67"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'tag08',
|
'tag08',
|
||||||
@@ -1021,7 +1054,8 @@ describe('tag', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=2.0"
|
"org.opencontainers.image.version=2.0"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'tag09',
|
'tag09',
|
||||||
@@ -1055,7 +1089,8 @@ describe('tag', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=2.0.8"
|
"org.opencontainers.image.version=2.0.8"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'tag10',
|
'tag10',
|
||||||
@@ -1081,7 +1116,8 @@ describe('tag', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version="
|
"org.opencontainers.image.version="
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'tag11',
|
'tag11',
|
||||||
@@ -1118,7 +1154,8 @@ describe('tag', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=1.1.1"
|
"org.opencontainers.image.version=1.1.1"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'tag12',
|
'tag12',
|
||||||
@@ -1150,7 +1187,8 @@ describe('tag', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=1.1.1"
|
"org.opencontainers.image.version=1.1.1"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'tag13',
|
'tag13',
|
||||||
@@ -1180,7 +1218,8 @@ describe('tag', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=2.0.8-beta.67"
|
"org.opencontainers.image.version=2.0.8-beta.67"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'tag14',
|
'tag14',
|
||||||
@@ -1214,7 +1253,8 @@ describe('tag', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=sometag"
|
"org.opencontainers.image.version=sometag"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'tag15',
|
'tag15',
|
||||||
@@ -1249,7 +1289,8 @@ describe('tag', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=foo"
|
"org.opencontainers.image.version=foo"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'tag16',
|
'tag16',
|
||||||
@@ -1282,7 +1323,8 @@ describe('tag', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=foo"
|
"org.opencontainers.image.version=foo"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'tag17',
|
'tag17',
|
||||||
@@ -1321,7 +1363,8 @@ describe('tag', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=1.0.0"
|
"org.opencontainers.image.version=1.0.0"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'tag18',
|
'tag18',
|
||||||
@@ -1360,7 +1403,8 @@ describe('tag', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=1.0.0"
|
"org.opencontainers.image.version=1.0.0"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'tag19',
|
'tag19',
|
||||||
@@ -1401,7 +1445,8 @@ describe('tag', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=1.0.0-dev"
|
"org.opencontainers.image.version=1.0.0-dev"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'tag20',
|
'tag20',
|
||||||
@@ -1436,7 +1481,8 @@ describe('tag', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=v1.1.1-860c190-foo"
|
"org.opencontainers.image.version=v1.1.1-860c190-foo"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'tag21',
|
'tag21',
|
||||||
@@ -1471,7 +1517,8 @@ describe('tag', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=1.1.1-dev"
|
"org.opencontainers.image.version=1.1.1-dev"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'tag22',
|
'tag22',
|
||||||
@@ -1507,7 +1554,8 @@ describe('tag', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=foo-1.1.1-dev"
|
"org.opencontainers.image.version=foo-1.1.1-dev"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'tag23',
|
'tag23',
|
||||||
@@ -1538,7 +1586,8 @@ describe('tag', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=v1.1.1"
|
"org.opencontainers.image.version=v1.1.1"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'tag24',
|
'tag24',
|
||||||
@@ -1568,7 +1617,8 @@ describe('tag', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=1.2"
|
"org.opencontainers.image.version=1.2"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'tag25',
|
'tag25',
|
||||||
@@ -1598,7 +1648,8 @@ describe('tag', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=1.1b2"
|
"org.opencontainers.image.version=1.1b2"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'tag26',
|
'tag26',
|
||||||
@@ -1628,7 +1679,8 @@ describe('tag', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=1.0.dev4"
|
"org.opencontainers.image.version=1.0.dev4"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'tag27',
|
'tag27',
|
||||||
@@ -1660,7 +1712,8 @@ describe('tag', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=1.2.3rc2"
|
"org.opencontainers.image.version=1.2.3rc2"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'tag28',
|
'tag28',
|
||||||
@@ -1697,7 +1750,8 @@ describe('tag', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=1.1.1"
|
"org.opencontainers.image.version=1.1.1"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'tag29',
|
'tag29',
|
||||||
@@ -1727,7 +1781,8 @@ describe('tag', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=1.2.post1"
|
"org.opencontainers.image.version=1.2.post1"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'tag30',
|
'tag30',
|
||||||
@@ -1761,7 +1816,8 @@ describe('tag', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=sometag"
|
"org.opencontainers.image.version=sometag"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'tag31',
|
'tag31',
|
||||||
@@ -1790,7 +1846,8 @@ describe('tag', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=v2.0.8-beta.67"
|
"org.opencontainers.image.version=v2.0.8-beta.67"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'tag32',
|
'tag32',
|
||||||
@@ -1822,7 +1879,8 @@ describe('tag', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=v1.2.3rc2"
|
"org.opencontainers.image.version=v1.2.3rc2"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'tag33',
|
'tag33',
|
||||||
@@ -1859,7 +1917,8 @@ describe('tag', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=1.1.1"
|
"org.opencontainers.image.version=1.1.1"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
]
|
]
|
||||||
])('given %p with %p event', tagsLabelsTest);
|
])('given %p with %p event', tagsLabelsTest);
|
||||||
});
|
});
|
||||||
@@ -1895,7 +1954,8 @@ describe('latest', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=release1"
|
"org.opencontainers.image.version=release1"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'latest02',
|
'latest02',
|
||||||
@@ -1924,7 +1984,8 @@ describe('latest', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=20200110-RC2"
|
"org.opencontainers.image.version=20200110-RC2"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'latest03',
|
'latest03',
|
||||||
@@ -1953,7 +2014,8 @@ describe('latest', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=20200110"
|
"org.opencontainers.image.version=20200110"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'latest04',
|
'latest04',
|
||||||
@@ -1982,7 +2044,8 @@ describe('latest', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=1.1.1"
|
"org.opencontainers.image.version=1.1.1"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'latest05',
|
'latest05',
|
||||||
@@ -2010,7 +2073,8 @@ describe('latest', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=v1.1.1"
|
"org.opencontainers.image.version=v1.1.1"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'latest06',
|
'latest06',
|
||||||
@@ -2041,7 +2105,8 @@ describe('latest', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=2.0.8"
|
"org.opencontainers.image.version=2.0.8"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'latest07',
|
'latest07',
|
||||||
@@ -2073,7 +2138,8 @@ describe('latest', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=v1.1.1"
|
"org.opencontainers.image.version=v1.1.1"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'latest08',
|
'latest08',
|
||||||
@@ -2105,7 +2171,8 @@ describe('latest', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=v1.1.1"
|
"org.opencontainers.image.version=v1.1.1"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'latest09',
|
'latest09',
|
||||||
@@ -2123,6 +2190,12 @@ describe('latest', () => {
|
|||||||
`org.opencontainers.image.description=this is a "good" example`,
|
`org.opencontainers.image.description=this is a "good" example`,
|
||||||
"org.opencontainers.image.title=MyCustomTitle",
|
"org.opencontainers.image.title=MyCustomTitle",
|
||||||
"org.opencontainers.image.vendor=MyCompany",
|
"org.opencontainers.image.vendor=MyCompany",
|
||||||
|
],
|
||||||
|
annotations: [
|
||||||
|
"maintainer=Foo",
|
||||||
|
`org.opencontainers.image.description=this is a "bad" example`,
|
||||||
|
"org.opencontainers.image.title=MyNotTitle",
|
||||||
|
"org.opencontainers.image.vendor=MyNotCompany",
|
||||||
]
|
]
|
||||||
} as Inputs,
|
} as Inputs,
|
||||||
{
|
{
|
||||||
@@ -2145,6 +2218,18 @@ describe('latest', () => {
|
|||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.vendor=MyCompany",
|
"org.opencontainers.image.vendor=MyCompany",
|
||||||
"org.opencontainers.image.version=v1.1.1"
|
"org.opencontainers.image.version=v1.1.1"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"maintainer=Foo",
|
||||||
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
||||||
|
`org.opencontainers.image.description=this is a "bad" example`,
|
||||||
|
"org.opencontainers.image.licenses=MIT",
|
||||||
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
||||||
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
||||||
|
"org.opencontainers.image.title=MyNotTitle",
|
||||||
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
|
"org.opencontainers.image.vendor=MyNotCompany",
|
||||||
|
"org.opencontainers.image.version=v1.1.1"
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@@ -2174,7 +2259,8 @@ describe('latest', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=2.0.8"
|
"org.opencontainers.image.version=2.0.8"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
]
|
]
|
||||||
])('given %p with %p event', tagsLabelsTest);
|
])('given %p with %p event', tagsLabelsTest);
|
||||||
});
|
});
|
||||||
@@ -2206,7 +2292,8 @@ describe('pr', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=pr-15"
|
"org.opencontainers.image.version=pr-15"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'pr02',
|
'pr02',
|
||||||
@@ -2232,7 +2319,8 @@ describe('pr', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=pr-15"
|
"org.opencontainers.image.version=pr-15"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'pr03',
|
'pr03',
|
||||||
@@ -2264,7 +2352,8 @@ describe('pr', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=pr-15"
|
"org.opencontainers.image.version=pr-15"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'pr04',
|
'pr04',
|
||||||
@@ -2296,7 +2385,8 @@ describe('pr', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=sha-a9c8c58"
|
"org.opencontainers.image.version=sha-a9c8c58"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'pr05',
|
'pr05',
|
||||||
@@ -2329,7 +2419,8 @@ describe('pr', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=pr-15-bal"
|
"org.opencontainers.image.version=pr-15-bal"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'pr06',
|
'pr06',
|
||||||
@@ -2362,7 +2453,8 @@ describe('pr', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=15-bal"
|
"org.opencontainers.image.version=15-bal"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'pr07',
|
'pr07',
|
||||||
@@ -2394,7 +2486,8 @@ describe('pr', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=sha-2665741"
|
"org.opencontainers.image.version=sha-2665741"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'pr08',
|
'pr08',
|
||||||
@@ -2427,7 +2520,8 @@ describe('pr', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=15-bal"
|
"org.opencontainers.image.version=15-bal"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'pr09',
|
'pr09',
|
||||||
@@ -2464,7 +2558,8 @@ describe('pr', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=pr-15"
|
"org.opencontainers.image.version=pr-15"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'pr10',
|
'pr10',
|
||||||
@@ -2493,7 +2588,8 @@ describe('pr', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=mytag-master"
|
"org.opencontainers.image.version=mytag-master"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'pr11',
|
'pr11',
|
||||||
@@ -2522,7 +2618,8 @@ describe('pr', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=mytag-master"
|
"org.opencontainers.image.version=mytag-master"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
])('given %p with %p event', tagsLabelsTest);
|
])('given %p with %p event', tagsLabelsTest);
|
||||||
});
|
});
|
||||||
@@ -2872,7 +2969,7 @@ describe('pr-head-sha', () => {
|
|||||||
"org.opencontainers.image.version=mytag-master"
|
"org.opencontainers.image.version=mytag-master"
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
])('given %p with %p event', async (name: string, envFile: string, inputs: Inputs, exVersion: Version, exTags: Array<string>, exLabels: Array<string>) => {
|
])('given %p with %p event', async (name: string, envFile: string, inputs: Inputs, exVersion: Version, exTags: Array<string>, exLabelsAnnotations: Array<string>) => {
|
||||||
process.env = dotenv.parse(fs.readFileSync(path.join(__dirname, 'fixtures', envFile)));
|
process.env = dotenv.parse(fs.readFileSync(path.join(__dirname, 'fixtures', envFile)));
|
||||||
process.env.DOCKER_METADATA_PR_HEAD_SHA = 'true';
|
process.env.DOCKER_METADATA_PR_HEAD_SHA = 'true';
|
||||||
|
|
||||||
@@ -2887,7 +2984,10 @@ describe('pr-head-sha', () => {
|
|||||||
expect(tags).toEqual(exTags);
|
expect(tags).toEqual(exTags);
|
||||||
|
|
||||||
const labels = meta.getLabels();
|
const labels = meta.getLabels();
|
||||||
expect(labels).toEqual(exLabels);
|
expect(labels).toEqual(exLabelsAnnotations);
|
||||||
|
|
||||||
|
const annotations = meta.getAnnotations();
|
||||||
|
expect(annotations).toEqual(exLabelsAnnotations);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -2919,7 +3019,8 @@ describe('schedule', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=nightly"
|
"org.opencontainers.image.version=nightly"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'schedule02',
|
'schedule02',
|
||||||
@@ -2947,7 +3048,8 @@ describe('schedule', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=20200110"
|
"org.opencontainers.image.version=20200110"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'schedule03',
|
'schedule03',
|
||||||
@@ -2975,7 +3077,8 @@ describe('schedule', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=20200110-003000"
|
"org.opencontainers.image.version=20200110-003000"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'schedule04',
|
'schedule04',
|
||||||
@@ -3003,7 +3106,8 @@ describe('schedule', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=nightly"
|
"org.opencontainers.image.version=nightly"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'schedule05',
|
'schedule05',
|
||||||
@@ -3035,7 +3139,8 @@ describe('schedule', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=nightly"
|
"org.opencontainers.image.version=nightly"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'schedule06',
|
'schedule06',
|
||||||
@@ -3073,7 +3178,8 @@ describe('schedule', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=sha-860c190"
|
"org.opencontainers.image.version=sha-860c190"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'schedule07',
|
'schedule07',
|
||||||
@@ -3106,7 +3212,8 @@ describe('schedule', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=glo-nightly-bal"
|
"org.opencontainers.image.version=glo-nightly-bal"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'schedule08',
|
'schedule08',
|
||||||
@@ -3134,7 +3241,8 @@ describe('schedule', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=20200110-093000"
|
"org.opencontainers.image.version=20200110-093000"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
])('given %p with %p event', tagsLabelsTest);
|
])('given %p with %p event', tagsLabelsTest);
|
||||||
});
|
});
|
||||||
@@ -3167,7 +3275,8 @@ describe('release', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=v1.1.1"
|
"org.opencontainers.image.version=v1.1.1"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'release02',
|
'release02',
|
||||||
@@ -3201,7 +3310,8 @@ describe('release', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=v1.1.1"
|
"org.opencontainers.image.version=v1.1.1"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
]
|
]
|
||||||
])('given %s with %p event', tagsLabelsTest);
|
])('given %s with %p event', tagsLabelsTest);
|
||||||
});
|
});
|
||||||
@@ -3242,7 +3352,8 @@ describe('raw', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=dev"
|
"org.opencontainers.image.version=dev"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'raw02',
|
'raw02',
|
||||||
@@ -3272,7 +3383,8 @@ describe('raw', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=dev"
|
"org.opencontainers.image.version=dev"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'raw03',
|
'raw03',
|
||||||
@@ -3307,7 +3419,8 @@ describe('raw', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=release1"
|
"org.opencontainers.image.version=release1"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'raw04',
|
'raw04',
|
||||||
@@ -3344,7 +3457,8 @@ describe('raw', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=20200110"
|
"org.opencontainers.image.version=20200110"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'raw05',
|
'raw05',
|
||||||
@@ -3390,7 +3504,8 @@ describe('raw', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=1.1.1"
|
"org.opencontainers.image.version=1.1.1"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'raw06',
|
'raw06',
|
||||||
@@ -3425,7 +3540,8 @@ describe('raw', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=my"
|
"org.opencontainers.image.version=my"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'raw07',
|
'raw07',
|
||||||
@@ -3463,7 +3579,8 @@ describe('raw', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=my"
|
"org.opencontainers.image.version=my"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'raw08',
|
'raw08',
|
||||||
@@ -3499,7 +3616,8 @@ describe('raw', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=my"
|
"org.opencontainers.image.version=my"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'raw09',
|
'raw09',
|
||||||
@@ -3537,7 +3655,8 @@ describe('raw', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=foo-my-bar"
|
"org.opencontainers.image.version=foo-my-bar"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'raw10',
|
'raw10',
|
||||||
@@ -3571,7 +3690,8 @@ describe('raw', () => {
|
|||||||
"org.opencontainers.image.title=Hello-World",
|
"org.opencontainers.image.title=Hello-World",
|
||||||
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"org.opencontainers.image.version=foo"
|
"org.opencontainers.image.version=foo"
|
||||||
]
|
],
|
||||||
|
undefined
|
||||||
],
|
],
|
||||||
])('given %p wth %p event', tagsLabelsTest);
|
])('given %p wth %p event', tagsLabelsTest);
|
||||||
});
|
});
|
||||||
@@ -3615,7 +3735,6 @@ describe('json', () => {
|
|||||||
"org.opencontainers.image.version": "dev"
|
"org.opencontainers.image.version": "dev"
|
||||||
},
|
},
|
||||||
"annotations": [
|
"annotations": [
|
||||||
"manifest:foo=",
|
|
||||||
"manifest:org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
"manifest:org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
||||||
"manifest:org.opencontainers.image.description=This your first repo!",
|
"manifest:org.opencontainers.image.description=This your first repo!",
|
||||||
"manifest:org.opencontainers.image.licenses=MIT",
|
"manifest:org.opencontainers.image.licenses=MIT",
|
||||||
@@ -3877,15 +3996,13 @@ describe('json', () => {
|
|||||||
"org.opencontainers.image.version": "v1.1.1"
|
"org.opencontainers.image.version": "v1.1.1"
|
||||||
},
|
},
|
||||||
"annotations": [
|
"annotations": [
|
||||||
"manifest:maintainer=CrazyMax",
|
|
||||||
"manifest:org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
"manifest:org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
||||||
"manifest:org.opencontainers.image.description=Another description",
|
"manifest:org.opencontainers.image.description=This your first repo!",
|
||||||
"manifest:org.opencontainers.image.licenses=MIT",
|
"manifest:org.opencontainers.image.licenses=MIT",
|
||||||
"manifest:org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
"manifest:org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
||||||
"manifest:org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
"manifest:org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
||||||
"manifest:org.opencontainers.image.title=MyCustom=Title",
|
"manifest:org.opencontainers.image.title=Hello-World",
|
||||||
"manifest:org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"manifest:org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"manifest:org.opencontainers.image.vendor=MyCompany",
|
|
||||||
"manifest:org.opencontainers.image.version=v1.1.1"
|
"manifest:org.opencontainers.image.version=v1.1.1"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -4385,25 +4502,21 @@ describe('bakeFile', () => {
|
|||||||
"target": {
|
"target": {
|
||||||
"docker-metadata-action": {
|
"docker-metadata-action": {
|
||||||
"annotations": [
|
"annotations": [
|
||||||
"index:maintainer=CrazyMax",
|
|
||||||
"index:org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
"index:org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
||||||
"index:org.opencontainers.image.description=Another description",
|
"index:org.opencontainers.image.description=This your first repo!",
|
||||||
"index:org.opencontainers.image.licenses=MIT",
|
"index:org.opencontainers.image.licenses=MIT",
|
||||||
"index:org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
"index:org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
||||||
"index:org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
"index:org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
||||||
"index:org.opencontainers.image.title=MyCustom=Title",
|
"index:org.opencontainers.image.title=Hello-World",
|
||||||
"index:org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"index:org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"index:org.opencontainers.image.vendor=MyCompany",
|
|
||||||
"index:org.opencontainers.image.version=v1.1.1",
|
"index:org.opencontainers.image.version=v1.1.1",
|
||||||
"manifest-descriptor:maintainer=CrazyMax",
|
|
||||||
"manifest-descriptor:org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
"manifest-descriptor:org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
||||||
"manifest-descriptor:org.opencontainers.image.description=Another description",
|
"manifest-descriptor:org.opencontainers.image.description=This your first repo!",
|
||||||
"manifest-descriptor:org.opencontainers.image.licenses=MIT",
|
"manifest-descriptor:org.opencontainers.image.licenses=MIT",
|
||||||
"manifest-descriptor:org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
"manifest-descriptor:org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
||||||
"manifest-descriptor:org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
"manifest-descriptor:org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
||||||
"manifest-descriptor:org.opencontainers.image.title=MyCustom=Title",
|
"manifest-descriptor:org.opencontainers.image.title=Hello-World",
|
||||||
"manifest-descriptor:org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
"manifest-descriptor:org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
||||||
"manifest-descriptor:org.opencontainers.image.vendor=MyCompany",
|
|
||||||
"manifest-descriptor:org.opencontainers.image.version=v1.1.1"
|
"manifest-descriptor:org.opencontainers.image.version=v1.1.1"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@@ -23,12 +23,18 @@ inputs:
|
|||||||
labels:
|
labels:
|
||||||
description: 'List of custom labels'
|
description: 'List of custom labels'
|
||||||
required: false
|
required: false
|
||||||
|
annotations:
|
||||||
|
description: 'List of custom annotations'
|
||||||
|
required: false
|
||||||
sep-tags:
|
sep-tags:
|
||||||
description: 'Separator to use for tags output (default \n)'
|
description: 'Separator to use for tags output (default \n)'
|
||||||
required: false
|
required: false
|
||||||
sep-labels:
|
sep-labels:
|
||||||
description: 'Separator to use for labels output (default \n)'
|
description: 'Separator to use for labels output (default \n)'
|
||||||
required: false
|
required: false
|
||||||
|
sep-annotations:
|
||||||
|
description: 'Separator to use for annotations output (default \n)'
|
||||||
|
required: false
|
||||||
bake-target:
|
bake-target:
|
||||||
description: 'Bake target name (default docker-metadata-action)'
|
description: 'Bake target name (default docker-metadata-action)'
|
||||||
required: false
|
required: false
|
||||||
|
@@ -5,9 +5,16 @@ ARG NODE_VERSION=20
|
|||||||
FROM node:${NODE_VERSION}-alpine AS base
|
FROM node:${NODE_VERSION}-alpine AS base
|
||||||
RUN apk add --no-cache cpio findutils git
|
RUN apk add --no-cache cpio findutils git
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
RUN --mount=type=bind,target=.,rw \
|
||||||
|
--mount=type=cache,target=/src/.yarn/cache <<EOT
|
||||||
|
corepack enable
|
||||||
|
yarn --version
|
||||||
|
yarn config set --home enableTelemetry 0
|
||||||
|
EOT
|
||||||
|
|
||||||
FROM base AS deps
|
FROM base AS deps
|
||||||
RUN --mount=type=bind,target=.,rw \
|
RUN --mount=type=bind,target=.,rw \
|
||||||
|
--mount=type=cache,target=/src/.yarn/cache \
|
||||||
--mount=type=cache,target=/src/node_modules \
|
--mount=type=cache,target=/src/node_modules \
|
||||||
yarn install && mkdir /vendor && cp yarn.lock /vendor
|
yarn install && mkdir /vendor && cp yarn.lock /vendor
|
||||||
|
|
||||||
@@ -20,7 +27,7 @@ RUN --mount=type=bind,target=.,rw <<EOT
|
|||||||
git add -A
|
git add -A
|
||||||
cp -rf /vendor/* .
|
cp -rf /vendor/* .
|
||||||
if [ -n "$(git status --porcelain -- yarn.lock)" ]; then
|
if [ -n "$(git status --porcelain -- yarn.lock)" ]; then
|
||||||
echo >&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake vendor-update"'
|
echo >&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake vendor"'
|
||||||
git status --porcelain -- yarn.lock
|
git status --porcelain -- yarn.lock
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -28,6 +35,7 @@ EOT
|
|||||||
|
|
||||||
FROM deps AS build
|
FROM deps AS build
|
||||||
RUN --mount=type=bind,target=.,rw \
|
RUN --mount=type=bind,target=.,rw \
|
||||||
|
--mount=type=cache,target=/src/.yarn/cache \
|
||||||
--mount=type=cache,target=/src/node_modules \
|
--mount=type=cache,target=/src/node_modules \
|
||||||
yarn run build && mkdir /out && cp -Rf dist /out/
|
yarn run build && mkdir /out && cp -Rf dist /out/
|
||||||
|
|
||||||
@@ -48,22 +56,23 @@ EOT
|
|||||||
|
|
||||||
FROM deps AS format
|
FROM deps AS format
|
||||||
RUN --mount=type=bind,target=.,rw \
|
RUN --mount=type=bind,target=.,rw \
|
||||||
|
--mount=type=cache,target=/src/.yarn/cache \
|
||||||
--mount=type=cache,target=/src/node_modules \
|
--mount=type=cache,target=/src/node_modules \
|
||||||
yarn run format \
|
yarn run format \
|
||||||
&& mkdir /out && find . -name '*.ts' -not -path './node_modules/*' | cpio -pdm /out
|
&& mkdir /out && find . -name '*.ts' -not -path './node_modules/*' -not -path './.yarn/*' | cpio -pdm /out
|
||||||
|
|
||||||
FROM scratch AS format-update
|
FROM scratch AS format-update
|
||||||
COPY --from=format /out /
|
COPY --from=format /out /
|
||||||
|
|
||||||
FROM deps AS lint
|
FROM deps AS lint
|
||||||
RUN --mount=type=bind,target=.,rw \
|
RUN --mount=type=bind,target=.,rw \
|
||||||
|
--mount=type=cache,target=/src/.yarn/cache \
|
||||||
--mount=type=cache,target=/src/node_modules \
|
--mount=type=cache,target=/src/node_modules \
|
||||||
yarn run lint
|
yarn run lint
|
||||||
|
|
||||||
FROM deps AS test
|
FROM deps AS test
|
||||||
ENV RUNNER_TEMP=/tmp/github_runner
|
|
||||||
ENV RUNNER_TOOL_CACHE=/tmp/github_tool_cache
|
|
||||||
RUN --mount=type=bind,target=.,rw \
|
RUN --mount=type=bind,target=.,rw \
|
||||||
|
--mount=type=cache,target=/src/.yarn/cache \
|
||||||
--mount=type=cache,target=/src/node_modules \
|
--mount=type=cache,target=/src/node_modules \
|
||||||
yarn run test --coverage --coverageDirectory=/tmp/coverage
|
yarn run test --coverage --coverageDirectory=/tmp/coverage
|
||||||
|
|
||||||
|
113
dist/index.js
generated
vendored
113
dist/index.js
generated
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
2090
dist/licenses.txt
generated
vendored
2090
dist/licenses.txt
generated
vendored
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@ group "default" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group "pre-checkin" {
|
group "pre-checkin" {
|
||||||
targets = ["vendor-update", "format", "build"]
|
targets = ["vendor", "format", "build"]
|
||||||
}
|
}
|
||||||
|
|
||||||
group "validate" {
|
group "validate" {
|
||||||
@@ -34,7 +34,7 @@ target "lint" {
|
|||||||
output = ["type=cacheonly"]
|
output = ["type=cacheonly"]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "vendor-update" {
|
target "vendor" {
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "vendor-update"
|
target = "vendor-update"
|
||||||
output = ["."]
|
output = ["."]
|
||||||
|
48
package.json
48
package.json
@@ -1,17 +1,16 @@
|
|||||||
{
|
{
|
||||||
"name": "docker-metadata-action",
|
"name": "docker-metadata-action",
|
||||||
"description": "GitHub Action to extract metadata (tags, labels) for Docker",
|
"description": "GitHub Action to extract metadata (tags, labels) for Docker",
|
||||||
"main": "lib/main.js",
|
"main": "src/main.ts",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "ncc build src/main.ts --source-map --minify --license licenses.txt",
|
"build": "ncc build --source-map --minify --license licenses.txt",
|
||||||
"lint": "yarn run prettier && yarn run eslint",
|
"lint": "yarn run prettier && yarn run eslint",
|
||||||
"format": "yarn run prettier:fix && yarn run eslint:fix",
|
"format": "yarn run prettier:fix && yarn run eslint:fix",
|
||||||
"eslint": "eslint --max-warnings=0 .",
|
"eslint": "eslint --max-warnings=0 .",
|
||||||
"eslint:fix": "eslint --fix .",
|
"eslint:fix": "eslint --fix .",
|
||||||
"prettier": "prettier --check \"./**/*.ts\"",
|
"prettier": "prettier --check \"./**/*.ts\"",
|
||||||
"prettier:fix": "prettier --write \"./**/*.ts\"",
|
"prettier:fix": "prettier --write \"./**/*.ts\"",
|
||||||
"test": "jest",
|
"test": "jest"
|
||||||
"all": "yarn run build && yarn run format && yarn test"
|
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -26,33 +25,34 @@
|
|||||||
],
|
],
|
||||||
"author": "Docker Inc.",
|
"author": "Docker Inc.",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
"packageManager": "yarn@3.6.3",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.10.1",
|
"@actions/core": "^1.10.1",
|
||||||
"@actions/github": "^6.0.0",
|
"@actions/github": "^6.0.0",
|
||||||
"@docker/actions-toolkit": "^0.14.0",
|
"@docker/actions-toolkit": "^0.35.0",
|
||||||
"@renovate/pep440": "^1.0.0",
|
"@renovate/pep440": "^1.0.0",
|
||||||
"csv-parse": "^5.5.2",
|
"csv-parse": "^5.5.6",
|
||||||
"handlebars": "^4.7.8",
|
"handlebars": "^4.7.8",
|
||||||
"moment": "^2.29.4",
|
"moment": "^2.30.1",
|
||||||
"moment-timezone": "^0.5.43",
|
"moment-timezone": "^0.5.45",
|
||||||
"semver": "^7.5.4"
|
"semver": "^7.6.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/csv-parse": "^1.2.2",
|
"@types/csv-parse": "^1.2.2",
|
||||||
"@types/node": "^20.5.9",
|
"@types/node": "^20.12.12",
|
||||||
"@types/semver": "^7.5.1",
|
"@types/semver": "^7.5.8",
|
||||||
"@typescript-eslint/eslint-plugin": "^6.6.0",
|
"@typescript-eslint/eslint-plugin": "^7.9.0",
|
||||||
"@typescript-eslint/parser": "^6.6.0",
|
"@typescript-eslint/parser": "^7.9.0",
|
||||||
"@vercel/ncc": "^0.38.0",
|
"@vercel/ncc": "^0.38.1",
|
||||||
"dotenv": "^16.3.1",
|
"dotenv": "^16.4.5",
|
||||||
"eslint": "^8.48.0",
|
"eslint": "^8.57.0",
|
||||||
"eslint-config-prettier": "^9.0.0",
|
"eslint-config-prettier": "^9.1.0",
|
||||||
"eslint-plugin-jest": "^27.2.3",
|
"eslint-plugin-jest": "^28.5.0",
|
||||||
"eslint-plugin-prettier": "^5.0.0",
|
"eslint-plugin-prettier": "^5.1.3",
|
||||||
"jest": "^29.6.4",
|
"jest": "^29.7.0",
|
||||||
"prettier": "^3.0.3",
|
"prettier": "^3.2.5",
|
||||||
"ts-jest": "^29.1.1",
|
"ts-jest": "^29.1.2",
|
||||||
"ts-node": "^10.9.1",
|
"ts-node": "^10.9.2",
|
||||||
"typescript": "^5.2.2"
|
"typescript": "^5.4.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -10,8 +10,10 @@ export interface Inputs {
|
|||||||
tags: string[];
|
tags: string[];
|
||||||
flavor: string[];
|
flavor: string[];
|
||||||
labels: string[];
|
labels: string[];
|
||||||
|
annotations: string[];
|
||||||
sepTags: string;
|
sepTags: string;
|
||||||
sepLabels: string;
|
sepLabels: string;
|
||||||
|
sepAnnotations: string;
|
||||||
bakeTarget: string;
|
bakeTarget: string;
|
||||||
githubToken: string;
|
githubToken: string;
|
||||||
}
|
}
|
||||||
@@ -23,8 +25,10 @@ export function getInputs(): Inputs {
|
|||||||
tags: Util.getInputList('tags', {ignoreComma: true, comment: '#'}),
|
tags: Util.getInputList('tags', {ignoreComma: true, comment: '#'}),
|
||||||
flavor: Util.getInputList('flavor', {ignoreComma: true, comment: '#'}),
|
flavor: Util.getInputList('flavor', {ignoreComma: true, comment: '#'}),
|
||||||
labels: Util.getInputList('labels', {ignoreComma: true, comment: '#'}),
|
labels: Util.getInputList('labels', {ignoreComma: true, comment: '#'}),
|
||||||
|
annotations: Util.getInputList('annotations', {ignoreComma: true, comment: '#'}),
|
||||||
sepTags: core.getInput('sep-tags', {trimWhitespace: false}) || `\n`,
|
sepTags: core.getInput('sep-tags', {trimWhitespace: false}) || `\n`,
|
||||||
sepLabels: core.getInput('sep-labels', {trimWhitespace: false}) || `\n`,
|
sepLabels: core.getInput('sep-labels', {trimWhitespace: false}) || `\n`,
|
||||||
|
sepAnnotations: core.getInput('sep-annotations', {trimWhitespace: false}) || `\n`,
|
||||||
bakeTarget: core.getInput('bake-target') || `docker-metadata-action`,
|
bakeTarget: core.getInput('bake-target') || `docker-metadata-action`,
|
||||||
githubToken: core.getInput('github-token')
|
githubToken: core.getInput('github-token')
|
||||||
};
|
};
|
||||||
|
47
src/main.ts
47
src/main.ts
@@ -6,11 +6,6 @@ import {Toolkit} from '@docker/actions-toolkit/lib/toolkit';
|
|||||||
import {getContext, getInputs, Inputs} from './context';
|
import {getContext, getInputs, Inputs} from './context';
|
||||||
import {Meta, Version} from './meta';
|
import {Meta, Version} from './meta';
|
||||||
|
|
||||||
function setOutput(name: string, value: string) {
|
|
||||||
core.setOutput(name, value);
|
|
||||||
core.exportVariable(`DOCKER_METADATA_OUTPUT_${name.replace(/\W/g, '_').toUpperCase()}`, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
actionsToolkit.run(
|
actionsToolkit.run(
|
||||||
// main
|
// main
|
||||||
async () => {
|
async () => {
|
||||||
@@ -71,32 +66,31 @@ actionsToolkit.run(
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Annotations
|
// Annotations
|
||||||
const alevels = process.env.DOCKER_METADATA_ANNOTATIONS_LEVELS || 'manifest';
|
const annotationsRaw: Array<string> = meta.getAnnotations();
|
||||||
if (labels.length > 0) {
|
const annotationsLevels = process.env.DOCKER_METADATA_ANNOTATIONS_LEVELS || 'manifest';
|
||||||
await core.group(`Annotations`, async () => {
|
await core.group(`Annotations`, async () => {
|
||||||
const annotations: Array<string> = [];
|
const annotations: Array<string> = [];
|
||||||
for (const level of alevels.split(',')) {
|
for (const level of annotationsLevels.split(',')) {
|
||||||
annotations.push(
|
annotations.push(
|
||||||
...labels.map(label => {
|
...annotationsRaw.map(label => {
|
||||||
const v = `${level}:${label}`;
|
const v = `${level}:${label}`;
|
||||||
core.info(v);
|
core.info(v);
|
||||||
return v;
|
return v;
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
setOutput(`annotations`, annotations.join(inputs.sepLabels));
|
setOutput(`annotations`, annotations.join(inputs.sepAnnotations));
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
// JSON
|
// JSON
|
||||||
const jsonOutput = meta.getJSON(alevels.split(','));
|
const jsonOutput = meta.getJSON(annotationsLevels.split(','));
|
||||||
await core.group(`JSON output`, async () => {
|
await core.group(`JSON output`, async () => {
|
||||||
core.info(JSON.stringify(jsonOutput, null, 2));
|
core.info(JSON.stringify(jsonOutput, null, 2));
|
||||||
setOutput('json', JSON.stringify(jsonOutput));
|
setOutput('json', JSON.stringify(jsonOutput));
|
||||||
});
|
});
|
||||||
|
|
||||||
// Bake files
|
// Bake files
|
||||||
for (const kind of ['tags', 'labels', 'annotations:' + alevels]) {
|
for (const kind of ['tags', 'labels', 'annotations:' + annotationsLevels]) {
|
||||||
const outputName = kind.split(':')[0];
|
const outputName = kind.split(':')[0];
|
||||||
const bakeFile: string = meta.getBakeFile(kind);
|
const bakeFile: string = meta.getBakeFile(kind);
|
||||||
await core.group(`Bake file definition (${outputName})`, async () => {
|
await core.group(`Bake file definition (${outputName})`, async () => {
|
||||||
@@ -106,6 +100,11 @@ actionsToolkit.run(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Bake file with tags and labels
|
// Bake file with tags and labels
|
||||||
setOutput(`bake-file`, meta.getBakeFileTagsLabels());
|
setOutput(`bake-file`, `${meta.getBakeFileTagsLabels()}`);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
function setOutput(name: string, value: string) {
|
||||||
|
core.setOutput(name, value);
|
||||||
|
core.exportVariable(`DOCKER_METADATA_OUTPUT_${name.replace(/\W/g, '_').toUpperCase()}`, value);
|
||||||
|
}
|
||||||
|
114
src/meta.ts
114
src/meta.ts
@@ -468,7 +468,15 @@ export class Meta {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public getLabels(): Array<string> {
|
public getLabels(): Array<string> {
|
||||||
const labels: Array<string> = [
|
return this.getOCIAnnotationsWithCustoms(this.inputs.labels);
|
||||||
|
}
|
||||||
|
|
||||||
|
public getAnnotations(): Array<string> {
|
||||||
|
return this.getOCIAnnotationsWithCustoms(this.inputs.annotations);
|
||||||
|
}
|
||||||
|
|
||||||
|
private getOCIAnnotationsWithCustoms(extra: string[]): Array<string> {
|
||||||
|
const res: Array<string> = [
|
||||||
`org.opencontainers.image.title=${this.repo.name || ''}`,
|
`org.opencontainers.image.title=${this.repo.name || ''}`,
|
||||||
`org.opencontainers.image.description=${this.repo.description || ''}`,
|
`org.opencontainers.image.description=${this.repo.description || ''}`,
|
||||||
`org.opencontainers.image.url=${this.repo.html_url || ''}`,
|
`org.opencontainers.image.url=${this.repo.html_url || ''}`,
|
||||||
@@ -478,11 +486,11 @@ export class Meta {
|
|||||||
`org.opencontainers.image.revision=${this.context.sha || ''}`,
|
`org.opencontainers.image.revision=${this.context.sha || ''}`,
|
||||||
`org.opencontainers.image.licenses=${this.repo.license?.spdx_id || ''}`
|
`org.opencontainers.image.licenses=${this.repo.license?.spdx_id || ''}`
|
||||||
];
|
];
|
||||||
labels.push(...this.inputs.labels);
|
res.push(...extra);
|
||||||
|
|
||||||
return Array.from(
|
return Array.from(
|
||||||
new Map<string, string>(
|
new Map<string, string>(
|
||||||
labels
|
res
|
||||||
.map(label => label.split('='))
|
.map(label => label.split('='))
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
.filter(([_key, ...values]) => values.length > 0)
|
.filter(([_key, ...values]) => values.length > 0)
|
||||||
@@ -496,7 +504,7 @@ export class Meta {
|
|||||||
public getJSON(alevels: string[]): unknown {
|
public getJSON(alevels: string[]): unknown {
|
||||||
const annotations: Array<string> = [];
|
const annotations: Array<string> = [];
|
||||||
for (const level of alevels) {
|
for (const level of alevels) {
|
||||||
annotations.push(...this.getLabels().map(label => `${level}:${label}`));
|
annotations.push(...this.getAnnotations().map(label => `${level}:${label}`));
|
||||||
}
|
}
|
||||||
return {
|
return {
|
||||||
tags: this.getTags(),
|
tags: this.getTags(),
|
||||||
@@ -514,70 +522,66 @@ export class Meta {
|
|||||||
|
|
||||||
public getBakeFile(kind: string): string {
|
public getBakeFile(kind: string): string {
|
||||||
if (kind == 'tags') {
|
if (kind == 'tags') {
|
||||||
return this.generateBakeFile(kind, {
|
return this.generateBakeFile(
|
||||||
tags: this.getTags(),
|
{
|
||||||
args: {
|
tags: this.getTags(),
|
||||||
DOCKER_META_IMAGES: this.getImageNames().join(','),
|
args: {
|
||||||
DOCKER_META_VERSION: this.version.main
|
DOCKER_META_IMAGES: this.getImageNames().join(','),
|
||||||
}
|
DOCKER_META_VERSION: this.version.main
|
||||||
});
|
|
||||||
} else if (kind == 'labels') {
|
|
||||||
return this.generateBakeFile(kind, {
|
|
||||||
labels: this.getLabels().reduce((res, label) => {
|
|
||||||
const matches = label.match(/([^=]*)=(.*)/);
|
|
||||||
if (!matches) {
|
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
res[matches[1]] = matches[2];
|
},
|
||||||
return res;
|
kind
|
||||||
}, {})
|
);
|
||||||
});
|
} else if (kind == 'labels') {
|
||||||
|
return this.generateBakeFile(
|
||||||
|
{
|
||||||
|
labels: this.getLabels().reduce((res, label) => {
|
||||||
|
const matches = label.match(/([^=]*)=(.*)/);
|
||||||
|
if (!matches) {
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
res[matches[1]] = matches[2];
|
||||||
|
return res;
|
||||||
|
}, {})
|
||||||
|
},
|
||||||
|
kind
|
||||||
|
);
|
||||||
} else if (kind.startsWith('annotations:')) {
|
} else if (kind.startsWith('annotations:')) {
|
||||||
const name = kind.split(':')[0];
|
const name = kind.split(':')[0];
|
||||||
const annotations: Array<string> = [];
|
const annotations: Array<string> = [];
|
||||||
for (const level of kind.split(':')[1].split(',')) {
|
for (const level of kind.split(':')[1].split(',')) {
|
||||||
annotations.push(...this.getLabels().map(label => `${level}:${label}`));
|
annotations.push(...this.getAnnotations().map(label => `${level}:${label}`));
|
||||||
}
|
}
|
||||||
return this.generateBakeFile(name, {
|
return this.generateBakeFile(
|
||||||
annotations: annotations
|
{
|
||||||
});
|
annotations: annotations
|
||||||
|
},
|
||||||
|
name
|
||||||
|
);
|
||||||
}
|
}
|
||||||
throw new Error(`Unknown bake file type: ${kind}`);
|
throw new Error(`Unknown bake file type: ${kind}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
public getBakeFileTagsLabels(): string {
|
public getBakeFileTagsLabels(): string {
|
||||||
const bakeFile = path.join(ToolkitContext.tmpDir(), 'docker-metadata-action-bake.json');
|
return this.generateBakeFile({
|
||||||
fs.writeFileSync(
|
tags: this.getTags(),
|
||||||
bakeFile,
|
labels: this.getLabels().reduce((res, label) => {
|
||||||
JSON.stringify(
|
const matches = label.match(/([^=]*)=(.*)/);
|
||||||
{
|
if (!matches) {
|
||||||
target: {
|
return res;
|
||||||
[this.inputs.bakeTarget]: {
|
}
|
||||||
tags: this.getTags(),
|
res[matches[1]] = matches[2];
|
||||||
labels: this.getLabels().reduce((res, label) => {
|
return res;
|
||||||
const matches = label.match(/([^=]*)=(.*)/);
|
}, {}),
|
||||||
if (!matches) {
|
args: {
|
||||||
return res;
|
DOCKER_META_IMAGES: this.getImageNames().join(','),
|
||||||
}
|
DOCKER_META_VERSION: this.version.main
|
||||||
res[matches[1]] = matches[2];
|
}
|
||||||
return res;
|
});
|
||||||
}, {}),
|
|
||||||
args: {
|
|
||||||
DOCKER_META_IMAGES: this.getImageNames().join(','),
|
|
||||||
DOCKER_META_VERSION: this.version.main
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
null,
|
|
||||||
2
|
|
||||||
)
|
|
||||||
);
|
|
||||||
return bakeFile;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private generateBakeFile(name: string, dt): string {
|
private generateBakeFile(dt, suffix?: string): string {
|
||||||
const bakeFile = path.join(ToolkitContext.tmpDir(), `docker-metadata-action-bake-${name}.json`);
|
const bakeFile = path.join(ToolkitContext.tmpDir(), `docker-metadata-action-bake${suffix ? `-${suffix}` : ''}.json`);
|
||||||
fs.writeFileSync(bakeFile, JSON.stringify({target: {[this.inputs.bakeTarget]: dt}}, null, 2));
|
fs.writeFileSync(bakeFile, JSON.stringify({target: {[this.inputs.bakeTarget]: dt}}, null, 2));
|
||||||
return bakeFile;
|
return bakeFile;
|
||||||
}
|
}
|
||||||
|
@@ -4,9 +4,11 @@ RUN apk add --no-cache coreutils jq
|
|||||||
ARG DOCKER_METADATA_OUTPUT_VERSION
|
ARG DOCKER_METADATA_OUTPUT_VERSION
|
||||||
ARG DOCKER_METADATA_OUTPUT_TAGS
|
ARG DOCKER_METADATA_OUTPUT_TAGS
|
||||||
ARG DOCKER_METADATA_OUTPUT_LABELS
|
ARG DOCKER_METADATA_OUTPUT_LABELS
|
||||||
|
ARG DOCKER_METADATA_OUTPUT_ANNOTATIONS
|
||||||
ARG DOCKER_METADATA_OUTPUT_JSON
|
ARG DOCKER_METADATA_OUTPUT_JSON
|
||||||
RUN printenv DOCKER_METADATA_OUTPUT_VERSION
|
RUN printenv DOCKER_METADATA_OUTPUT_VERSION
|
||||||
RUN printenv DOCKER_METADATA_OUTPUT_TAGS
|
RUN printenv DOCKER_METADATA_OUTPUT_TAGS
|
||||||
RUN printenv DOCKER_METADATA_OUTPUT_LABELS
|
RUN printenv DOCKER_METADATA_OUTPUT_LABELS
|
||||||
|
RUN printenv DOCKER_METADATA_OUTPUT_ANNOTATIONS
|
||||||
RUN printenv DOCKER_METADATA_OUTPUT_JSON
|
RUN printenv DOCKER_METADATA_OUTPUT_JSON
|
||||||
RUN echo $DOCKER_METADATA_OUTPUT_JSON | jq
|
RUN echo $DOCKER_METADATA_OUTPUT_JSON | jq
|
||||||
|
Reference in New Issue
Block a user