Skip to content

Commit d964745

Browse files
committed
Merge remote-tracking branch 'origin/master' into develop
2 parents aea0813 + 9f9fa02 commit d964745

File tree

8 files changed

+72
-92
lines changed

8 files changed

+72
-92
lines changed

Dockerfile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
FROM openjdk:8-jdk-alpine
2+
3+
ENV VERSION=
4+
ENV NEXT_VERSION=
5+
ENV GPG_PASSPHRASE=
6+
ARG GIT_EMAIL=
7+
ARG FULL_NAME=
8+
9+
ARG MAVEN_VERSION=3.3.9
10+
ARG USER_HOME_DIR="/root"
11+
ENV MAVEN_HOME /usr/share/maven
12+
ENV MAVEN_CONFIG "$USER_HOME_DIR/.m2"
13+
# speed up Maven JVM a bit
14+
ENV MAVEN_OPTS="-XX:+TieredCompilation -XX:TieredStopAtLevel=1"
15+
16+
VOLUME /gpg
17+
VOLUME /maven
18+
VOLUME /ssh
19+
20+
COPY maven-release.sh /maven-release.sh
21+
22+
# Install Maven, Git and gpg
23+
RUN apk add --no-cache curl tar bash git gnupg openssh
24+
RUN mkdir -p /usr/share/maven && \
25+
curl -fsSL http://apache.osuosl.org/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz | tar -xzC /usr/share/maven --strip-components=1 && \
26+
ln -s /usr/share/maven/bin/mvn /usr/bin/mvn
27+
RUN git config --global user.email ${GIT_EMAIL} && \
28+
git config --global user.name ${FULL_NAME}
29+
30+
# Configure gpg
31+
RUN export GPG_TTY=/dev/console
32+
RUN export GPG_OPTS='--pinentry-mode loopback'
33+
34+
RUN ["chmod", "+x", "/maven-release.sh"]
35+
ENTRYPOINT /maven-release.sh

GETTING-STARTED.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
#### 1. Install the ConvertAPI library
22

