Skip to content

Commit

Permalink
ci for quarkus branch
Browse files Browse the repository at this point in the history
  • Loading branch information
Athou committed Aug 13, 2024
1 parent 5cea10c commit f82e573
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 50 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
commafeed-client
83 changes: 64 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on: [ push ]

env:
JAVA_VERSION: 21
DOCKER_BUILD_SUMMARY: false

jobs:
build-linux:
Expand Down Expand Up @@ -53,7 +54,7 @@ jobs:
# Docker
- name: Login to Container Registry
uses: docker/login-action@v3
if: ${{ github.ref_type == 'tag' || github.ref_name == 'master' }}
if: ${{ github.ref_type == 'tag' || github.ref_name == 'master' || github.ref_name == 'quarkus' }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
Expand All @@ -63,63 +64,107 @@ jobs:
uses: docker/build-push-action@v6
if: ${{ github.ref_type == 'tag' }}
with:
context: commafeed-server
file: src/main/docker/Dockerfile.native
context: .
file: commafeed-server/src/main/docker/Dockerfile.native
push: true
provenance: false
platforms: linux/amd64
tags: |
athou/commafeed:latest-native
athou/commafeed:${{ github.ref_name }}-native
athou/commafeed:latest-${{ matrix.database }}-native
athou/commafeed:${{ github.ref_name }}-${{ matrix.database }}-native
- name: Docker build and push tag - jvm
uses: docker/build-push-action@v6
if: ${{ github.ref_type == 'tag' }}
with:
context: commafeed-server
file: src/main/docker/Dockerfile.jvm
context: .
file: commafeed-server/src/main/docker/Dockerfile.jvm
push: true
provenance: false
platforms: linux/arm64/v8
tags: |
athou/commafeed:latest-jvm
athou/commafeed:${{ github.ref_name }}-jvm
athou/commafeed:latest-${{ matrix.database }}-jvm
athou/commafeed:${{ github.ref_name }}-${{ matrix.database }}-jvm
- name: Docker merge latest manifests
uses: Noelware/docker-manifest-action@0.4.2
if: ${{ github.ref_type == 'tag' }}
with:
inputs: athou/commafeed:latest-${{ matrix.database }}
images: athou/commafeed:latest-${{ matrix.database }}-native,athou/commafeed:latest-${{ matrix.database }}-jvm
push: true

- name: Docker merge tag manifests
uses: Noelware/docker-manifest-action@0.4.2
if: ${{ github.ref_type == 'tag' }}
with:
inputs: athou/commafeed:latest
images: athou/commafeed:latest-native,athou/commafeed:latest-jvm
inputs: athou/commafeed:${{ github.ref_name }}-${{ matrix.database }}
images: athou/commafeed:${{ github.ref_name }}-${{ matrix.database }}-native,athou/commafeed:${{ github.ref_name }}-${{ matrix.database }}-jvm
push: true

## master
- name: Docker build and push master - native
uses: docker/build-push-action@v6
if: ${{ github.ref_name == 'master' }}
with:
context: commafeed-server
file: src/main/docker/Dockerfile.native
context: .
file: commafeed-server/src/main/docker/Dockerfile.native
push: true
provenance: false
platforms: linux/amd64
tags: athou/commafeed:master-native
tags: athou/commafeed:master-${{ matrix.database }}-native

- name: Docker build and push master - jvm
uses: docker/build-push-action@v6
if: ${{ github.ref_name == 'master' }}
with:
context: commafeed-server
file: src/main/docker/Dockerfile.jvm
context: .
file: commafeed-server/src/main/docker/Dockerfile.jvm
push: true
provenance: false
platforms: linux/arm64/v8
tags: athou/commafeed:master-jvm
tags: athou/commafeed:master-${{ matrix.database }}-jvm

- name: Docker merge master manifests
uses: Noelware/docker-manifest-action@0.4.2
if: ${{ github.ref_name == 'master' }}
with:
inputs: athou/commafeed:master
images: athou/commafeed:master-native,athou/commafeed:master-jvm
inputs: athou/commafeed:master-${{ matrix.database }}
images: athou/commafeed:master-${{ matrix.database }}-native,athou/commafeed:master-${{ matrix.database }}-jvm
push: true

## quarkus branch - remove when merged into master, also remove the condition in the login step
- name: Docker build and push quarkus - native
uses: docker/build-push-action@v6
if: ${{ github.ref_name == 'quarkus' }}
with:
context: .
file: commafeed-server/src/main/docker/Dockerfile.native
push: true
provenance: false
platforms: linux/amd64
tags: athou/commafeed:quarkus-${{ matrix.database }}-native

- name: Docker build and push quarkus - jvm
uses: docker/build-push-action@v6
if: ${{ github.ref_name == 'quarkus' }}
with:
context: .
file: commafeed-server/src/main/docker/Dockerfile.jvm
push: true
provenance: false
platforms: linux/arm64/v8
tags: athou/commafeed:quarkus-${{ matrix.database }}-jvm

- name: Docker merge quarkus manifests
uses: Noelware/docker-manifest-action@0.4.2
if: ${{ github.ref_name == 'quarkus' }}
with:
inputs: athou/commafeed:quarkus-${{ matrix.database }}
images: athou/commafeed:quarkus-${{ matrix.database }}-native,athou/commafeed:quarkus-${{ matrix.database }}-jvm
push: true


build-windows:
runs-on: windows-latest
strategy:
Expand Down
2 changes: 1 addition & 1 deletion commafeed-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.commafeed</groupId>
<artifactId>commafeed</artifactId>
<version>4.6.0</version>
<version>5.0.0-beta</version>
</parent>
<artifactId>commafeed-client</artifactId>
<name>CommaFeed Client</name>
Expand Down
4 changes: 2 additions & 2 deletions commafeed-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.commafeed</groupId>
<artifactId>commafeed</artifactId>
<version>4.6.0</version>
<version>5.0.0-beta</version>
</parent>
<artifactId>commafeed-server</artifactId>
<name>CommaFeed Server</name>
Expand Down Expand Up @@ -229,7 +229,7 @@
<dependency>
<groupId>com.commafeed</groupId>
<artifactId>commafeed-client</artifactId>
<version>4.6.0</version>
<version>5.0.0-beta</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,20 @@

import java.security.SecureRandom;
import java.util.Base64;
import java.util.Set;

import io.quarkus.security.identity.IdentityProviderManager;
import io.quarkus.security.identity.SecurityIdentity;
import io.quarkus.security.identity.request.AuthenticationRequest;
import io.quarkus.vertx.http.runtime.FormAuthConfig;
import io.quarkus.vertx.http.runtime.FormAuthRuntimeConfig;
import io.quarkus.vertx.http.runtime.HttpBuildTimeConfig;
import io.quarkus.vertx.http.runtime.HttpConfiguration;
import io.quarkus.vertx.http.runtime.security.ChallengeData;
import io.quarkus.vertx.http.runtime.security.FormAuthenticationMechanism;
import io.quarkus.vertx.http.runtime.security.HttpAuthenticationMechanism;
import io.quarkus.vertx.http.runtime.security.HttpCredentialTransport;
import io.quarkus.vertx.http.runtime.security.PersistentLoginManager;
import io.smallrye.mutiny.Uni;
import io.vertx.core.http.Cookie;
import io.vertx.core.http.impl.ServerCookie;
import io.vertx.ext.web.RoutingContext;
import jakarta.annotation.Priority;
import jakarta.inject.Singleton;
import lombok.experimental.Delegate;
import lombok.extern.slf4j.Slf4j;

/**
Expand All @@ -37,6 +31,7 @@ public class CookieMaxAgeFormAuthenticationMechanism implements HttpAuthenticati
// the temp encryption key, persistent across dev mode restarts
static volatile String encryptionKey;

@Delegate
private final FormAuthenticationMechanism delegate;

public CookieMaxAgeFormAuthenticationMechanism(HttpConfiguration httpConfiguration, HttpBuildTimeConfig buildTimeConfig) {
Expand Down Expand Up @@ -86,26 +81,6 @@ public void save(String value, RoutingContext context, String cookieName, Restor
landingPage, redirectAfterLogin, locationCookie, cookieSameSite, cookiePath, loginManager);
}

@Override
public Uni<SecurityIdentity> authenticate(RoutingContext context, IdentityProviderManager identityProviderManager) {
return delegate.authenticate(context, identityProviderManager);
}

@Override
public Uni<ChallengeData> getChallenge(RoutingContext context) {
return delegate.getChallenge(context);
}

@Override
public Set<Class<? extends AuthenticationRequest>> getCredentialTypes() {
return delegate.getCredentialTypes();
}

@Override
public Uni<HttpCredentialTransport> getCredentialTransport(RoutingContext context) {
return delegate.getCredentialTransport(context);
}

private static String startWithSlash(String page) {
if (page == null) {
return null;
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.commafeed</groupId>
<artifactId>commafeed</artifactId>
<version>4.6.0</version>
<version>5.0.0-beta</version>
<name>CommaFeed</name>
<packaging>pom</packaging>

Expand Down

0 comments on commit f82e573

Please sign in to comment.