Skip to content

Commit

Permalink
Merge pull request #172 from julianu/master
Browse files Browse the repository at this point in the history
- automatic docker build
- removing deprecated cached compiler
  • Loading branch information
julianu authored Sep 2, 2021
2 parents 6b0343f + d4ff38c commit cf5bb1d
Show file tree
Hide file tree
Showing 11 changed files with 107 additions and 545 deletions.
37 changes: 36 additions & 1 deletion .github/workflows/maven-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,43 @@ jobs:
with:
path: |
staging/*.zip
staging/*.jar
upload-release-files: true
release-upload-url: ${{ steps.get_current_release.outputs.upload_url }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build_and_push_docker:
name: Push new Docker image to Docker Hub
runs-on: ubuntu-latest
needs: build
if: ${{ github.repository == 'mpc-bioinformatics/pia' && github.event_name != 'pull_request' }}
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}

steps:
- name: Check out the repo
uses: actions/checkout@v2

- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push the Docker dev image
if: ${{ github.event_name == 'push' }}
run: |
docker build -f ./Dockerfile-dev --tag julianusz/pia:dev ./
docker push julianusz/pia:dev
- name: Build and push the Docker release image
if: ${{ github.event_name == 'release' }}
run: |
version=${{ github.ref }}
version=(${version//\// })
version=${version[2]}
docker build -f ./Dockerfile --tag julianusz/pia:${version} ./
docker tag julianusz/pia:${version} julianusz/pia:latest
docker push julianusz/pia:${version}
docker push julianusz/pia:latest
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,3 @@ log/
logs/
target/
.idea/
/docker/
Dockerfile
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM eclipse-temurin:8-jre-focal

LABEL MAINTAINERS="Julian Uszkoreit <[email protected]>"\
description="Docker image for command line execution of PIA - Protein Inference Algorithms"

# prepare zip and wget
RUN apt-get update; \
apt-get install -y unzip wget; \
apt-get clean

#preparing directories
RUN mkdir -p /data/in; mkdir -p /data/out; mkdir -p /opt/pia;

# download latest PIA zip and uncompress
RUN cd /opt/pia; \
curl -s https://api.github.com/repos/mpc-bioinformatics/pia/releases/latest | grep -oP '"browser_download_url": "\K(.*pia.*.zip)(?=")' | wget -qi - -O pia.zip; \
unzip pia.zip; \
rm pia.zip; \
mv pia*.jar pia.jar;

# cleanup
RUN apt-get remove -y unzip wget;

ENTRYPOINT ["java", "-jar", "/opt/pia/pia.jar"]
CMD ["--help"]
34 changes: 34 additions & 0 deletions Dockerfile-dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# the building container
FROM maven:3-eclipse-temurin-8 AS builder

RUN mkdir -p /tmp/pia
COPY . /tmp/pia/
RUN mvn -f /tmp/pia/pom.xml -Dmaven.test.skip --settings /tmp/pia/.mvn/unblock-mirrors.xml package


# start the real container
FROM eclipse-temurin:8-jre-focal

LABEL MAINTAINERS="Julian Uszkoreit <[email protected]>"\
description="Docker image for command line execution of PIA - Protein Inference Algorithms"

# prepare zip and wget
RUN apt-get update; \
apt-get install -y unzip wget; \
apt-get clean

#preparing directories
RUN mkdir -p /data/in; mkdir -p /data/out; mkdir -p /opt/pia;

# copy just build PIA zip and uncompress
COPY --from=builder /tmp/pia/target/pia*.zip /opt/pia/pia.zip
RUN cd /opt/pia; \
unzip pia.zip; \
rm pia.zip; \
mv pia*.jar pia.jar;

# cleanup
RUN apt-get remove -y unzip wget;

ENTRYPOINT ["java", "-jar", "/opt/pia/pia.jar"]
CMD ["--help"]
11 changes: 2 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>de.mpc.pia</groupId>
<artifactId>pia</artifactId>
<version>1.4.0</version>
<version>1.4.1</version>
<name>PIA - Protein Inference Algorithms</name>
<url>https://github.com/mpc-bioinformatics/pia</url>

Expand Down Expand Up @@ -51,11 +51,10 @@
<xtandem-parser.version>1.13.0</xtandem-parser.version>
<compomics-utilities.version>5.0.24</compomics-utilities.version>
<biojava-ontology.version>4.2.8</biojava-ontology.version>
<gson.version>2.8.1</gson.version>
<gson.version>2.8.2</gson.version>
<picocli.version>4.6.1</picocli.version>
<sqlite4java.version>1.0.392</sqlite4java.version>
<sqlite-jdbc.version>3.20.1</sqlite-jdbc.version>
<ehcache.version>3.1.1</ehcache.version>
<xercesImpl.version>2.12.0</xercesImpl.version>

<!-- these are "internal" dependencies, the jar files are delivered together with the source -->
Expand Down Expand Up @@ -237,12 +236,6 @@
</dependency>
<!-- End SQlite support for MSF files -->

<dependency>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>${ehcache.version}</version>
</dependency>

<!-- needed by some testcases and testscenarios -->
<dependency>
<groupId>xerces</groupId>
Expand Down
Loading

0 comments on commit cf5bb1d

Please sign in to comment.