Skip to content

Remote repo configuration #6

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

Open
wants to merge 22 commits into
base: feature/enable-cookie-store-at-request-level
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 19 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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ test-output
MANIFEST.MF
work
atlassian-ide-plugin.xml

# Cached artifacts
/build-cache/*
!/build-cache/.keep
45 changes: 22 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
language: java
jdk:
- oraclejdk8
dist: xenial
language: minimal
sudo: true
services:
- docker

before_script:
- travis/before_script.sh
env:
global:
- SERVICE_NAME=async-http-client
- AWS_DEFAULT_REGION=ap-southeast-1
- REVISION=$(git rev-parse --short ${TRAVIS_COMMIT})
- secure: vto8UyM7tMHE4tUwxmYC150orDzrz/6b33m8V6+yh1uHWJmtqhyshsjLKFMmiqkAHz/7jmrgMMlHcnYJ27IyNJsqd4WNQfUjf9nRuizbRKD+yhy7R+IKbgy8bSYizyvQ/4T07sJkOcebzXJigTlOjxpwDfKgBj7vqr5paXrir0Srs0jjgyMxnASFYaBvy2i6wPyPqslkbwHwTapWg3porl/EmSj9rmgHVnPED5CPYraMp+zTHJCpP6xgGn1N3wS+x3sUDZ4MSHeZLXbaSzmIIUBNbYSUjOnEspD0Pi/78G1cl6sW7KiSIAt+H6hoy1+rU6J4RyB8M6pSvNJDlgnYfemG/6onTAXA5n/0+dcs1X2skA3GscOmPoEUuPYyKeQwk2eXK67UC7LNSu1HSAeIxPgwKv4axmFPv/2GJtM70HP28cR35gzyWMMhsxGT7tuKE7W83bEuT/nUzXCWCC80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oT96JSSEIO4lpfzafp4lXeD9oKp5t2Uk+Afz41x+e/OCoOW1VtUZi9VEiKbxcQCrwZRuHptTveJCi86zPeIokuUT+BBs0qQur960bq0c+XpkOC6tg3SLIQJJ/OSariiGfuap/A8ZObn9YFprmUYUUV9X8sOPuCBMOMQkqeG9DxNGEloHa9Xi+QpLTfFuLPvyp+PhZVYlMLvsH2GeWLNimlBqENaeKt/2DcO6pwf5TB0JcpV5tEPcjI3QVuqUEk6oXpwwAdoff4bN6Uafo3vKyQXEAsr26b590kxAhKxpI7nPmYtvHSkCfVxLh5Q2R6C0dpaGdamBRKjD+Lku2PJXE+lErk5SnK2BgBkiuuBaxVvUYO9RatucVVne+VDTJY6brcXJEEDs/myfK6lpF2cb5BM14l58iHWBQHmiDhGyl3CKRVXpavG9IuuVMf7siV0957ixCZstlU7J4RDwunGrl6RM3BQdj55atnHu+AKuy3piVy+NX+IimiaRsWw+N04pO3sAakG0fMa1YQ55RDOQ=

script:
- mvn test -Ptest-output
- find $HOME/.m2 -name "_remote.repositories" | xargs rm
- find $HOME/.m2 -name "resolver-status.properties" | xargs rm -f

# If building master, Publish to Sonatype
after_success:
- travis/after_success.sh
cache:
directories:
- build-cache

sudo: false
install:
- docker-compose -f docker-compose.yml build

# https://github.com/travis-ci/travis-ci/issues/3259
addons:
apt:
packages:
- oracle-java8-installer
script:
- docker-compose -f docker-compose.yml run ${SERVICE_NAME}

# Cache settings
cache:
directories:
- $HOME/.m2/repository
before_cache:
- docker-compose -f docker-compose.yml run --rm -v `pwd`/build-cache:/app/build-cache ${SERVICE_NAME} bash docker-utils.sh save-cache
40 changes: 40 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# wego-async-http-client stage
FROM maven:3.6-jdk-11-slim

# Install build dependencies
RUN apt-get -qq update && \
apt-get -qq install -y --no-install-recommends \
build-essential \
openssh-client \
&& rm -rf /var/lib/apt/lists/*

# Read repo args
ARG VERSION
ARG AWS_DEFAULT_REGION
ARG AWS_ACCESS_KEY_ID

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are these args still needed? if they're being passed as runtime env vars can remove from here

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah forgot again. removed now

ARG AWS_SECRET_ACCESS_KEY
ARG REPO_URL
ENV REPO_URL=${REPO_URL}
ENV VERSION=${VERSION}
ENV AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION}
ENV AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't need to assign here since its not available at build time

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. Stripped down all unwanted args and envs.

ENV AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}

WORKDIR /app
COPY . .

RUN mvn compile -U \
-Dmaven.test.skip=true \
-Dgpg.skip \
-DdistMgmtReleasesUrl=${REPO_URL}/releases \
-DdistMgmtSnapshotsUrl=${REPO_URL}/snapshots \
-DAWS_DEFAULT_REGION=${AWS_DEFAULT_REGION} \
-Dproject.version=${VERSION}

CMD mvn deploy -U \
-Dmaven.test.skip=true \
-Dgpg.skip \
-DdistMgmtReleasesUrl=${REPO_URL}/releases \
-DdistMgmtSnapshotsUrl=${REPO_URL}/snapshots \
-DAWS_DEFAULT_REGION=${AWS_DEFAULT_REGION} \
-Dproject.version=${VERSION}
Empty file added build-cache/.keep
Empty file.
2 changes: 1 addition & 1 deletion client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<parent>
<groupId>org.asynchttpclient</groupId>
<artifactId>async-http-client-project</artifactId>
<version>2.5.3-SNAPSHOT</version>
<version>${project.version}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>async-http-client</artifactId>
Expand Down
13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: "3.7"
services:
async-http-client:
build:
context: .
args:
REPO_URL: ${REPO_URL:?REPO_URL}
AWS_DEFAULT_REGION: ${AWS_DEFAULT_REGION:?AWS_DEFAULT_REGION}
VERSION: ${REVISION:?REVISION}
image: wego/async-http-client
environment:
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID:?AWS_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY:?AWS_SECRET_ACCESS_KEY}
37 changes: 37 additions & 0 deletions docker-utils.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#!/usr/bin/env bash

set -e

GRADLE_CACHE_ARCHIVE='build-cache/maven.tar.gz'
GRADLE_CACHE_DIR="/root/.m2/"

function __load_cache {
if [ -f "$GRADLE_CACHE_ARCHIVE" ]
then
mkdir $GRADLE_CACHE_DIR
tar -xzf $GRADLE_CACHE_ARCHIVE -C $GRADLE_CACHE_DIR
echo "Extracted $GRADLE_CACHE_ARCHIVE to $GRADLE_CACHE_DIR"
else
echo "$GRADLE_CACHE_ARCHIVE not found"
fi
}

function __save_cache {
# gzip without timestamps for consistent checksum
GZIP=-n tar -czf $GRADLE_CACHE_ARCHIVE --exclude='./daemon' --exclude='./native' --exclude='./notifications' -C $GRADLE_CACHE_DIR .
md5sum $GRADLE_CACHE_ARCHIVE
echo "Saved $GRADLE_CACHE_DIR to $GRADLE_CACHE_ARCHIVE"
}

case "$1" in
load-cache)
__load_cache
;;
save-cache)
__save_cache
;;
*)
echo 'Unknown command'
exit 1
esac

2 changes: 1 addition & 1 deletion example/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<parent>
<groupId>org.asynchttpclient</groupId>
<artifactId>async-http-client-project</artifactId>
<version>2.5.3-SNAPSHOT</version>
<version>${project.version}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>async-http-client-example</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions extras/guava/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<parent>
<groupId>org.asynchttpclient</groupId>
<artifactId>async-http-client-extras-parent</artifactId>
<version>2.5.3-SNAPSHOT</version>
<version>${project.version}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>async-http-client-extras-guava</artifactId>
Expand All @@ -18,4 +18,4 @@
<version>14.0.1</version>
</dependency>
</dependencies>
</project>
</project>
2 changes: 1 addition & 1 deletion extras/jdeferred/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<parent>
<artifactId>async-http-client-extras-parent</artifactId>
<groupId>org.asynchttpclient</groupId>
<version>2.5.3-SNAPSHOT</version>
<version>${project.version}</version>
</parent>
<artifactId>async-http-client-extras-jdeferred</artifactId>
<name>Asynchronous Http Client JDeferred Extras</name>
Expand Down
4 changes: 2 additions & 2 deletions extras/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<parent>
<groupId>org.asynchttpclient</groupId>
<artifactId>async-http-client-project</artifactId>
<version>2.5.3-SNAPSHOT</version>
<version>${project.version}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>async-http-client-extras-parent</artifactId>
Expand Down Expand Up @@ -32,7 +32,7 @@
<dependency>
<groupId>org.asynchttpclient</groupId>
<artifactId>async-http-client</artifactId>
<version>${project.version}</version>
<version>2.5.3-SNAPSHOT</version>
<scope>test</scope>
<classifier>tests</classifier>
</dependency>
Expand Down
4 changes: 2 additions & 2 deletions extras/registry/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<parent>
<groupId>org.asynchttpclient</groupId>
<artifactId>async-http-client-extras-parent</artifactId>
<version>2.5.3-SNAPSHOT</version>
<version>${project.version}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>async-http-client-extras-registry</artifactId>
<name>Asynchronous Http Client Registry Extras</name>
<description>
The Async Http Client Registry Extras.
</description>
</project>
</project>
2 changes: 1 addition & 1 deletion extras/retrofit2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>async-http-client-extras-parent</artifactId>
<groupId>org.asynchttpclient</groupId>
<version>2.5.3-SNAPSHOT</version>
<version>${project.version}</version>
</parent>

<artifactId>async-http-client-extras-retrofit2</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion extras/rxjava/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>async-http-client-extras-parent</artifactId>
<groupId>org.asynchttpclient</groupId>
<version>2.5.3-SNAPSHOT</version>
<version>${project.version}</version>
</parent>
<artifactId>async-http-client-extras-rxjava</artifactId>
<name>Asynchronous Http Client RxJava Extras</name>
Expand Down
2 changes: 1 addition & 1 deletion extras/rxjava2/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>async-http-client-extras-parent</artifactId>
<groupId>org.asynchttpclient</groupId>
<version>2.5.3-SNAPSHOT</version>
<version>${project.version}</version>
</parent>
<artifactId>async-http-client-extras-rxjava2</artifactId>
<name>Asynchronous Http Client RxJava2 Extras</name>
Expand Down
2 changes: 1 addition & 1 deletion extras/simple/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>async-http-client-extras-parent</artifactId>
<groupId>org.asynchttpclient</groupId>
<version>2.5.3-SNAPSHOT</version>
<version>${project.version}</version>
</parent>
<artifactId>async-http-client-extras-simple</artifactId>
<name>Asynchronous Http Simple Client</name>
Expand Down
2 changes: 1 addition & 1 deletion extras/typesafeconfig/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>async-http-client-extras-parent</artifactId>
<groupId>org.asynchttpclient</groupId>
<version>2.5.3-SNAPSHOT</version>
<version>${project.version}</version>
</parent>

<artifactId>async-http-client-extras-typesafe-config</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion netty-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<parent>
<groupId>org.asynchttpclient</groupId>
<artifactId>async-http-client-project</artifactId>
<version>2.5.3-SNAPSHOT</version>
<version>${project.version}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>async-http-client-netty-utils</artifactId>
Expand Down
59 changes: 45 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<groupId>org.asynchttpclient</groupId>
<artifactId>async-http-client-project</artifactId>
<name>Asynchronous Http Client Project</name>
<version>2.5.3-SNAPSHOT</version>
<version>${project.version}</version>
<packaging>pom</packaging>
<description>
The Async Http Client (AHC) library's purpose is to allow Java
Expand Down Expand Up @@ -77,6 +77,11 @@
<artifactId>maven-scm-manager-plexus</artifactId>
<version>1.6</version>
</extension>
<extension>
<groupId>com.gkatzioura.maven.cloud</groupId>
<artifactId>s3-storage-wagon</artifactId>
<version>1.8</version>
</extension>
</extensions>
<defaultGoal>install</defaultGoal>
<plugins>
Expand Down Expand Up @@ -151,6 +156,30 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>flatten-maven-plugin</artifactId>
<version>1.0.0</version>
<configuration>
<updatePomFile>true</updatePomFile>
</configuration>
<executions>
<execution>
<id>flatten</id>
<phase>process-resources</phase>
<goals>
<goal>flatten</goal>
</goals>
</execution>
<execution>
<id>flatten.clean</id>
<phase>clean</phase>
<goals>
<goal>clean</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
Expand Down Expand Up @@ -194,19 +223,18 @@
</properties>
</profile>
</profiles>
<distributionManagement>
<repository>
<id>sonatype-nexus-staging</id>
<name>Sonatype Release</name>
<url>http://oss.sonatype.org/service/local/staging/deploy/maven2
</url>
</repository>
<snapshotRepository>
<id>sonatype-nexus-snapshots</id>
<name>sonatype-nexus-snapshots</name>
<url>${distMgmtSnapshotsUrl}</url>
</snapshotRepository>
</distributionManagement>
<distributionManagement>
<repository>
<id>dist-release</id>
<name>dist-release</name>
<url>${distMgmtReleasesUrl}</url>
</repository>
<snapshotRepository>
<id>dist-snapshots</id>
<name>dist-snapshots</name>
<url>${distMgmtSnapshotsUrl}</url>
</snapshotRepository>
</distributionManagement>
<modules>
<module>netty-utils</module>
<module>client</module>
Expand Down Expand Up @@ -398,7 +426,10 @@
</dependency>
</dependencies>
<properties>
<version></version>
<project.version>2.5.3-SNAPSHOT</project.version>
<distMgmtSnapshotsUrl>http://oss.sonatype.org/content/repositories/snapshots</distMgmtSnapshotsUrl>
<distMgmtReleasesUrl>http://oss.sonatype.org/content/repositories/releases</distMgmtReleasesUrl>
<surefire.redirectTestOutputToFile>true</surefire.redirectTestOutputToFile>
<source.property>1.8</source.property>
<target.property>1.8</target.property>
Expand Down