Skip to content

Commit

Permalink
issue-65: fix Docker build dependencies and create GitHub workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Lagrimas committed Apr 6, 2023
1 parent e8efabf commit 708dcb5
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build & publish OXO images

on:
push:
branches: [ "dev", "stable" ]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push OXO Docker image
run: |
docker build -t ghcr.io/ebispot/oxo-loader:${{ github.sha }} -f ./oxo-loader/Dockerfile .
docker build -t ghcr.io/ebispot/oxo-indexer:${{ github.sha }} -f ./oxo-indexer/Dockerfile .
docker build -t ghcr.io/ebispot/oxo-web:${{ github.sha }} -f ./oxo-web/Dockerfile .
docker tag ghcr.io/ebispot/oxo-loader:${{ github.sha }} ghcr.io/ebispot/oxo-loader:${{ github.ref_name }}
docker tag ghcr.io/ebispot/oxo-indexer:${{ github.sha }} ghcr.io/ebispot/oxo-indexer:${{ github.ref_name }}
docker tag ghcr.io/ebispot/oxo-web:${{ github.sha }} ghcr.io/ebispot/oxo-web:${{ github.ref_name }}
docker push --all-tags ghcr.io/ebispot/oxo-loader
docker push --all-tags ghcr.io/ebispot/oxo-indexer
docker push --all-tags ghcr.io/ebispot/oxo-web
Binary file added lib/sping-security-orcid-stateless-0.0.8.jar
Binary file not shown.
Binary file added lib/spring-data-jpa-1.10.8.RELEASE.jar
Binary file not shown.
Binary file added lib/spring-security-core-4.1.4.RELEASE.jar
Binary file not shown.
Binary file added lib/spring-security-oauth2-2.0.13.RELEASE.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions oxo-web/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ COPY pom.xml /opt/oxo/pom.xml
COPY oxo-web /opt/oxo/oxo-web
COPY oxo-model /opt/oxo/oxo-model
COPY oxo-indexer /opt/oxo/oxo-indexer
COPY lib /opt/oxo/lib
RUN mvn install:install-file -DcreateChecksum=true -Dpackaging=jar -Dfile=/opt/oxo/lib/sping-security-orcid-stateless-0.0.8.jar -DgroupId=uk.ac.ebi.spot -DartifactId=sping-security-orcid-stateless -Dversion=0.0.8
RUN mvn install:install-file -DcreateChecksum=true -Dpackaging=jar -Dfile=/opt/oxo/lib/spring-security-core-4.1.4.RELEASE.jar -DgroupId=org.springframework.security -DartifactId=spring-security-core -Dversion=4.1.4.RELEASE
RUN mvn install:install-file -DcreateChecksum=true -Dpackaging=jar -Dfile=/opt/oxo/lib/spring-security-oauth2-2.0.13.RELEASE.jar -DgroupId=org.springframework.security.oauth -DartifactId=spring-security-oauth2 -Dversion=2.0.13.RELEASE
RUN mvn install:install-file -DcreateChecksum=true -Dpackaging=jar -Dfile=/opt/oxo/lib/spring-data-jpa-1.10.8.RELEASE.jar -DgroupId=org.springframework.data -DartifactId=spring-data-jpa -Dversion=1.10.8.RELEASE
RUN cd /opt/oxo && mvn clean package -DskipTests

FROM openjdk:8-jre-alpine
Expand Down
18 changes: 18 additions & 0 deletions oxo-web/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,24 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>4.1.4.RELEASE</version>
</dependency>

<dependency>
<groupId>org.springframework.security.oauth</groupId>
<artifactId>spring-security-oauth2</artifactId>
<version>2.0.13.RELEASE</version>
</dependency>

<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>1.10.8.RELEASE</version>
</dependency>

</dependencies>

<packaging>war</packaging>
Expand Down

0 comments on commit 708dcb5

Please sign in to comment.