Skip to content

Commit

Permalink
Fix GitHub build
Browse files Browse the repository at this point in the history
  • Loading branch information
derkoe committed May 31, 2023
1 parent 162e47b commit 47ecffe
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 25 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/build-test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,11 @@ jobs:
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build application
run: |
mvn $MAVEN_CLI_OPTS package jib:dockerBuild -Dimage=porscheinformatik/angular-spring-heroes
run: mvn $MAVEN_CLI_OPTS install spring-boot:build-image -Pnative -Dimage.name=docker.io/porscheinformatik/angular-spring-heroes
- name: Build acceptance tests
run: docker build -t heroes-acceptence-tests heroes-acceptence-tests
- name: Run app for tests
run: docker run --name ash -d --rm -p 8080:8080 porscheinformatik/angular-spring-heroes
run: docker run --name ash -d --rm -p 8080:8080 docker.io/porscheinformatik/angular-spring-heroes
- name: Sleep for 20s
uses: juliangruber/sleep-action@v1
with:
Expand All @@ -46,10 +45,10 @@ jobs:
run: docker stop ash
- name: Push image to Docker Hub
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
run: docker push porscheinformatik/angular-spring-heroes
run: docker push docker.io/porscheinformatik/angular-spring-heroes
- name: Push image to ghcr.io
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
run: |
echo ${{ secrets.GHCR_PASSWORD }} | docker login ghcr.io -u ${{ secrets.GHCR_USERNAME }} --password-stdin
docker tag porscheinformatik/angular-spring-heroes ghcr.io/porscheinformatik/angular-spring-heroes
docker tag docker.io/porscheinformatik/angular-spring-heroes ghcr.io/porscheinformatik/angular-spring-heroes
docker push ghcr.io/porscheinformatik/angular-spring-heroes
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ build:
stage: build
interruptible: true
variables:
MAVEN_CLI_OPTS: '--batch-mode --errors --fail-at-end --show-version -Ddocker.builderRegistry.username=$DOCKER_REGISTRY_USER -Ddocker.builderRegistry.password=$DOCKER_REGISTRY_PASSWORD -Ddocker.publishRegistry.username=$DOCKER_REGISTRY_USER -Ddocker.publishRegistry.password=$DOCKER_REGISTRY_PASSWORD'
MAVEN_CLI_OPTS: '-Ppoi --batch-mode --errors --fail-at-end --show-version -Ddocker.builderRegistry.username=$DOCKER_REGISTRY_USER -Ddocker.builderRegistry.password=$DOCKER_REGISTRY_PASSWORD -Ddocker.publishRegistry.username=$DOCKER_REGISTRY_USER -Ddocker.publishRegistry.password=$DOCKER_REGISTRY_PASSWORD'
services:
- name: docker.porscheinformatik.com/docker-proxy-dockerhub/docker:dind
alias: docker
Expand Down
28 changes: 9 additions & 19 deletions heroes-webapp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@

<properties>
<spring-boot.build-image.skip>false</spring-boot.build-image.skip>
<image.name>docker.io/porscheinformatik/angular-spring-heroes</image.name>
<image.tag>latest</image.tag>
<image.push>false</image.push>
<sonar.sources>pom.xml,src/main</sonar.sources>
Expand All @@ -104,9 +105,9 @@
</publishRegistry>
</docker>
<image>
<name>docker.porscheinformatik.com/koc/angular-spring-heroes:${image.tag}</name>
<builder>docker.porscheinformatik.com/eenv/paketo-buildpacks/builder:base</builder>
<runImage>docker.porscheinformatik.com/eenv/paketo-buildpacks/run</runImage>
<name>${image.name}:${image.tag}</name>
<builder>${buildpack.builder}</builder>
<runImage>${buildpack.runImage}</runImage>
<pullPolicy>IF_NOT_PRESENT</pullPolicy>
<publish>${image.push}</publish>
<bindings>
Expand All @@ -128,22 +129,11 @@
<profiles>
<profile>
<id>poi</id>
<build>
<plugins>
<plugin>
<groupId>com.google.cloud.tools</groupId>
<artifactId>jib-maven-plugin</artifactId>
<configuration>
<from>
<image>docker.porscheinformatik.com/eenv/service-java:17</image>
</from>
<container>
<entrypoint>INHERIT</entrypoint>
</container>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<image.name>docker.porscheinformatik.com/koc/angular-spring-heroes</image.name>
<buildpack.builder>docker.porscheinformatik.com/eenv/paketo-buildpacks/builder:base</buildpack.builder>
<buildpack.runImage>docker.porscheinformatik.com/eenv/paketo-buildpacks/run</buildpack.runImage>
</properties>
</profile>
</profiles>

Expand Down

0 comments on commit 47ecffe

Please sign in to comment.