Skip to content

Commit

Permalink
Add linux/ppc64le and linux/s390x builds
Browse files Browse the repository at this point in the history
  • Loading branch information
yselkowitz committed Nov 25, 2022
1 parent 9ecddb6 commit ac17d26
Show file tree
Hide file tree
Showing 8 changed files with 123 additions and 1 deletion.
64 changes: 64 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ steps:
- ls-lint-darwin-arm64
- ls-lint-linux
- ls-lint-linux-arm64
- ls-lint-linux-ppc64le
- ls-lint-linux-s390x
- ls-lint-windows.exe
when:
event: tag
Expand Down Expand Up @@ -127,13 +129,75 @@ steps:
auto_tag_suffix: linux-arm64
repo: lslintorg/ls-lint

---
kind: pipeline
type: docker
name: docker-linux-ppc64le
depends_on:
- main
trigger:
event:
- tag

platform:
os: linux
arch: ppc64le

steps:
- name: build
image: golang
commands:
- make build
- name: docker hub
image: plugins/docker:linux-ppc64le
settings:
username: loeffel
password:
from_secret: DOCKER_PASSWORD
dockerfile: docker/Dockerfile.ppc64le
auto_tag: true
auto_tag_suffix: linux-ppc64le
repo: lslintorg/ls-lint

---
kind: pipeline
type: docker
name: docker-linux-s390x
depends_on:
- main
trigger:
event:
- tag

platform:
os: linux
arch: s390x

steps:
- name: build
image: golang
commands:
- make build
- name: docker hub
image: plugins/docker:linux-s390x
settings:
username: loeffel
password:
from_secret: DOCKER_PASSWORD
dockerfile: docker/Dockerfile.s390x
auto_tag: true
auto_tag_suffix: linux-s390x
repo: lslintorg/ls-lint

---
kind: pipeline
type: docker
name: docker-manifest
depends_on:
- docker-linux-amd64
- docker-linux-arm64
- docker-linux-ppc64le
- docker-linux-s390x
trigger:
event:
- tag
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ ls-lint-darwin
ls-lint-darwin-arm64
ls-lint-linux
ls-lint-linux-arm64
ls-lint-linux-ppc64le
ls-lint-linux-s390x
ls-lint-windows.exe
/coverage.txt
!npm
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ build:
GOOS=darwin GOARCH=arm64 go build -o ls-lint-darwin-arm64
GOOS=linux GOARCH=amd64 go build -o ls-lint-linux
GOOS=linux GOARCH=arm64 go build -o ls-lint-linux-arm64
GOOS=linux GOARCH=ppc64le go build -o ls-lint-linux-ppc64le
GOOS=linux GOARCH=s390x go build -o ls-lint-linux-s390x
GOOS=windows GOARCH=amd64 go build -o ls-lint-windows.exe

build-npm:
Expand All @@ -20,6 +22,8 @@ build-npm:
make build-npm-darwin-arm64
make build-npm-linux
make build-npm-linux-arm64
make build-npm-linux-ppc64le
make build-npm-linux-s390x
make build-npm-windows

build-npm-darwin:
Expand All @@ -38,6 +42,14 @@ build-npm-linux-arm64:
cp ls-lint-linux-arm64 npm/bin/ls-lint-linux-arm64
chmod +x npm/bin/ls-lint-linux-arm64

build-npm-linux-ppc64le:
cp ls-lint-linux-ppc64le npm/bin/ls-lint-linux-ppc64le
chmod +x npm/bin/ls-lint-linux-ppc64le

build-npm-linux-s390x:
cp ls-lint-linux-s390x npm/bin/ls-lint-linux-s390x
chmod +x npm/bin/ls-lint-linux-s390x

build-npm-windows:
cp ls-lint-windows.exe npm/bin/ls-lint-windows.exe
chmod +x npm/bin/ls-lint-windows.exe
Expand All @@ -46,4 +58,4 @@ docker-build:
docker build -f docker/Dockerfile -t ls-lint-dev:latest .

docker-run:
docker run --rm -v ${PWD}:/data ls-lint-dev:latest
docker run --rm -v ${PWD}:/data ls-lint-dev:latest
14 changes: 14 additions & 0 deletions docker/Dockerfile.ppc64le
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM golang:1.18 as builder
WORKDIR /usr/src/app
COPY go.mod go.sum ./
RUN go mod download && go mod verify

COPY . .
RUN make build

FROM gcr.io/distroless/base

COPY --from=builder /usr/src/app/ls-lint-linux-ppc64le /ls-lint
VOLUME /data
WORKDIR /data
ENTRYPOINT ["/ls-lint"]
14 changes: 14 additions & 0 deletions docker/Dockerfile.s390x
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM golang:1.18 as builder
WORKDIR /usr/src/app
COPY go.mod go.sum ./
RUN go mod download && go mod verify

COPY . .
RUN make build

FROM gcr.io/distroless/base

COPY --from=builder /usr/src/app/ls-lint-linux-s390x /ls-lint
VOLUME /data
WORKDIR /data
ENTRYPOINT ["/ls-lint"]
10 changes: 10 additions & 0 deletions docker/manifest.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,13 @@ manifests:
architecture: arm64
os: linux
variant: v8
-
image: lslintorg/ls-lint:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-ppc64le
platform:
architecture: ppc64le
os: linux
-
image: lslintorg/ls-lint:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-s390x
platform:
architecture: s390x
os: linux
4 changes: 4 additions & 0 deletions npm/bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ function getPlatformPath() {
return 'ls-lint-linux';
case 'arm64':
return 'ls-lint-linux-arm64';
case 'ppc64le':
return 'ls-lint-linux-ppc64le';
case 's390x':
return 'ls-lint-linux-s390x';
default:
console.log('ls-lint builds are not available on platform: ' + process.platform + ' arch: ' + process.arch);
process.exit(1);
Expand Down
2 changes: 2 additions & 0 deletions npm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
"cpu": [
"x64",
"arm64"
"ppc64le"
"s390x"
],
"keywords": [
"linter",
Expand Down

0 comments on commit ac17d26

Please sign in to comment.