3-
Go to [ConvertAPI Java client](https://github.com/ConvertAPI/convertapi-java) page and download JAR file.
4-
Place JAR in to your project library directory.
5-
3+
Go to the [ConvertAPI Java client](https://github.com/ConvertAPI/convertapi-java) page and download the JAR file.
4+
Place JAR into your project library directory.
5+
6+
The library is also available in Maven.
7+
Add the following dependency to your pom.xml:
8+
```xml
9+
<dependency>
10+
<groupId>com.convertapi.client</groupId>
11+
<artifactId>convertapi</artifactId>
12+
<version>2.2</version>
13+
</dependency>
14+
```
615

716
#### 2.a. Simple conversion methods
817

@@ -22,7 +31,7 @@ ConvertApi.convertRemoteFile("https://cdn.convertapi.com/cara/testfiles/document
2231
```
2332

2433

25-
#### 2.b. Convert local file
34+
#### 2.b. Convert a local file
2635

2736
```java
2837
import com.convertapi.*;
@@ -37,7 +46,7 @@ ConvertApi.convert("docx", "pdf",
3746
```
3847

3948

40-
#### 2.c. Convert remote file and set additional parameters
49+
#### 2.c. Convert a remote file and set additional parameters
4150

4251
```java
4352
import com.convertapi.*;
@@ -149,4 +158,4 @@ https://www.convertapi.com/doc/supported-formats
149158

150159
#### 6. GitHub
151160

152-
https://github.com/ConvertAPI/convertapi-java
161+
https://github.com/ConvertAPI/convertapi-java

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ int secondsLeft = user.SecondsLeft;
9191

9292
### More examples
9393

94-
You can find more advanced examples in the [examples](https://github.com/ConvertAPI/convertapi-java/tree/master/src/main/java/com/convertapi/examples) folder.
94+
You can find more advanced examples in the [examples](https://github.com/ConvertAPI/convertapi-java/tree/master/examples/src/main/java/com/convertapi/examples) folder.
9595

9696
#### Converting your first file, full example:
9797

convertapi.iml

Lines changed: 0 additions & 18 deletions
This file was deleted.

examples/src/main/java/com/convertapi/examples/AlternativeConverter.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
* https://www.convertapi.com/docx-to-pdf
2020
* https://www.convertapi.com/docx-to-png
2121
*/
22+
2223
public class AlternativeConverter {
2324

2425
public static void main(String[] args) throws IOException, ExecutionException, InterruptedException {
@@ -33,4 +34,4 @@ public static void main(String[] args) throws IOException, ExecutionException, I
3334

3435
System.out.println("PDF file saved to: " + pdfResult.get().saveFile(tempDir).get());
3536
}
36-
}
37+
}

maven-release-snapshot.sh

Lines changed: 0 additions & 38 deletions
This file was deleted.

maven-release.sh

100755100644
Lines changed: 17 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,25 @@
11
#!/bin/sh
22

3-
# Usage: ./maven-release.sh v2.0 2.1-SNAPSHOT 2.0
4-
53
branch_to_release="master"
4+
set -e
5+
6+
echo "Set private key..."
7+
cp -vr /gpg ~/.gnupg
8+
echo "pinentry-mode loopback" > ~/.gnupg/gpg.conf
9+
cp -vpr /maven ~/.m2
10+
cp -vr /ssh ~/.ssh
11+
12+
echo "Cloning convertapi-java..."
13+
ssh-keyscan github.com >> ~/.ssh/known_hosts
14+
git clone git@github.com:ConvertAPI/convertapi-java.git
15+
cd convertapi-java
616

717
echo "Switching to the release branch..."
818
git fetch
919
git checkout $branch_to_release
1020

11-
echo "Pulling changes..."
12-
git pull --ff-only
13-
14-
echo "Push commits..."
15-
git push
16-
17-
echo "Revert uncommitted changes..."
18-
git checkout .
19-
20-
echo "Cleaning..."
21-
mvn clean
22-
2321
echo "Preparing release..."
24-
if [ $# -eq 1 ]
25-
then
26-
echo "\n\n" | mvn release:prepare -Dtag=$1 -Dresume=false
27-
elif [ $# -eq 2 ]
28-
then
29-
echo "\n" | mvn release:prepare -DdevelopmentVersion=$2 -Dtag=$1 -Dresume=false
30-
elif [ $# -eq 3 ]
31-
then
32-
mvn release:prepare -DreleaseVersion=$3 -DdevelopmentVersion=$2 -Dtag=$1 -Dresume=false
33-
else
34-
echo "\n\n\n" | mvn release:prepare -Dresume=false
35-
fi
22+
mvn release:prepare -DreleaseVersion=${VERSION} -DdevelopmentVersion=${NEXT_VERSION} -Dtag=v${VERSION} -Dresume=false -Darguments=-Dgpg.passphrase=${GPG_PASSPHRASE}
3623

3724
echo "Performing release..."
3825
mvn release:perform
@@ -42,3 +29,7 @@ git push --tags
4229

4330
echo "Push release commits..."
4431
git push
32+
33+
echo "-------------------------------------------------------------"
34+
echo "SUCCESSFULLY released ${VERSION} to Maven Central repository."
35+
echo "-------------------------------------------------------------"

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<artifactId>convertapi</artifactId>
55
<packaging>jar</packaging>
66

7-
<version>2.2-SNAPSHOT </version>
7+
<version>2.4-SNAPSHOT </version>
88
<name>ConvertAPI Java Client</name>
99
<description>
1010
The ConvertAPI helps converting various file formats.
@@ -133,7 +133,7 @@
133133
<configuration>
134134
<serverId>ossrh</serverId>
135135
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
136-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
136+
<autoReleaseAfterClose>false</autoReleaseAfterClose>
137137
</configuration>
138138
</plugin>
139139

0 commit comments

Comments
 (0)