diff --git a/.github/workflows/image-build.yaml b/.github/workflows/image-build.yaml index 3c8893b5..f64020cc 100644 --- a/.github/workflows/image-build.yaml +++ b/.github/workflows/image-build.yaml @@ -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} @@ -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 diff --git a/Makefile b/Makefile index 9e19dcce..18054915 100644 --- a/Makefile +++ b/Makefile @@ -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: @@ -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 @@ -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 diff --git a/external-providers/dotnet-external-provider/Dockerfile b/external-providers/dotnet-external-provider/Dockerfile index 6d146c06..d983b8d2 100644 --- a/external-providers/dotnet-external-provider/Dockerfile +++ b/external-providers/dotnet-external-provider/Dockerfile @@ -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 diff --git a/external-providers/generic-external-provider/Dockerfile b/external-providers/generic-external-provider/Dockerfile index 7eb08930..49e0f9eb 100644 --- a/external-providers/generic-external-provider/Dockerfile +++ b/external-providers/generic-external-provider/Dockerfile @@ -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 diff --git a/external-providers/golang-dependency-provider/Dockerfile b/external-providers/golang-dependency-provider/Dockerfile index 6cdeef8e..9bd39cf9 100644 --- a/external-providers/golang-dependency-provider/Dockerfile +++ b/external-providers/golang-dependency-provider/Dockerfile @@ -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 diff --git a/external-providers/java-external-provider/Dockerfile b/external-providers/java-external-provider/Dockerfile index 9a7e526f..e2661f72 100644 --- a/external-providers/java-external-provider/Dockerfile +++ b/external-providers/java-external-provider/Dockerfile @@ -1,5 +1,5 @@ # Build the manager binary -FROM golang:1.21 as builder +FROM golang:1.20 as builder COPY / /analyzer-lsp @@ -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 diff --git a/external-providers/yq-external-provider/Dockerfile b/external-providers/yq-external-provider/Dockerfile index 0333c5d2..7ef044d7 100644 --- a/external-providers/yq-external-provider/Dockerfile +++ b/external-providers/yq-external-provider/Dockerfile @@ -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