Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add github actions and image build #32

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions .github/workflows/maven-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: build on maven

on:
watch:
types: [started]
pull_request:
types: [opened, reopened, edited, synchronize, ready_for_review]
push:
branches:
- main
- master
- '**'
workflow_dispatch:

jobs:
verify:
name: verify with maven
runs-on: ubuntu-latest
env:
MAVEN_OPTS: "-Xmx4096m -Xms2048m -XX:MaxMetaspaceSize=4096m -Xss8m"
steps:
- uses: actions/checkout@v4

- name: Set up JDK 8 & 11 for x64
uses: actions/setup-java@v3
with:
distribution: 'temurin'
architecture: x64
java-version: |
8
11

- uses: s4u/[email protected]
with:
sonatypeSnapshots: true

- name: Build the Maven verify phase
run: mvn -B -V clean install

- name: Checkout tools repo
if: ${{ github.event_name == 'push' }}
uses: actions/checkout@v4
with:
repository: Shokakucarrier/commonjava-images
path: commonjava-images

- name: Locate artifacts
if: ${{ github.event_name == 'push' }}
id: locate-artifacts
run: |
jar=$(ls -d $PWD/target/reptoro-*-fat.jar)
cp "$jar" "commonjava-images/reptoro/app.jar"

- name: Log in to Quay.io
if: ${{ github.event_name == 'push' }}
uses: redhat-actions/podman-login@v1
with:
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_TOKEN }}
registry: quay.io

- name: Buildah build
if: ${{ github.event_name == 'push' }}
id: buildah-build
uses: redhat-actions/buildah-build@v2
with:
image: reptoro
tags: ${{ github.ref_name }}
platforms: linux/amd64
containerfiles: |
./commonjava-images/reptoro/Dockerfile
context: ./commonjava-images/reptoro/
build-args: |
jar_ur=app.jar

- name: Push To quay.io
if: ${{ github.event_name == 'push' }}
id: push-to-quay
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.buildah-build.outputs.image }}
tags: ${{ steps.buildah-build.outputs.tags }}
registry: quay.io/factory2
11 changes: 11 additions & 0 deletions .project
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,15 @@
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
</natures>
<filteredResources>
<filter>
<id>1701062264767</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
61 changes: 12 additions & 49 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,22 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.commonjava</groupId>
<artifactId>commonjava</artifactId>
<version>18</version>
</parent>

<groupId>com.commonjava.reptoro</groupId>
<artifactId>reptoro</artifactId>
<version>1.0-SNAPSHOT</version>

<scm>
<connection>scm:git:https://github.com/commonjava/reptoro</connection>
<developerConnection>scm:git:https://github.com/commonjava/reptoro</developerConnection>
<url>https://github.com/Commonjava/reptoro</url>
<tag>HEAD</tag>
</scm>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
Expand Down Expand Up @@ -336,56 +348,7 @@
<config>src/main/resources/conf/config.json</config>
</configuration>
</plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>fabric8-maven-plugin</artifactId>
<version>4.2.0</version>
<configuration>
<generateRoute>true</generateRoute>
<enableImageChangeTrigger>true</enableImageChangeTrigger>
<!-- <enableAutomaticTrigger>true</enableAutomaticTrigger>-->
<!--<resourceDir>./src/main/resources</resourceDir>-->
<!-- <resourceDir>src/main/resources</resourceDir>-->
<!-- <enableImageChangeTrigger>true</enableImageChangeTrigger>-->
<resources>
<labels>
<all>
<property>
<name>app</name>
<value>reptoro</value>
</property>
</all>
</labels>
</resources>
<images>
<image>
<name>quay.io/factory2/reptoro</name>
<build>
<dockerFileDir>${basedir}/src/main/docker</dockerFileDir>
<assembly>
<basedir>/deployments</basedir>
<descriptor>${project.basedir}/src/main/resources/assembly/release.xml</descriptor>
</assembly>
<env>
<JAVA_LIB_DIR>/deployments</JAVA_LIB_DIR>
<JAVA_MAIN_CLASS>${vertx.main.class}</JAVA_MAIN_CLASS>
</env>
</build>
</image>
</images>
</configuration>
<executions>
<execution>
<goals>
<goal>resource</goal>
<goal>build</goal>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>


</project>
47 changes: 0 additions & 47 deletions src/main/docker/Dockerfile

This file was deleted.

31 changes: 0 additions & 31 deletions src/main/docker/Eng_Ops_CA.crt

This file was deleted.

25 changes: 0 additions & 25 deletions src/main/docker/RH-IT-Root-CA.crt

This file was deleted.

22 changes: 0 additions & 22 deletions src/main/docker/Red_Hat_IS_CA.crt

This file was deleted.

31 changes: 0 additions & 31 deletions src/main/docker/paas_psi_redhat_com.crt

This file was deleted.