Skip to content

Commit

Permalink
🐛 fixing up makefile and builds to always use in tree analyzer-ls… (#589
Browse files Browse the repository at this point in the history
)

…p as library

Signed-off-by: Shawn Hurley <[email protected]>
  • Loading branch information
shawn-hurley authored Apr 24, 2024
1 parent 5cfd080 commit 434c56f
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 22 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/image-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ jobs:
architectures: '[ "amd64", "arm64", "ppc64le", "s390x" ]'
- name: dotnet-external-provider
containerfile: "./external-providers/dotnet-external-provider/Dockerfile"
context: "./external-providers/dotnet-external-provider"
context: "."
architectures: '[ "amd64", "arm64" ]'
- name: golang-dependency-provider
containerfile: "./external-providers/golang-dependency-provider/Dockerfile"
context: "./external-providers/golang-dependency-provider"
context: "."
architectures: '[ "amd64", "arm64" ]'
- name: yq-external-provider
containerfile: "./external-providers/yq-external-provider/Dockerfile"
context: "./external-providers/yq-external-provider"
context: "."
architectures: '[ "amd64", "arm64" ]'
- name: java-external-provider
containerfile: "./external-providers/java-external-provider/Dockerfile"
context: "./external-providers/java-external-provider"
context: "."
architectures: '[ "amd64", "arm64" ]'
pre_build_cmd: |
TAG=${GITHUB_REF_NAME/main/latest}
Expand All @@ -67,7 +67,7 @@ jobs:
image_name: generic-external-provider
containerfile: "./external-providers/generic-external-provider/Dockerfile"
architectures: '[ "amd64", "arm64" ]'
context: "./external-providers/generic-external-provider/"
context: "."
pre_build_cmd: |
TAG=${GITHUB_REF_NAME/main/latest}
sed -i "s,FROM quay.io/konveyor/golang-dependency-provider,FROM quay.io/konveyor/golang-dependency-provider:${TAG}," Dockerfile
Expand Down
13 changes: 2 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,19 @@ image-build:
build-external: build-dotnet-provider build-golang-dep-provider build-generic-provider build-java-provider build-yq-provider

build-dotnet-provider:
cd external-providers/dotnet-external-provider/ && go mod edit --replace=github.com/konveyor/analyzer-lsp=/analyzer-lsp
podman build -f external-providers/dotnet-external-provider/Dockerfile -t dotnet-provider .

build-generic-provider:
cd external-providers/generic-external-provider/ && go mod edit --replace=github.com/konveyor/analyzer-lsp=/analyzer-lsp
sed -i 's,quay.io/konveyor/golang-dependency-provider,golang-dep-provider,g' external-providers/generic-external-provider/Dockerfile
podman build -f external-providers/generic-external-provider/Dockerfile -t generic-provider .

build-golang-dep-provider:
cd external-providers/golang-dependency-provider/ && go mod edit --replace=github.com/konveyor/analyzer-lsp=/analyzer-lsp
podman build -f external-providers/golang-dependency-provider/Dockerfile -t golang-dep-provider .

build-java-provider:
cd external-providers/java-external-provider/ && go mod edit --replace=github.com/konveyor/analyzer-lsp=/analyzer-lsp
podman build -f external-providers/java-external-provider/Dockerfile -t java-provider .

build-yq-provider:
cd external-providers/yq-external-provider/ && go mod edit --replace=github.com/konveyor/analyzer-lsp=/analyzer-lsp
podman build -f external-providers/yq-external-provider/Dockerfile -t yq-provider .

