Skip to content

Commit

Permalink
Repackage
Browse files Browse the repository at this point in the history
  • Loading branch information
making committed Apr 17, 2024
1 parent e461ff1 commit 5cdf577
Show file tree
Hide file tree
Showing 16 changed files with 33 additions and 69 deletions.
20 changes: 6 additions & 14 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
run: |
set -e
./mvnw -V --no-transfer-progress package -DskipTests
java -jar target/ssr-react-spring-boot-graalvm-js-0.0.1-SNAPSHOT.jar &
java -jar target/blog-frontend-0.0.1-SNAPSHOT.jar &
.github/workflows/wait.sh
curl --fail --show-error --silent http://localhost:8080
curl --fail --show-error --silent http://localhost:8080/posts/1
Expand All @@ -49,11 +49,11 @@ jobs:
run: |
set -e
./mvnw -V --no-transfer-progress -Pnative native:compile -DskipTests
./target/ssr-react-spring-boot-graalvm-js &
./target/blog-frontend &
.github/workflows/wait.sh
curl --fail --show-error --silent http://localhost:8080
curl --fail --show-error --silent http://localhost:8080/posts/1
pkill -KILL ssr-react-spring-boot-graalvm-js || true
pkill -KILL blog-frontend || true
- name: Import Secrets
if: github.ref == 'refs/heads/main'
id: secrets
Expand All @@ -77,19 +77,11 @@ jobs:
if: github.ref == 'refs/heads/main'
run: |
mkdir -p pack
mv ./target/ssr-react-spring-boot-graalvm-js ./pack
mv ./target/blog-frontend ./pack
cat <<EOF > pack/Procfile
web: ./ssr-react-spring-boot-graalvm-js
web: ./blog-frontend
EOF
pack build ghcr.io/${{ github.repository_owner }}/ssr-react-spring-boot-graalvm-js --gid 1000 --publish --builder paketobuildpacks/builder-jammy-tiny --path pack
- name: Install Fly
if: github.ref == 'refs/heads/main'
uses: superfly/flyctl-actions/setup-flyctl@master
- name: Deploy to Fly
if: github.ref == 'refs/heads/main'
run: |
cd fly
flyctl deploy -a ssr-react-spring-boot-graalvm-js --ha=false
pack build ghcr.io/${{ github.repository_owner }}/blog-frontend --gid 1000 --publish --builder paketobuildpacks/builder-jammy-tiny --path pack
- name: Revoke token
if: always()
run: |
Expand Down
4 changes: 0 additions & 4 deletions fly/README.md

This file was deleted.

30 changes: 0 additions & 30 deletions fly/fly.toml

This file was deleted.

14 changes: 10 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
<version>3.2.4</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>com.example</groupId>
<artifactId>ssr-react-spring-boot-graalvm-js</artifactId>
<groupId>am.ik.blog</groupId>
<artifactId>blog-frontend</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>ssr-react-spring-boot-graalvm-js</name>
<description>ssr-react-spring-boot-graalvm-js</description>
<name>blog-frontend</name>
<description>blog-frontend</description>
<properties>
<java.version>21</java.version>
<graalvm.version>24.0.0</graalvm.version>
Expand Down Expand Up @@ -55,6 +55,12 @@
<artifactId>access-logger</artifactId>
<version>0.2.0</version>
</dependency>
<dependency>
<groupId>cc.jilt</groupId>
<artifactId>jilt</artifactId>
<version>1.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example;
package am.ik.blog;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.config;
package am.ik.blog.config;

import am.ik.accesslogger.AccessLogger;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.config;
package am.ik.blog.config;

import org.springframework.aot.hint.RuntimeHintsRegistrar;
import org.springframework.context.annotation.Configuration;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.post;
package am.ik.blog.post;

public record Post(int id, String title, String body, int userId) {
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.post;
package am.ik.blog.post;

import org.springframework.boot.context.properties.ConfigurationProperties;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.post;
package am.ik.blog.post;

import java.util.List;
import java.util.Set;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.post;
package am.ik.blog.post;

import java.util.List;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.ssr;
package am.ik.blog.ssr;

import java.io.File;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package com.example.ssr;
package am.ik.blog.ssr;

import java.util.List;
import java.util.Map;

import com.example.post.Post;
import com.example.post.PostClient;
import am.ik.blog.post.Post;
import am.ik.blog.post.PostClient;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ management.metrics.distribution.percentiles-histogram.http.server.requests=true
management.tracing.sampling.probability=1.0
post-api.url=https://jsonplaceholder.typicode.com
server.compression.enabled=true
spring.application.name=post-ui
spring.application.name=blog-frontend
spring.web.resources.cache.period=1h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example;
package am.ik.blog;

import org.junit.jupiter.api.Test;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package com.example.ssr;
package am.ik.blog.ssr;

import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;

import com.example.post.Post;
import com.example.post.PostClient;
import am.ik.blog.post.Post;
import am.ik.blog.post.PostClient;
import com.gargoylesoftware.htmlunit.WebClient;
import com.gargoylesoftware.htmlunit.html.DomNode;
import com.gargoylesoftware.htmlunit.html.DomNodeList;
Expand All @@ -27,7 +27,7 @@
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

@WebMvcTest(controllers = SsrController.class, properties = "logging.level.com.example=trace")
@WebMvcTest(controllers = SsrController.class, properties = "logging.level.am.ik.blog=trace")
@Import(ReactRenderer.class)
class SsrControllerTest {

Expand Down

0 comments on commit 5cdf577

Please # to comment.