Compare commits
5 commits
08089a16e7
...
58234199cf
Author | SHA1 | Date | |
---|---|---|---|
58234199cf | |||
2a5cc2d0c5 | |||
93c7a26579 | |||
7be58a9b5b | |||
cae3115061 |
7 changed files with 33 additions and 24 deletions
15
.github/workflows/build.yaml
vendored
Normal file
15
.github/workflows/build.yaml
vendored
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
name: Lint
|
||||||
|
|
||||||
|
on: push
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
buildx:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@main
|
||||||
|
- uses: docker/setup-qemu-action@main
|
||||||
|
- uses: docker/setup-buildx-action@main
|
||||||
|
- uses: docker/build-push-action@main
|
||||||
|
with:
|
||||||
|
platforms: linux/amd64,linux/arm64
|
10
.justfile
10
.justfile
|
@ -7,7 +7,7 @@
|
||||||
# Run linter.
|
# Run linter.
|
||||||
@lint:
|
@lint:
|
||||||
docker run --rm --read-only --volume=$(pwd):$(pwd):ro --workdir=$(pwd) kokuwaio/shellcheck
|
docker run --rm --read-only --volume=$(pwd):$(pwd):ro --workdir=$(pwd) kokuwaio/shellcheck
|
||||||
docker run --rm --read-only --volume=$(pwd):$(pwd):ro --workdir=$(pwd) kokuwaio/hadolint
|
docker run --rm --read-only --volume=$(pwd):$(pwd):ro --workdir=$(pwd) kokuwaio/hadolint
|
||||||
docker run --rm --read-only --volume=$(pwd):$(pwd):ro --workdir=$(pwd) kokuwaio/yamllint
|
docker run --rm --read-only --volume=$(pwd):$(pwd):ro --workdir=$(pwd) kokuwaio/yamllint
|
||||||
docker run --rm --read-only --volume=$(pwd):$(pwd):rw --workdir=$(pwd) kokuwaio/markdownlint --fix
|
docker run --rm --read-only --volume=$(pwd):$(pwd):rw --workdir=$(pwd) kokuwaio/markdownlint --fix
|
||||||
docker run --rm --read-only --volume=$(pwd):$(pwd):ro --workdir=$(pwd) kokuwaio/renovate
|
docker run --rm --read-only --volume=$(pwd):$(pwd):ro --workdir=$(pwd) kokuwaio/renovate
|
||||||
|
@ -16,13 +16,7 @@
|
||||||
# Build image with local docker daemon.
|
# Build image with local docker daemon.
|
||||||
[group('image')]
|
[group('image')]
|
||||||
@build:
|
@build:
|
||||||
docker buildx build . --tag=kokuwaio/buildctl --platform=linux/amd64,linux/arm64 --push
|
docker buildx build . --tag=kokuwaio/buildctl --platform=linux/amd64,linux/arm64
|
||||||
docker buildx build . --platform=linux/amd64,linux/arm64 --push --tag registry.kokuwa.io/b
|
|
||||||
|
|
||||||
# Inspect image with docker.
|
|
||||||
[group('image')]
|
|
||||||
@inspect: build
|
|
||||||
docker image inspect kokuwaio/buildctl
|
|
||||||
|
|
||||||
# Inspect image layers with `dive`.
|
# Inspect image layers with `dive`.
|
||||||
[group('image')]
|
[group('image')]
|
||||||
|
|
|
@ -12,7 +12,7 @@ steps:
|
||||||
pull: true
|
pull: true
|
||||||
depends_on: []
|
depends_on: []
|
||||||
settings: &settings
|
settings: &settings
|
||||||
name: registry.kokuwa.io/buildctl:$CI_PIPELINE_NUMBER
|
name: registry.kokuwa.io/kokuwaio/buildctl:ci-${CI_PIPELINE_NUMBER}
|
||||||
auth:
|
auth:
|
||||||
registry.kokuwa.io:
|
registry.kokuwa.io:
|
||||||
username: {from_secret: kokuwa_io_username}
|
username: {from_secret: kokuwa_io_username}
|
||||||
|
@ -20,7 +20,7 @@ steps:
|
||||||
platform: [linux/amd64, linux/arm64]
|
platform: [linux/amd64, linux/arm64]
|
||||||
annotation:
|
annotation:
|
||||||
org.opencontainers.image.title: Buildctl Plugin
|
org.opencontainers.image.title: Buildctl Plugin
|
||||||
org.opencontainers.image.description: A Woodpecker CI plugin for yamllint to lint yaml files.
|
org.opencontainers.image.description: A Woodpecker CI plugin for buildctl to build container images using a remote builtkitd instance.
|
||||||
org.opencontainers.image.url: $CI_REPO_URL
|
org.opencontainers.image.url: $CI_REPO_URL
|
||||||
org.opencontainers.image.documentation: $CI_REPO_URL/README.md
|
org.opencontainers.image.documentation: $CI_REPO_URL/README.md
|
||||||
org.opencontainers.image.source: $CI_REPO_CLONE_URL
|
org.opencontainers.image.source: $CI_REPO_CLONE_URL
|
||||||
|
|
|
@ -6,7 +6,6 @@ when:
|
||||||
path: [.woodpecker/build.yaml, Dockerfile, Dockerfile.dockerignore, entrypoint.sh]
|
path: [.woodpecker/build.yaml, Dockerfile, Dockerfile.dockerignore, entrypoint.sh]
|
||||||
|
|
||||||
depends_on: [build]
|
depends_on: [build]
|
||||||
skip_clone: true
|
|
||||||
matrix:
|
matrix:
|
||||||
PLATFORM: [amd64, arm64]
|
PLATFORM: [amd64, arm64]
|
||||||
labels:
|
labels:
|
||||||
|
@ -14,25 +13,25 @@ labels:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
pr:
|
registry.kokuwa.io/kokuwaio/buildctl:ci-${CI_PIPELINE_NUMBER}:
|
||||||
image: registry.kokuwa.io/buildctl:$CI_PIPELINE_NUMBER
|
image: registry.kokuwa.io/kokuwaio/buildctl:ci-${CI_PIPELINE_NUMBER}
|
||||||
pull: true
|
pull: true
|
||||||
commands: buildctl --version
|
commands: buildctl --version
|
||||||
when:
|
when:
|
||||||
event: pull_request
|
event: pull_request
|
||||||
|
|
||||||
kokuwa.io: &version
|
registry.kokuwa.io/kokuwaio/buildctl: &version
|
||||||
image: kokuwa.io/buildctl
|
image: registry.kokuwa.io/kokuwaio/buildctl:latest
|
||||||
pull: true
|
pull: true
|
||||||
commands: buildctl --version
|
commands: buildctl --version
|
||||||
when:
|
when:
|
||||||
event: [manual, push]
|
event: [manual, push]
|
||||||
branch: main
|
branch: main
|
||||||
|
|
||||||
docker.io:
|
docker.io/kokuwaio/buildctl:
|
||||||
image: docker.io/kokuwaio/buildctl
|
image: docker.io/kokuwaio/buildctl:latest
|
||||||
<<: *version
|
<<: *version
|
||||||
|
|
||||||
ghcr.io:
|
ghcr.io/kokuwaio/buildctl:
|
||||||
image: ghcr.io/kokuwaio/buildctl
|
image: ghcr.io/kokuwaio/buildctl:latest
|
||||||
<<: *version
|
<<: *version
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
# bash is non-default location https://github.com/tianon/docker-bash/issues/29
|
# bash is non-default location https://github.com/tianon/docker-bash/issues/29
|
||||||
# hadolint only uses default locations https://github.com/hadolint/hadolint/issues/977
|
# hadolint only uses default locations https://github.com/hadolint/hadolint/issues/977
|
||||||
# hadolint global ignore=DL4006
|
# hadolint global ignore=DL4006
|
||||||
|
|
||||||
FROM docker.io/library/bash:5.2.37@sha256:01a15c6f48f6a3c08431cd77e11567823530b18159889dca3b7309b707beef91
|
FROM docker.io/library/bash:5.2.37@sha256:01a15c6f48f6a3c08431cd77e11567823530b18159889dca3b7309b707beef91
|
||||||
SHELL ["/usr/local/bin/bash", "-u", "-e", "-o", "pipefail", "-c"]
|
SHELL ["/usr/local/bin/bash", "-u", "-e", "-o", "pipefail", "-c"]
|
||||||
|
|
||||||
|
@ -17,7 +18,7 @@ RUN ARCH=$(uname -m) && \
|
||||||
[[ $ARCH == aarch64 ]] && export SUFFIX=arm64; \
|
[[ $ARCH == aarch64 ]] && export SUFFIX=arm64; \
|
||||||
[[ -z ${SUFFIX:-} ]] && echo "Unknown arch: $ARCH" && exit 1; \
|
[[ -z ${SUFFIX:-} ]] && echo "Unknown arch: $ARCH" && exit 1; \
|
||||||
wget -q "https://github.com/moby/buildkit/releases/download/v0.21.0/buildkit-v0.21.0.linux-$SUFFIX.tar.gz" --output-document=- | tar --gz --extract --directory=/usr/local bin/buildctl && \
|
wget -q "https://github.com/moby/buildkit/releases/download/v0.21.0/buildkit-v0.21.0.linux-$SUFFIX.tar.gz" --output-document=- | tar --gz --extract --directory=/usr/local bin/buildctl && \
|
||||||
chmod 555 /usr/local/bin/jq
|
chmod 555 /usr/local/bin/buildctl
|
||||||
|
|
||||||
COPY --chmod=555 entrypoint.sh /usr/local/bin/entrypoint.sh
|
COPY --chmod=555 entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
||||||
|
|
|
@ -38,7 +38,7 @@ fi
|
||||||
COMMAND="$COMMAND --frontend $BUILDCTL_FRONTEND"
|
COMMAND="$COMMAND --frontend $BUILDCTL_FRONTEND"
|
||||||
COMMAND="$COMMAND --local context='$BUILDCTL_CONTEXT'"
|
COMMAND="$COMMAND --local context='$BUILDCTL_CONTEXT'"
|
||||||
COMMAND="$COMMAND --local dockerfile='$BUILDCTL_DOCKERFILE'"
|
COMMAND="$COMMAND --local dockerfile='$BUILDCTL_DOCKERFILE'"
|
||||||
if [[ "${PLUGIN_PLATFORM:-}" == "true" ]]; then
|
if [[ -n "${PLUGIN_PLATFORM:-}" ]]; then
|
||||||
COMMAND="$COMMAND --opt platform='$PLUGIN_PLATFORM'"
|
COMMAND="$COMMAND --opt platform='$PLUGIN_PLATFORM'"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -10,15 +10,15 @@
|
||||||
"- docker.io/kokuwaio/buildctl:(?<currentValue>v[0-9]+\\.[0-9]+\\.[0-9]+)",
|
"- docker.io/kokuwaio/buildctl:(?<currentValue>v[0-9]+\\.[0-9]+\\.[0-9]+)",
|
||||||
"- ghcr.io/kokuwaio/buildctl:(?<currentValue>v[0-9]+\\.[0-9]+\\.[0-9]+)",
|
"- ghcr.io/kokuwaio/buildctl:(?<currentValue>v[0-9]+\\.[0-9]+\\.[0-9]+)",
|
||||||
"org.opencontainers.image.version: (?<currentValue>v[0-9]+\\.[0-9]+\\.[0-9]+)",
|
"org.opencontainers.image.version: (?<currentValue>v[0-9]+\\.[0-9]+\\.[0-9]+)",
|
||||||
"https://github.com/moby/buildkit/releases/download/(?<currentValue>v[0-9]+\\.[0-9]+\\.[0-9]+)/buildkit-v[0-9]+\\.[0-9]+\\.[0-9]+.linux-$SUFFIX.tar.gz",
|
"github.com/moby/buildkit/releases/download/(?<currentValue>v[0-9]+\\.[0-9]+\\.[0-9]+)/buildkit-v[0-9]+\\.[0-9]+\\.[0-9]+.linux-\\$SUFFIX.tar.gz",
|
||||||
"https://github.com/moby/buildkit/releases/download/v[0-9]+\\.[0-9]+\\.[0-9]+/buildkit-(?<currentValue>v[0-9]+\\.[0-9]+\\.[0-9]+).linux-$SUFFIX.tar.gz"
|
"github.com/moby/buildkit/releases/download/v[0-9]+\\.[0-9]+\\.[0-9]+/buildkit-(?<currentValue>v[0-9]+\\.[0-9]+\\.[0-9]+).linux-\\$SUFFIX.tar.gz"
|
||||||
],
|
],
|
||||||
"datasourceTemplate": "github-tags",
|
"datasourceTemplate": "github-tags",
|
||||||
"packageNameTemplate": "moby/buildkit"
|
"packageNameTemplate": "moby/buildkit"
|
||||||
},{
|
},{
|
||||||
"customType": "regex",
|
"customType": "regex",
|
||||||
"managerFilePatterns": ["Dockerfile"],
|
"managerFilePatterns": ["Dockerfile"],
|
||||||
"matchStrings": ["https://github.com/jqlang/jq/releases/download/(?<currentValue>jq-[0-9]+\\.[0-9]+\\.[0-9]+)/jq-linux-$SUFFIX"],
|
"matchStrings": ["github.com/jqlang/jq/releases/download/(?<currentValue>jq-[0-9]+\\.[0-9]+\\.[0-9]+)/jq-linux-\\$SUFFIX"],
|
||||||
"datasourceTemplate": "github-tags",
|
"datasourceTemplate": "github-tags",
|
||||||
"packageNameTemplate": "jqlang/jq"
|
"packageNameTemplate": "jqlang/jq"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue