Compare commits
38 Commits
v4.2.0
...
fdf7f43ecf
Author | SHA1 | Date | |
---|---|---|---|
|
fdf7f43ecf | ||
|
e3a4c332fb | ||
|
c48d200483 | ||
|
8d2cf95286 | ||
|
3c7915695f | ||
|
0a283b683f | ||
|
c544b50d70 | ||
|
dd31262fa7 | ||
|
5f01267817 | ||
|
0f847266c3 | ||
|
ea8499618b | ||
|
4c1b68d83a | ||
|
5909c5bffe | ||
|
285730d174 | ||
|
4bbe0177ef | ||
|
cc4d1d4d5f | ||
|
e7d3750abc | ||
|
4556201a14 | ||
|
9fa62cfa91 | ||
|
8026f009fc | ||
|
6b35a7a7f1 | ||
|
c6e64b478a | ||
|
e2505c6383 | ||
|
0565240e2d | ||
|
3ab07f8801 | ||
|
b9e7e4daec | ||
|
04d1a3b049 | ||
|
1a4d1a13fb | ||
|
675965c0e1 | ||
|
58ee34cb6b | ||
|
c97c4060bd | ||
|
47d5369e0b | ||
|
8895c7468f | ||
|
59ba712c53 | ||
|
0c20fff10d | ||
|
0a97817b6a | ||
|
ec39ef320c | ||
|
f46044b799 |
3
.eslintignore
Normal file
3
.eslintignore
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
/dist/**
|
||||||
|
/coverage/**
|
||||||
|
/node_modules/**
|
@@ -1,11 +1,12 @@
|
|||||||
{
|
{
|
||||||
"env": {
|
"env": {
|
||||||
"node": true,
|
"node": true,
|
||||||
"es2021": true,
|
"es6": true,
|
||||||
"jest": true
|
"jest": true
|
||||||
},
|
},
|
||||||
"extends": [
|
"extends": [
|
||||||
"eslint:recommended",
|
"eslint:recommended",
|
||||||
|
"plugin:@typescript-eslint/eslint-recommended",
|
||||||
"plugin:@typescript-eslint/recommended",
|
"plugin:@typescript-eslint/recommended",
|
||||||
"plugin:jest/recommended",
|
"plugin:jest/recommended",
|
||||||
"plugin:prettier/recommended"
|
"plugin:prettier/recommended"
|
||||||
|
9
.github/workflows/.e2e-run.yml
vendored
9
.github/workflows/.e2e-run.yml
vendored
@@ -75,10 +75,11 @@ jobs:
|
|||||||
if: inputs.type == 'local'
|
if: inputs.type == 'local'
|
||||||
run: |
|
run: |
|
||||||
sudo -E bash ./.github/e2e/${{ inputs.id }}/install.sh
|
sudo -E bash ./.github/e2e/${{ inputs.id }}/install.sh
|
||||||
|
sudo chown $(id -u):$(id -g) -R ~/.docker
|
||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v4
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: ${{ env.REGISTRY_SLUG || inputs.slug }}
|
images: ${{ env.REGISTRY_SLUG || inputs.slug }}
|
||||||
tags: |
|
tags: |
|
||||||
@@ -87,10 +88,10 @@ jobs:
|
|||||||
type=raw,gh-runid-${{ github.run_id }}
|
type=raw,gh-runid-${{ github.run_id }}
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v3
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.buildx_version }}
|
version: ${{ matrix.buildx_version }}
|
||||||
config: /tmp/buildkitd.toml
|
config: /tmp/buildkitd.toml
|
||||||
@@ -101,7 +102,7 @@ jobs:
|
|||||||
-
|
-
|
||||||
name: Login to Registry
|
name: Login to Registry
|
||||||
if: github.event_name != 'pull_request' && (env.REGISTRY_USER || inputs.username_secret) != ''
|
if: github.event_name != 'pull_request' && (env.REGISTRY_USER || inputs.username_secret) != ''
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: ${{ env.REGISTRY_FQDN || inputs.registry }}
|
registry: ${{ env.REGISTRY_FQDN || inputs.registry }}
|
||||||
username: ${{ env.REGISTRY_USER || secrets[inputs.username_secret] }}
|
username: ${{ env.REGISTRY_USER || secrets[inputs.username_secret] }}
|
||||||
|
110
.github/workflows/ci.yml
vendored
110
.github/workflows/ci.yml
vendored
@@ -38,7 +38,7 @@ jobs:
|
|||||||
path: action
|
path: action
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
with:
|
||||||
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
||||||
driver-opts: |
|
driver-opts: |
|
||||||
@@ -64,11 +64,11 @@ jobs:
|
|||||||
path: action
|
path: action
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v3
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
with:
|
||||||
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
||||||
driver-opts: |
|
driver-opts: |
|
||||||
@@ -113,11 +113,11 @@ jobs:
|
|||||||
path: action
|
path: action
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v3
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
with:
|
||||||
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
||||||
driver-opts: |
|
driver-opts: |
|
||||||
@@ -170,11 +170,11 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v3
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
with:
|
||||||
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
||||||
driver-opts: |
|
driver-opts: |
|
||||||
@@ -220,7 +220,7 @@ jobs:
|
|||||||
-
|
-
|
||||||
name: Docker meta
|
name: Docker meta
|
||||||
id: meta
|
id: meta
|
||||||
uses: docker/metadata-action@v4
|
uses: docker/metadata-action@v5
|
||||||
with:
|
with:
|
||||||
images: ${{ env.DOCKER_IMAGE }}
|
images: ${{ env.DOCKER_IMAGE }}
|
||||||
tags: |
|
tags: |
|
||||||
@@ -233,7 +233,7 @@ jobs:
|
|||||||
type=sha
|
type=sha
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
with:
|
||||||
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
||||||
driver-opts: |
|
driver-opts: |
|
||||||
@@ -302,10 +302,10 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v3
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
with:
|
||||||
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
||||||
driver-opts: |
|
driver-opts: |
|
||||||
@@ -378,7 +378,7 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
with:
|
||||||
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
||||||
driver-opts: |
|
driver-opts: |
|
||||||
@@ -393,6 +393,31 @@ jobs:
|
|||||||
MYSECRET=foo
|
MYSECRET=foo
|
||||||
INVALID_SECRET=
|
INVALID_SECRET=
|
||||||
|
|
||||||
|
secret-envs:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
-
|
||||||
|
name: Set up Docker buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
with:
|
||||||
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
||||||
|
driver-opts: |
|
||||||
|
image=${{ inputs.buildkit-image || env.BUILDKIT_IMAGE }}
|
||||||
|
-
|
||||||
|
name: Build
|
||||||
|
uses: ./
|
||||||
|
env:
|
||||||
|
ENV_SECRET: foo
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: ./test/secret.Dockerfile
|
||||||
|
secret-envs: |
|
||||||
|
MYSECRET=ENV_SECRET
|
||||||
|
INVALID_SECRET=
|
||||||
|
|
||||||
network:
|
network:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@@ -401,7 +426,7 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
with:
|
||||||
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
||||||
driver-opts: |
|
driver-opts: |
|
||||||
@@ -425,7 +450,7 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
with:
|
||||||
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
||||||
driver-opts: |
|
driver-opts: |
|
||||||
@@ -447,7 +472,7 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
with:
|
||||||
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
||||||
driver-opts: |
|
driver-opts: |
|
||||||
@@ -472,7 +497,7 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
with:
|
||||||
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
||||||
driver-opts: |
|
driver-opts: |
|
||||||
@@ -495,7 +520,7 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
with:
|
||||||
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
||||||
driver-opts: |
|
driver-opts: |
|
||||||
@@ -520,7 +545,7 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
with:
|
||||||
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
||||||
driver-opts: |
|
driver-opts: |
|
||||||
@@ -554,7 +579,7 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
with:
|
||||||
version: ${{ matrix.buildx }}
|
version: ${{ matrix.buildx }}
|
||||||
driver-opts: |
|
driver-opts: |
|
||||||
@@ -585,7 +610,7 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
with:
|
||||||
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
||||||
driver-opts: |
|
driver-opts: |
|
||||||
@@ -624,7 +649,7 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
with:
|
||||||
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
||||||
driver-opts: |
|
driver-opts: |
|
||||||
@@ -681,11 +706,11 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v3
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
with:
|
||||||
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
||||||
driver-opts: |
|
driver-opts: |
|
||||||
@@ -750,7 +775,7 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
with:
|
||||||
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
||||||
driver: ${{ matrix.driver }}
|
driver: ${{ matrix.driver }}
|
||||||
@@ -820,10 +845,10 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v3
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
with:
|
||||||
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
||||||
driver-opts: |
|
driver-opts: |
|
||||||
@@ -869,10 +894,10 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v3
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
with:
|
||||||
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
||||||
driver-opts: |
|
driver-opts: |
|
||||||
@@ -913,7 +938,7 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
with:
|
||||||
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
||||||
driver-opts: |
|
driver-opts: |
|
||||||
@@ -934,7 +959,7 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
with:
|
||||||
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
||||||
driver-opts: |
|
driver-opts: |
|
||||||
@@ -956,7 +981,7 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
with:
|
||||||
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
||||||
driver: docker
|
driver: docker
|
||||||
@@ -990,7 +1015,7 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
with:
|
||||||
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
||||||
driver-opts: |
|
driver-opts: |
|
||||||
@@ -1013,6 +1038,23 @@ jobs:
|
|||||||
build-contexts: |
|
build-contexts: |
|
||||||
alpine=docker-image://localhost:5000/my-base-image:latest
|
alpine=docker-image://localhost:5000/my-base-image:latest
|
||||||
|
|
||||||
|
docker-config-malformed:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
-
|
||||||
|
name: Set malformed docker config
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.docker
|
||||||
|
echo 'foo_bar' >> ~/.docker/config.json
|
||||||
|
-
|
||||||
|
name: Build
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
context: ./test
|
||||||
|
|
||||||
proxy-docker-config:
|
proxy-docker-config:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
services:
|
services:
|
||||||
@@ -1036,7 +1078,7 @@ jobs:
|
|||||||
echo '{"proxies":{"default":{"httpProxy":"http://127.0.0.1:3128","httpsProxy":"http://127.0.0.1:3128"}}}' > ~/.docker/config.json
|
echo '{"proxies":{"default":{"httpProxy":"http://127.0.0.1:3128","httpsProxy":"http://127.0.0.1:3128"}}}' > ~/.docker/config.json
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
with:
|
||||||
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
||||||
driver-opts: |
|
driver-opts: |
|
||||||
@@ -1068,7 +1110,7 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
with:
|
||||||
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
version: ${{ inputs.buildx-version || env.BUILDX_VERSION }}
|
||||||
driver-opts: |
|
driver-opts: |
|
||||||
|
14
.github/workflows/e2e.yml
vendored
14
.github/workflows/e2e.yml
vendored
@@ -88,13 +88,13 @@ jobs:
|
|||||||
username_secret: QUAY_USERNAME
|
username_secret: QUAY_USERNAME
|
||||||
password_secret: QUAY_TOKEN
|
password_secret: QUAY_TOKEN
|
||||||
type: remote
|
type: remote
|
||||||
-
|
# -
|
||||||
name: Artifactory
|
# name: Artifactory
|
||||||
registry: sforzando-build-team-local.jfrog.io
|
# registry: sforzando-build-team-local.jfrog.io
|
||||||
slug: sforzando-build-team-local.jfrog.io/build-push-action-e2e
|
# slug: sforzando-build-team-local.jfrog.io/build-push-action-e2e
|
||||||
username_secret: ARTIFACTORY_USERNAME
|
# username_secret: ARTIFACTORY_USERNAME
|
||||||
password_secret: ARTIFACTORY_TOKEN
|
# password_secret: ARTIFACTORY_TOKEN
|
||||||
type: remote
|
# type: remote
|
||||||
-
|
-
|
||||||
name: Harbor
|
name: Harbor
|
||||||
id: harbor
|
id: harbor
|
||||||
|
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -20,7 +20,7 @@ jobs:
|
|||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
-
|
-
|
||||||
name: Test
|
name: Test
|
||||||
uses: docker/bake-action@v3
|
uses: docker/bake-action@v4
|
||||||
with:
|
with:
|
||||||
targets: test
|
targets: test
|
||||||
-
|
-
|
||||||
|
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@v3
|
uses: docker/bake-action@v4
|
||||||
with:
|
with:
|
||||||
targets: ${{ matrix.target }}
|
targets: ${{ matrix.target }}
|
||||||
|
25
README.md
25
README.md
@@ -74,19 +74,19 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v3
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
-
|
-
|
||||||
name: Login to Docker Hub
|
name: Login to Docker Hub
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
-
|
-
|
||||||
name: Build and push
|
name: Build and push
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
tags: user/app:latest
|
tags: user/app:latest
|
||||||
@@ -108,10 +108,10 @@ to the default Git context:
|
|||||||
# Setting up Docker Buildx with docker-container driver is required
|
# Setting up Docker Buildx with docker-container driver is required
|
||||||
# at the moment to be able to use a subdirectory with Git context
|
# at the moment to be able to use a subdirectory with Git context
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
-
|
-
|
||||||
name: Build and push
|
name: Build and push
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: "{{defaultContext}}:mysubdir"
|
context: "{{defaultContext}}:mysubdir"
|
||||||
push: true
|
push: true
|
||||||
@@ -134,7 +134,7 @@ named `GIT_AUTH_TOKEN` to be able to authenticate against it with Buildx:
|
|||||||
```yaml
|
```yaml
|
||||||
-
|
-
|
||||||
name: Build and push
|
name: Build and push
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
push: true
|
push: true
|
||||||
tags: user/app:latest
|
tags: user/app:latest
|
||||||
@@ -161,19 +161,19 @@ jobs:
|
|||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v3
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
-
|
-
|
||||||
name: Login to Docker Hub
|
name: Login to Docker Hub
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
-
|
-
|
||||||
name: Build and push
|
name: Build and push
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
@@ -238,6 +238,7 @@ Following inputs can be used as `step.with` keys
|
|||||||
| `push` | Bool | [Push](https://docs.docker.com/engine/reference/commandline/buildx_build/#push) is a shorthand for `--output=type=registry` (default `false`) |
|
| `push` | Bool | [Push](https://docs.docker.com/engine/reference/commandline/buildx_build/#push) is a shorthand for `--output=type=registry` (default `false`) |
|
||||||
| `sbom` | Bool/String | Generate [SBOM](https://docs.docker.com/build/attestations/sbom/) attestation for the build (shorthand for `--attest=type=sbom`) |
|
| `sbom` | Bool/String | Generate [SBOM](https://docs.docker.com/build/attestations/sbom/) attestation for the build (shorthand for `--attest=type=sbom`) |
|
||||||
| `secrets` | List | List of [secrets](https://docs.docker.com/engine/reference/commandline/buildx_build/#secret) to expose to the build (e.g., `key=string`, `GIT_AUTH_TOKEN=mytoken`) |
|
| `secrets` | List | List of [secrets](https://docs.docker.com/engine/reference/commandline/buildx_build/#secret) to expose to the build (e.g., `key=string`, `GIT_AUTH_TOKEN=mytoken`) |
|
||||||
|
| `secret-envs` | List/CSV | List of [secret env vars](https://docs.docker.com/engine/reference/commandline/buildx_build/#secret) to expose to the build (e.g., `key=envname`, `MY_SECRET=MY_ENV_VAR`) |
|
||||||
| `secret-files` | List | List of [secret files](https://docs.docker.com/engine/reference/commandline/buildx_build/#secret) to expose to the build (e.g., `key=filename`, `MY_SECRET=./secret.txt`) |
|
| `secret-files` | List | List of [secret files](https://docs.docker.com/engine/reference/commandline/buildx_build/#secret) to expose to the build (e.g., `key=filename`, `MY_SECRET=./secret.txt`) |
|
||||||
| `shm-size` | String | Size of [`/dev/shm`](https://docs.docker.com/engine/reference/commandline/buildx_build/#shm-size) (e.g., `2g`) |
|
| `shm-size` | String | Size of [`/dev/shm`](https://docs.docker.com/engine/reference/commandline/buildx_build/#shm-size) (e.g., `2g`) |
|
||||||
| `ssh` | List | List of [SSH agent socket or keys](https://docs.docker.com/engine/reference/commandline/buildx_build/#ssh) to expose to the build |
|
| `ssh` | List | List of [SSH agent socket or keys](https://docs.docker.com/engine/reference/commandline/buildx_build/#ssh) to expose to the build |
|
||||||
@@ -252,7 +253,7 @@ Following inputs can be used as `step.with` keys
|
|||||||
|
|
||||||
### outputs
|
### outputs
|
||||||
|
|
||||||
Following outputs are available
|
The following outputs are available:
|
||||||
|
|
||||||
| Name | Type | Description |
|
| Name | Type | Description |
|
||||||
|------------|---------|-----------------------|
|
|------------|---------|-----------------------|
|
||||||
|
@@ -48,10 +48,10 @@ jobs:
|
|||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v3
|
||||||
-
|
-
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
with:
|
||||||
buildkitd-flags: --debug
|
buildkitd-flags: --debug
|
||||||
-
|
-
|
||||||
@@ -59,7 +59,7 @@ jobs:
|
|||||||
uses: crazy-max/ghaction-setup-containerd@v2
|
uses: crazy-max/ghaction-setup-containerd@v2
|
||||||
-
|
-
|
||||||
name: Build Docker image
|
name: Build Docker image
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
platforms: linux/amd64,linux/arm64
|
platforms: linux/amd64,linux/arm64
|
||||||
@@ -112,7 +112,7 @@ to generate sanitized tags:
|
|||||||
tags: latest
|
tags: latest
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
@@ -130,7 +130,7 @@ Or a dedicated step to sanitize the slug:
|
|||||||
script: return 'ghcr.io/${{ github.repository }}'.toLowerCase()
|
script: return 'ghcr.io/${{ github.repository }}'.toLowerCase()
|
||||||
|
|
||||||
- name: Build and push
|
- name: Build and push
|
||||||
uses: docker/build-push-action@v4
|
uses: docker/build-push-action@v5
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
push: true
|
push: true
|
||||||
@@ -156,7 +156,7 @@ Sometimes when your workflows are heavy consumers of disk storage, it can happen
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
name: Set up Docker Buildx
|
name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v3
|
||||||
with:
|
with:
|
||||||
driver: docker
|
driver: docker
|
||||||
```
|
```
|
||||||
|
@@ -619,6 +619,49 @@ nproc=3`],
|
|||||||
'.'
|
'.'
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
25,
|
||||||
|
'0.10.0',
|
||||||
|
new Map<string, string>([
|
||||||
|
['context', '.'],
|
||||||
|
['no-cache', 'false'],
|
||||||
|
['load', 'true'],
|
||||||
|
['push', 'false'],
|
||||||
|
['pull', 'false'],
|
||||||
|
['secret-envs', `MY_SECRET=MY_SECRET_ENV
|
||||||
|
ANOTHER_SECRET=ANOTHER_SECRET_ENV`]
|
||||||
|
]),
|
||||||
|
[
|
||||||
|
'build',
|
||||||
|
'--secret', 'id=MY_SECRET,env=MY_SECRET_ENV',
|
||||||
|
'--secret', 'id=ANOTHER_SECRET,env=ANOTHER_SECRET_ENV',
|
||||||
|
'--iidfile', path.join(tmpDir, 'iidfile'),
|
||||||
|
'--load',
|
||||||
|
'--metadata-file', path.join(tmpDir, 'metadata-file'),
|
||||||
|
'.'
|
||||||
|
]
|
||||||
|
],
|
||||||
|
[
|
||||||
|
26,
|
||||||
|
'0.10.0',
|
||||||
|
new Map<string, string>([
|
||||||
|
['context', '.'],
|
||||||
|
['no-cache', 'false'],
|
||||||
|
['load', 'true'],
|
||||||
|
['push', 'false'],
|
||||||
|
['pull', 'false'],
|
||||||
|
['secret-envs', 'MY_SECRET=MY_SECRET_ENV,ANOTHER_SECRET=ANOTHER_SECRET_ENV']
|
||||||
|
]),
|
||||||
|
[
|
||||||
|
'build',
|
||||||
|
'--secret', 'id=MY_SECRET,env=MY_SECRET_ENV',
|
||||||
|
'--secret', 'id=ANOTHER_SECRET,env=ANOTHER_SECRET_ENV',
|
||||||
|
'--iidfile', path.join(tmpDir, 'iidfile'),
|
||||||
|
'--load',
|
||||||
|
'--metadata-file', path.join(tmpDir, 'metadata-file'),
|
||||||
|
'.'
|
||||||
|
]
|
||||||
|
],
|
||||||
])(
|
])(
|
||||||
'[%d] given %p with %p as inputs, returns %p',
|
'[%d] given %p with %p as inputs, returns %p',
|
||||||
async (num: number, buildxVersion: string, inputs: Map<string, string>, expected: Array<string>) => {
|
async (num: number, buildxVersion: string, inputs: Map<string, string>, expected: Array<string>) => {
|
||||||
|
@@ -80,6 +80,9 @@ inputs:
|
|||||||
secrets:
|
secrets:
|
||||||
description: "List of secrets to expose to the build (e.g., key=string, GIT_AUTH_TOKEN=mytoken)"
|
description: "List of secrets to expose to the build (e.g., key=string, GIT_AUTH_TOKEN=mytoken)"
|
||||||
required: false
|
required: false
|
||||||
|
secret-envs:
|
||||||
|
description: "List of secret env vars to expose to the build (e.g., key=envname, MY_SECRET=MY_ENV_VAR)"
|
||||||
|
required: false
|
||||||
secret-files:
|
secret-files:
|
||||||
description: "List of secret files to expose to the build (e.g., key=filename, MY_SECRET=./secret.txt)"
|
description: "List of secret files to expose to the build (e.g., key=filename, MY_SECRET=./secret.txt)"
|
||||||
required: false
|
required: false
|
||||||
@@ -112,6 +115,6 @@ outputs:
|
|||||||
description: 'Build result metadata'
|
description: 'Build result metadata'
|
||||||
|
|
||||||
runs:
|
runs:
|
||||||
using: 'node16'
|
using: 'node20'
|
||||||
main: 'dist/index.js'
|
main: 'dist/index.js'
|
||||||
post: 'dist/index.js'
|
post: 'dist/index.js'
|
||||||
|
@@ -1,8 +1,6 @@
|
|||||||
# syntax=docker/dockerfile:1
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
ARG NODE_VERSION=16
|
ARG NODE_VERSION=20
|
||||||
ARG DOCKER_VERSION=20.10.13
|
|
||||||
ARG BUILDX_VERSION=0.8.0
|
|
||||||
|
|
||||||
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
|
||||||
@@ -62,15 +60,10 @@ RUN --mount=type=bind,target=.,rw \
|
|||||||
--mount=type=cache,target=/src/node_modules \
|
--mount=type=cache,target=/src/node_modules \
|
||||||
yarn run lint
|
yarn run lint
|
||||||
|
|
||||||
FROM docker:${DOCKER_VERSION} as docker
|
|
||||||
FROM docker/buildx-bin:${BUILDX_VERSION} as buildx
|
|
||||||
|
|
||||||
FROM deps AS test
|
FROM deps AS test
|
||||||
RUN --mount=type=bind,target=.,rw \
|
RUN --mount=type=bind,target=.,rw \
|
||||||
--mount=type=cache,target=/src/node_modules \
|
--mount=type=cache,target=/src/node_modules \
|
||||||
--mount=type=bind,from=docker,source=/usr/local/bin/docker,target=/usr/bin/docker \
|
yarn run test --coverage --coverageDirectory=/tmp/coverage
|
||||||
--mount=type=bind,from=buildx,source=/buildx,target=/usr/libexec/docker/cli-plugins/docker-buildx \
|
|
||||||
yarn run test --coverageDirectory=/tmp/coverage
|
|
||||||
|
|
||||||
FROM scratch AS test-coverage
|
FROM scratch AS test-coverage
|
||||||
COPY --from=test /tmp/coverage /
|
COPY --from=test /tmp/coverage /
|
||||||
|
20
dist/index.js
generated
vendored
20
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
47
dist/licenses.txt
generated
vendored
47
dist/licenses.txt
generated
vendored
@@ -527,6 +527,28 @@ Apache-2.0
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
|
||||||
|
|
||||||
|
@fastify/busboy
|
||||||
|
MIT
|
||||||
|
Copyright Brian White. All rights reserved.
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to
|
||||||
|
deal in the Software without restriction, including without limitation the
|
||||||
|
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||||
|
sell copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||||
|
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||||
|
IN THE SOFTWARE.
|
||||||
|
|
||||||
@octokit/auth-token
|
@octokit/auth-token
|
||||||
MIT
|
MIT
|
||||||
The MIT License
|
The MIT License
|
||||||
@@ -1858,6 +1880,31 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
|
undici
|
||||||
|
MIT
|
||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) Matteo Collina and Undici contributors
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
universal-user-agent
|
universal-user-agent
|
||||||
ISC
|
ISC
|
||||||
# [ISC License](https://spdx.org/licenses/ISC)
|
# [ISC License](https://spdx.org/licenses/ISC)
|
||||||
|
46
package.json
46
package.json
@@ -4,9 +4,13 @@
|
|||||||
"main": "lib/main.js",
|
"main": "lib/main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "ncc build src/main.ts --source-map --minify --license licenses.txt",
|
"build": "ncc build src/main.ts --source-map --minify --license licenses.txt",
|
||||||
"lint": "eslint src/**/*.ts __tests__/**/*.ts",
|
"lint": "yarn run prettier && yarn run eslint",
|
||||||
"format": "eslint --fix src/**/*.ts __tests__/**/*.ts",
|
"format": "yarn run prettier:fix && yarn run eslint:fix",
|
||||||
"test": "jest --coverage",
|
"eslint": "eslint --max-warnings=0 .",
|
||||||
|
"eslint:fix": "eslint --fix .",
|
||||||
|
"prettier": "prettier --check \"./**/*.ts\"",
|
||||||
|
"prettier:fix": "prettier --write \"./**/*.ts\"",
|
||||||
|
"test": "jest",
|
||||||
"all": "yarn run build && yarn run format && yarn test"
|
"all": "yarn run build && yarn run format && yarn test"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
@@ -19,33 +23,27 @@
|
|||||||
"build",
|
"build",
|
||||||
"push"
|
"push"
|
||||||
],
|
],
|
||||||
"author": "Docker",
|
"author": "Docker Inc.",
|
||||||
"contributors": [
|
|
||||||
{
|
|
||||||
"name": "CrazyMax",
|
|
||||||
"url": "https://crazymax.dev"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.10.0",
|
"@actions/core": "^1.10.1",
|
||||||
"@docker/actions-toolkit": "^0.8.0",
|
"@docker/actions-toolkit": "0.13.0",
|
||||||
"handlebars": "^4.7.7"
|
"handlebars": "^4.7.7"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/csv-parse": "^1.2.2",
|
"@types/csv-parse": "^1.2.2",
|
||||||
"@types/node": "^16.18.21",
|
"@types/node": "^20.5.9",
|
||||||
"@typescript-eslint/eslint-plugin": "^5.56.0",
|
"@typescript-eslint/eslint-plugin": "^6.6.0",
|
||||||
"@typescript-eslint/parser": "^5.56.0",
|
"@typescript-eslint/parser": "^6.6.0",
|
||||||
"@vercel/ncc": "^0.36.1",
|
"@vercel/ncc": "^0.38.0",
|
||||||
"eslint": "^8.36.0",
|
"eslint": "^8.48.0",
|
||||||
"eslint-config-prettier": "^8.8.0",
|
"eslint-config-prettier": "^9.0.0",
|
||||||
"eslint-plugin-jest": "^27.2.1",
|
"eslint-plugin-jest": "^27.2.3",
|
||||||
"eslint-plugin-prettier": "^4.2.1",
|
"eslint-plugin-prettier": "^5.0.0",
|
||||||
"jest": "^29.5.0",
|
"jest": "^29.6.4",
|
||||||
"prettier": "^2.8.7",
|
"prettier": "^3.0.3",
|
||||||
"ts-jest": "^29.0.5",
|
"ts-jest": "^29.1.1",
|
||||||
"ts-node": "^10.9.1",
|
"ts-node": "^10.9.1",
|
||||||
"typescript": "^4.9.5"
|
"typescript": "^5.2.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -30,6 +30,7 @@ export interface Inputs {
|
|||||||
push: boolean;
|
push: boolean;
|
||||||
sbom: string;
|
sbom: string;
|
||||||
secrets: string[];
|
secrets: string[];
|
||||||
|
secretEnvs: string[];
|
||||||
secretFiles: string[];
|
secretFiles: string[];
|
||||||
shmSize: string;
|
shmSize: string;
|
||||||
ssh: string[];
|
ssh: string[];
|
||||||
@@ -64,6 +65,7 @@ export async function getInputs(): Promise<Inputs> {
|
|||||||
push: core.getBooleanInput('push'),
|
push: core.getBooleanInput('push'),
|
||||||
sbom: core.getInput('sbom'),
|
sbom: core.getInput('sbom'),
|
||||||
secrets: Util.getInputList('secrets', {ignoreComma: true}),
|
secrets: Util.getInputList('secrets', {ignoreComma: true}),
|
||||||
|
secretEnvs: Util.getInputList('secret-envs'),
|
||||||
secretFiles: Util.getInputList('secret-files', {ignoreComma: true}),
|
secretFiles: Util.getInputList('secret-files', {ignoreComma: true}),
|
||||||
shmSize: core.getInput('shm-size'),
|
shmSize: core.getInput('shm-size'),
|
||||||
ssh: Util.getInputList('ssh'),
|
ssh: Util.getInputList('ssh'),
|
||||||
@@ -116,6 +118,13 @@ async function getBuildArgs(inputs: Inputs, context: string, toolkit: Toolkit):
|
|||||||
if (inputs.cgroupParent) {
|
if (inputs.cgroupParent) {
|
||||||
args.push('--cgroup-parent', inputs.cgroupParent);
|
args.push('--cgroup-parent', inputs.cgroupParent);
|
||||||
}
|
}
|
||||||
|
await Util.asyncForEach(inputs.secretEnvs, async secretEnv => {
|
||||||
|
try {
|
||||||
|
args.push('--secret', BuildxInputs.resolveBuildSecretEnv(secretEnv));
|
||||||
|
} catch (err) {
|
||||||
|
core.warning(err.message);
|
||||||
|
}
|
||||||
|
});
|
||||||
if (inputs.file) {
|
if (inputs.file) {
|
||||||
args.push('--file', inputs.file);
|
args.push('--file', inputs.file);
|
||||||
}
|
}
|
||||||
|
23
src/main.ts
23
src/main.ts
@@ -1,4 +1,5 @@
|
|||||||
import * as fs from 'fs';
|
import * as fs from 'fs';
|
||||||
|
import * as path from 'path';
|
||||||
import * as stateHelper from './state-helper';
|
import * as stateHelper from './state-helper';
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
import * as actionsToolkit from '@docker/actions-toolkit';
|
import * as actionsToolkit from '@docker/actions-toolkit';
|
||||||
@@ -8,6 +9,7 @@ import {Exec} from '@docker/actions-toolkit/lib/exec';
|
|||||||
import {GitHub} from '@docker/actions-toolkit/lib/github';
|
import {GitHub} from '@docker/actions-toolkit/lib/github';
|
||||||
import {Inputs as BuildxInputs} from '@docker/actions-toolkit/lib/buildx/inputs';
|
import {Inputs as BuildxInputs} from '@docker/actions-toolkit/lib/buildx/inputs';
|
||||||
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit';
|
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit';
|
||||||
|
import {ConfigFile} from '@docker/actions-toolkit/lib/types/docker';
|
||||||
|
|
||||||
import * as context from './context';
|
import * as context from './context';
|
||||||
|
|
||||||
@@ -34,12 +36,19 @@ actionsToolkit.run(
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const dockerConfig = await Docker.configFile();
|
await core.group(`Proxy configuration`, async () => {
|
||||||
if (dockerConfig && dockerConfig.proxies) {
|
let dockerConfig: ConfigFile | undefined;
|
||||||
await core.group(`Proxy configuration found`, async () => {
|
let dockerConfigMalformed = false;
|
||||||
|
try {
|
||||||
|
dockerConfig = await Docker.configFile();
|
||||||
|
} catch (e) {
|
||||||
|
dockerConfigMalformed = true;
|
||||||
|
core.warning(`Unable to parse config file ${path.join(Docker.configDir, 'config.json')}: ${e}`);
|
||||||
|
}
|
||||||
|
if (dockerConfig && dockerConfig.proxies) {
|
||||||
for (const host in dockerConfig.proxies) {
|
for (const host in dockerConfig.proxies) {
|
||||||
let prefix = '';
|
let prefix = '';
|
||||||
if (dockerConfig.proxies.length > 1) {
|
if (Object.keys(dockerConfig.proxies).length > 1) {
|
||||||
prefix = ' ';
|
prefix = ' ';
|
||||||
core.info(host);
|
core.info(host);
|
||||||
}
|
}
|
||||||
@@ -47,8 +56,10 @@ actionsToolkit.run(
|
|||||||
core.info(`${prefix}${key}: ${dockerConfig.proxies[host][key]}`);
|
core.info(`${prefix}${key}: ${dockerConfig.proxies[host][key]}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
} else if (!dockerConfigMalformed) {
|
||||||
}
|
core.info('No proxy configuration found');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
if (!(await toolkit.buildx.isAvailable())) {
|
if (!(await toolkit.buildx.isAvailable())) {
|
||||||
core.setFailed(`Docker buildx is required. See https://github.com/docker/setup-buildx-action to set up buildx.`);
|
core.setFailed(`Docker buildx is required. See https://github.com/docker/setup-buildx-action to set up buildx.`);
|
||||||
|
Reference in New Issue
Block a user