Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to build S3 extension and to bundle it with HawkBit master? #83

Closed
zyga opened this issue Jan 14, 2023 · 3 comments
Closed

How to build S3 extension and to bundle it with HawkBit master? #83

zyga opened this issue Jan 14, 2023 · 3 comments

Comments

@zyga
Copy link

zyga commented Jan 14, 2023

Hi

I've been trying to build S3 extension and to correctly bundle it with HawkBit master (since the tagged releases are very old). I've been trying several things but either, s3 extension is not bundled into HawkBit JAR or the build fails:

FROM ubuntu:22.04
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y openjdk-11-jdk-headless maven git
WORKDIR /src
RUN git clone https://github.com/eclipse/hawkbit
RUN git clone https://github.com/eclipse/hawkbit-extensions hawkbit/hawkbit-extensions
WORKDIR /src/hawkbit
RUN mvn install --batch-mode -DskipTests -T $(nproc) -Dmaven.artifact.threads=$(nproc)
WORKDIR /src/hawkbit/hawkbit-extensions/hawkbit-extension-artifact-repository-s3
RUN mvn install --batch-mode -DskipTests -T $(nproc) -Dmaven.artifact.threads=$(nproc)

This dockerfile works, but the extension is just built, not doing anything beyond that.

By following advice spread around this repository, I've added the following part:

WORKDIR /src/hawkbit
ARG HAWKBIT_EXTRA_DEPENDENCIES_S3="\n\
       <!-- Extension for using S3 as artifact storage. -->\n\
       <dependency>\n\
           <groupId>org.eclipse.hawkbit</groupId>\n\
           <artifactId>hawkbit-extension-artifact-repository-s3</artifactId>\n\
           <version>\${project.version}</version>\n\
       </dependency>"
RUN sed -i "s|<dependencies>|<dependencies>${HAWKBIT_EXTRA_DEPENDENCIES_S3}|" hawkbit-runtime/hawkbit-update-
server/pom.xml
RUN cp /src/hawkbit/hawkbit-extensions/hawkbit-extension-artifact-repository-s3/target/hawkbit-extension-artifact-repository-s3-*.jar /src/hawkbit/hawkbit-runtime/hawkbit-update-server/src/main/resources/
RUN mvn install --batch-mode -DskipTests -T $(nproc) -Dmaven.artifact.threads=$(nproc)

But this fails to build with:

#26 30.58 [ERROR] Failed to execute goal on project hawkbit-update-server: Could not resolve dependencies for project org.eclipse.hawkbit:hawkbit-update-server:jar:0.3.0-SNAPSHOT: Failed to collect dependencies at org.eclipse.hawkbit:hawkbit-extension-artifact-repository-s3:jar:0.3.0-SNAPSHOT: Failed to read artifact descriptor for org.eclipse.hawkbit:hawkbit-extension-artifact-repository-s3:jar:0.3.0-SNAPSHOT: Could not find artifact org.eclipse.hawkbit:hawkbit-extensions-parent:pom:0.3.0-SNAPSHOT in vaadin-addons (https://maven.vaadin.com/vaadin-addons) -> [Help 1]

I'm unfamiliar with maven/pom files. What am I doing wrong? Is the location of the extension source code relative to hawkbit a factor?

@zyga
Copy link
Author

zyga commented Jan 18, 2023

I've resolved this issue and managed to build everything. I will try to contribute a CI pipeline (I'm an Eclipse committer so it's easier) that will self-document and verify this at the same time.

@zyga
Copy link
Author

zyga commented Feb 1, 2023

I've posted a patch that adds basic build CI to #85

@zyga
Copy link
Author

zyga commented Feb 3, 2023

I've added a required dependency to use S3 extension with AWS and token authentication to #86

@zyga zyga closed this as completed Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant