Skip to content

Commit

Permalink
Enable Docker CLI Build (winery#671)
Browse files Browse the repository at this point in the history
  • Loading branch information
lharzenetter authored Jun 15, 2022
1 parent 6ca7a09 commit e74b0d1
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 19 deletions.
23 changes: 19 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ jobs:
- name: Build with Maven
run: mvn -Pjava -B package
- name: Upload binary to artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: ${{ needs.pre_job.outputs.docker_run_required == 'true' }}
with:
name: artifacts
path: ${{ github.workspace }}/org.eclipse.winery.repository.rest/target/winery.war
path: |
**/winery.war
**/winery-cli.jar
- name: Run codacy-coverage-reporter
if: ${{ github.repository_owner == 'OpenTOSCA' }}
uses: codacy/codacy-coverage-reporter-action@master
Expand All @@ -73,7 +75,7 @@ jobs:
- name: Build with Maven
run: mvn -Pfrontend -B package
- name: Upload binary to artifacts
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: ${{ needs.pre_job.outputs.docker_run_required == 'true' }}
with:
name: artifacts
Expand All @@ -85,10 +87,15 @@ jobs:
if: ${{ needs.pre_job.outputs.docker_run_required == 'true' }}
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: artifacts
path: ${{ github.workspace }}
- name: Prepare artifacts
run: |
mv org.eclipse.winery.cli/target/winery-cli.jar winery-cli.jar
mv org.eclipse.winery.repository.rest/target/winery.war winery.war
ls -al
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
with:
Expand Down Expand Up @@ -123,3 +130,11 @@ jobs:
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.vars.outputs.tags }}
- name: Build and push latest CLI Docker image
uses: docker/build-push-action@v2
with:
context: .
file: Dockerfile.cli
platforms: linux/amd64,linux/arm64
push: true
tags: 'opentosca/winery-cli:latest'
21 changes: 9 additions & 12 deletions Dockerfile.cli
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
FROM maven:3-jdk-8 as builder
WORKDIR /tmp/winery
COPY . /tmp/winery
RUN mvn package -pl org.eclipse.winery.cli -am -DskipTests
RUN chmod u+x /tmp/winery/org.eclipse.winery.cli/target/winery.jar

FROM openjdk:8-jre
LABEL maintainer "Oliver Kopp <[email protected]>"
FROM openjdk:11-jre
LABEL maintainer "Oliver Kopp <[email protected]>, Lukas Harzenetter <[email protected]>"

RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash
RUN apt-get update && apt-get install -y git git-lfs
COPY --from=builder /tmp/winery/org.eclipse.winery.cli/target/winery.jar /usr/local/bin
COPY docker/winery /usr/local/bin
RUN chmod +x /usr/local/bin/winery

CMD winery
COPY winery-cli.jar /usr/local/bin
COPY docker/winery-cli /usr/local/bin

RUN chmod +x /usr/local/bin/winery-cli

CMD winery-cli
2 changes: 0 additions & 2 deletions docker/winery

This file was deleted.

2 changes: 2 additions & 0 deletions docker/winery-cli
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
java -jar /usr/local/bin/winery-cli.jar "$@"
2 changes: 1 addition & 1 deletion org.eclipse.winery.cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,6 @@
</executions>
</plugin>
</plugins>
<finalName>winery</finalName>
<finalName>winery-cli</finalName>
</build>
</project>

0 comments on commit e74b0d1

Please sign in to comment.