run-external-providers-local:
Expand All @@ -64,11 +59,7 @@ stop-external-providers:
podman rm golang-provider || true
podman rm nodejs || true
podman rm python || true
cd external-providers/yq-external-provider/ && go mod edit --dropreplace=github.com/konveyor/analyzer-lsp
cd external-providers/java-external-provider/ && go mod edit --dropreplace=github.com/konveyor/analyzer-lsp
cd external-providers/golang-dependency-provider/ && go mod edit --dropreplace=github.com/konveyor/analyzer-lsp
cd external-providers/generic-external-provider/ && go mod edit --dropreplace=github.com/konveyor/analyzer-lsp
cd external-providers/dotnet-external-provider/ && go mod edit --dropreplace=github.com/konveyor/analyzer-lsp
sed -i 's,golang-dep-provider,quay.io/konveyor/golang-dependency-provider,g' external-providers/generic-external-provider/Dockerfile

run-external-providers-pod:
podman volume create test-data
Expand All @@ -87,7 +78,7 @@ run-external-providers-pod:
run-demo-image:
podman run --entrypoint /usr/local/bin/konveyor-analyzer --pod=analyzer -v $(PWD)/demo-dep-output.yaml:/analyzer-lsp/demo-dep-output.yaml:Z -v $(PWD)/demo-output.yaml:/analyzer-lsp/output.yaml:Z localhost/testing:latest --dep-output-file=demo-dep-output.yaml

stop-external-providers-pod:
stop-external-providers-pod: stop-external-providers
podman pod kill analyzer
podman pod rm analyzer
podman volume rm test-data
2 changes: 1 addition & 1 deletion external-providers/dotnet-external-provider/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ COPY external-providers/dotnet-external-provider/go.sum .
COPY external-providers/dotnet-external-provider/main.go .
COPY external-providers/dotnet-external-provider/pkg/ ./pkg

RUN go mod tidy
RUN go mod edit --replace=github.com/konveyor/analyzer-lsp=/analyzer-lsp && go mod tidy

RUN make build
RUN ADD_PLAT=yes OS=windows make build
Expand Down
3 changes: 2 additions & 1 deletion external-providers/generic-external-provider/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ COPY external-providers/generic-external-provider/go.sum go.sum

COPY external-providers/generic-external-provider/main.go main.go
COPY external-providers/generic-external-provider/pkg/ pkg/
RUN go mod tidy

RUN go mod edit -replace=github.com/konveyor/analyzer-lsp=/analyzer-lsp && go mod tidy

RUN go build -o generic-external-provider main.go

Expand Down
4 changes: 3 additions & 1 deletion external-providers/golang-dependency-provider/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ COPY external-providers/golang-dependency-provider/go.mod go.mod
COPY external-providers/golang-dependency-provider/go.sum go.sum

COPY external-providers/golang-dependency-provider/main.go main.go
RUN go mod tidy

RUN go mod edit -replace=github.com/konveyor/analyzer-lsp=/analyzer-lsp && go mod tidy

RUN go build -o golang-dependency-provider main.go

FROM registry.access.redhat.com/ubi9/ubi-minimal:latest
Expand Down
4 changes: 2 additions & 2 deletions external-providers/java-external-provider/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM golang:1.21 as builder
FROM golang:1.20 as builder

COPY / /analyzer-lsp

Expand All @@ -12,7 +12,7 @@ COPY external-providers/java-external-provider/go.sum go.sum
COPY external-providers/java-external-provider/main.go main.go
COPY external-providers/java-external-provider/pkg/ pkg/

RUN go mod tidy
RUN go mod edit -replace=github.com/konveyor/analyzer-lsp=/analyzer-lsp && go mod tidy

RUN go build -a -o java-external-provider main.go

Expand Down
3 changes: 2 additions & 1 deletion external-providers/yq-external-provider/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ COPY external-providers/yq-external-provider/go.sum go.sum

COPY external-providers/yq-external-provider/main.go main.go
COPY external-providers/yq-external-provider/pkg/ pkg/
RUN go mod tidy

RUN go mod edit -replace=github.com/konveyor/analyzer-lsp=/analyzer-lsp && go mod tidy

RUN go build -o yq-external-provider main.go

Expand Down

0 comments on commit 434c56f

Please sign in to comment.