Skip to content

Commit

Permalink
Scratch work.
Browse files Browse the repository at this point in the history
  • Loading branch information
joliver committed Sep 19, 2018
1 parent 4eaf8bb commit 3f93a40
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 31 deletions.
54 changes: 33 additions & 21 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,37 @@ FROM maven:3.5.4-jdk-8-alpine
COPY . /code
WORKDIR /code

RUN apk add -u make git gnupg \
&& wget -O - "https://github.com/smartystreets/version-tools/releases/download/0.0.6/release.tar.gz" | tar -xz -C /usr/local/bin/ \
&& cp -r lib/.gnupg ~/.gnupg

ARG OSSRH_PASSWORD
RUN sed -i -r "s%<servers>%<servers>\
<server>\
<id>ossrh</id>\
<username>smartystreets</username>\
<password>${OSSRH_PASSWORD}</password>\
</server>%g" /usr/share/maven/conf/settings.xml
RUN sed -i -r "s%<profiles>%<profiles>\
<profile>\
<id>ossrh</id>\
<activation>\
<activeByDefault>true</activeByDefault>\
</activation>\
<properties>\
<gpg.executable>gpg</gpg.executable>\
<gpg.keyname>DBDF05C4</gpg.keyname>\
</properties>\
</profile>%g" /usr/share/maven/conf/settings.xml
ARG JAVA_GPG_PASSPHRASE

RUN true \
&& apk add -u make git gnupg \
&& wget -O - "https://github.com/smartystreets/version-tools/releases/download/0.0.6/release.tar.gz" | tar -xz -C /usr/local/bin/ \
&& mkdir -p ~/.m2 && cp lib/settings.xml ~/.m2/ \
&& sed -i -r "s/PASSWORD/${OSSRH_PASSWORD}/g" ~/.m2/settings.xml \
&& sed -i -r "s/PASSPHRASE/${JAVA_GPG_PASSPHRASE}/g" ~/.m2/settings.xml \
&& true

# && mkdir -p ~/.gnupg \
# && chmod 700 ~/.gnupg
# && echo "allow-loopback-pinentry" > ~/.gnupg/gpg-agent.conf
# && cp -r lib/.gnupg ~/ \
# GPG_OPTS='--pinentry-mode loopback' \
# ARG OSSRH_PASSWORD
# RUN sed -i -r "s%<servers>%<servers>\
# <server>\
# <id>ossrh</id>\
# <username>smartystreets</username>\
# <password>${OSSRH_PASSWORD}</password>\
# </server>%g" /usr/share/maven/conf/settings.xml
# RUN sed -i -r "s%<profiles>%<profiles>\
# <profile>\
# <id>ossrh</id>\
# <activation>\
# <activeByDefault>true</activeByDefault>\
# </activation>\
# <properties>\
# <gpg.executable>gpg</gpg.executable>\
# <gpg.keyname>DBDF05C4</gpg.keyname>\
# </properties>\
# </profile>%g" /usr/share/maven/conf/settings.xml
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ services:
context: .
args:
- OSSRH_PASSWORD
- JAVA_GPG_PASSPHRASE
volumes:
- .:/code
environment:
- SMARTY_AUTH_ID
- SMARTY_AUTH_TOKEN
- JAVA_GPG_PASSPHRASE
Binary file modified lib/.gnupg/trustdb.gpg
Binary file not shown.
23 changes: 23 additions & 0 deletions lib/settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
<servers>
<server>
<id>ossrh</id>
<username>smartystreets</username>
<password>PASSWORD</password>
</server>
</servers>
<profiles>
<profile>
<id>gpg</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<gpg.executable>gpg2</gpg.executable>
<gpg.keyname>DBDF05C4</gpg.keyname>
<gpg.passphrase>PASSPHRASE</gpg.passphrase>
</properties>
</profile>
</profiles>
</settings>
12 changes: 3 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,9 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
Expand Down

0 comments on commit 3f93a40

Please sign in to comment.