Skip to content

Add target to publish dev snapshots to a maven repository #386

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

Merged
merged 5 commits into from
Jan 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ jobs:
- name: Set up JDK 1.8
uses: actions/setup-java@v3
with:
java-version: 1.8
java-version: 8
distribution: corretto

- name: Runtime Interface Client smoke tests - Run 'pr' target
working-directory: ./aws-lambda-java-runtime-interface-client
Expand All @@ -37,7 +38,8 @@ jobs:
- name: Set up JDK 1.8
uses: actions/setup-java@v3
with:
java-version: 1.8
java-version: 8
distribution: corretto

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
Expand All @@ -58,5 +60,5 @@ jobs:
uses: actions/upload-artifact@v3
with:
name: the-jar
path: ./aws-lambda-java-runtime-interface-client/target/aws-lambda-java-runtime-interface-client-2.1.0.jar
path: ./aws-lambda-java-runtime-interface-client/target/aws-lambda-java-runtime-interface-client-*.jar

1 change: 1 addition & 0 deletions aws-lambda-java-runtime-interface-client/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
compile-flags.txt
ric-dev-environment/dev-maven-repo.mk
8 changes: 8 additions & 0 deletions aws-lambda-java-runtime-interface-client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ ARCHITECTURE := $(shell arch)
ARCHITECTURE_ALIAS := $($(shell echo "$(ARCHITECTURE)_ALIAS"))
ARCHITECTURE_ALIAS := $(or $(ARCHITECTURE_ALIAS),amd64) # on any other archs defaulting to amd64

# This optional module exports MAVEN_REPO_URL, MAVEN_REPO_USERNAME and MAVEN_REPO_PASSWORD environment variables
# making it possible to publish resulting artifacts to a development maven repository
-include ric-dev-environment/dev-maven-repo.mk

.PHONY: target
target:
$(info ${HELP_MESSAGE})
Expand Down Expand Up @@ -42,6 +46,10 @@ pr: test test-smoke
build:
mvn clean install

.PHONY: publish
publish:
mvn deploy --settings ric-dev-environment/settings.xml

define HELP_MESSAGE

Usage: $ make [TARGETS]
Expand Down
16 changes: 14 additions & 2 deletions aws-lambda-java-runtime-interface-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<jacoco.maven.plugin.version>0.8.7</jacoco.maven.plugin.version>
<jacoco.maven.plugin.version>0.8.8</jacoco.maven.plugin.version>
<!--
The test/integration/codebuild/buildspec.*.yml files will set -DmultiArch=false
as a workaround for executing within Github Actions. At time of writing (2022-04-08) the
Expand Down Expand Up @@ -115,7 +115,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.10.1</version>
<configuration>
<encoding>UTF-8</encoding>
<source>${maven.compiler.source}</source>
Expand All @@ -125,6 +125,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.3.0</version>
<configuration>
<archive>
<manifest>
Expand Down Expand Up @@ -183,6 +184,17 @@
<profiles>
<profile>
<id>dev</id>
<activation>
<file>
<exists>ric-dev-environment/dev-maven-repo.mk</exists>
</file>
</activation>
<distributionManagement>
<snapshotRepository>
<id>dev-snapshot-repo</id>
<url>${env.MAVEN_REPO_URL}</url>
</snapshotRepository>
</distributionManagement>
<build>
<plugins>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<settings>
<profiles>
<profile>
<id>dev</id>
<activation>
<file>
<exists>dev-maven-repo.mk</exists>
</file>
</activation>
<repositories>
<repository>
<id>dev-snapshot-repo</id>
<url>${env.MAVEN_REPO_URL}</url>
</repository>
</repositories>
</profile>
</profiles>
<servers>
<server>
<id>dev-snapshot-repo</id>
<username>${env.MAVEN_REPO_USERNAME}</username>
<password>${env.MAVEN_REPO_PASSWORD}</password>
</server>
</servers>
</settings>
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,18 @@ FROM public.ecr.aws/amazoncorretto/amazoncorretto:8
ARG ARCHITECTURE="amd64"

ENV DOCKER_CLI_PLUGIN_DIR="/root/.docker/cli-plugins"
ENV PATH="$PATH:/tmp/apache-maven-3.8.6/bin"

RUN amazon-linux-extras enable docker && \
yum clean metadata && \
yum install -y docker tar maven unzip file wget
yum install -y docker tar gzip unzip file wget

RUN mkdir -p "${DOCKER_CLI_PLUGIN_DIR}"
RUN wget \
"$(curl https://api.github.com/repos/docker/buildx/releases/latest | grep browser_download_url | grep "linux-${ARCHITECTURE}" | cut -d '"' -f 4)" \
-O "${DOCKER_CLI_PLUGIN_DIR}"/docker-buildx
RUN chmod +x "${DOCKER_CLI_PLUGIN_DIR}"/docker-buildx

WORKDIR /tmp
RUN curl -O https://dlcdn.apache.org/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.tar.gz && \
tar xf apache-maven-3.8.6-bin.tar.gz