Skip to content

Commit

Permalink
Merge branch 'er-2.3.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
tkote committed Aug 16, 2021
2 parents 4f3ee69 + 469abc4 commit da422c8
Show file tree
Hide file tree
Showing 4 changed files with 119 additions and 90 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,14 @@ java -jar target/helidon-demo-mp.jar
export REMOTE_REPO_PREFIX=iad.ocir.io/some-tenant/some-path/
# イメージの作成とタグ付け
mvn exec:exec@docker-build [-Ddocker.file=<任意のDockerfileを指定したい場合>]
mvn -f pom-docker.xml exec:exec@docker-build [-Ddocker.file=<任意のDockerfileを指定したい場合>]
# iad.ocir.io/some-tenant/some-path/helidon-mp-demo への image push
mvn exec:exec@docker-push-latest exec:exec@docker-push-version
mvn -f pom-docker.xml exec:exec@docker-push-latest exec:exec@docker-push-version
# ローカル・イメージの作成だけ行いたい場合
# イメージの名前は helidon-mp-demo:{version} となる
mvn exec:exec@docker-local-build [-Ddocker.file=<任意のDockerfileを指定したい場合>]
mvn -f pom-docker.xml exec:exec@docker-local-build [-Ddocker.file=<任意のDockerfileを指定したい場合>]
```

```bash
Expand Down
104 changes: 104 additions & 0 deletions pom-docker.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<?xml version="1.0" encoding="UTF-8" ?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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>

<groupId>oracle.demo</groupId>
<artifactId>helidon-demo-mp</artifactId>
<version>2.3.0.0</version>
<!-- packaging>jar</packaging -->
<name>${project.artifactId}</name>

<properties>
<docker.repo.prefix></docker.repo.prefix>
<docker.repo.remote.prefix>${env.REMOTE_REPO_PREFIX}</docker.repo.remote.prefix>
<docker.file>Dockerfile</docker.file>
</properties>

<build>
<plugins>
<!-- making docker image -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<!-- docker build -->
<execution>
<id>docker-local-build</id>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>docker</executable>
<arguments>
<argument>build</argument>
<argument>-t</argument>
<argument>${docker.repo.prefix}${project.artifactId}:${project.version}</argument>
<argument>-t</argument>
<argument>${docker.repo.prefix}${project.artifactId}:latest</argument>
<argument>-f</argument>
<argument>${docker.file}</argument>
<argument>.</argument>
</arguments>
<workingDirectory>${project.basedir}</workingDirectory>
</configuration>
</execution>
<!-- docker build -->
<execution>
<id>docker-build</id>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>docker</executable>
<arguments>
<argument>build</argument>
<argument>-t</argument>
<argument>${docker.repo.prefix}${project.artifactId}:${project.version}</argument>
<argument>-t</argument>
<argument>${docker.repo.prefix}${project.artifactId}:latest</argument>
<argument>-t</argument>
<argument>${docker.repo.remote.prefix}${project.artifactId}:${project.version}</argument>
<argument>-t</argument>
<argument>${docker.repo.remote.prefix}${project.artifactId}:latest</argument>
<argument>-f</argument>
<argument>${docker.file}</argument>
<argument>.</argument>
</arguments>
<workingDirectory>${project.basedir}</workingDirectory>
</configuration>
</execution>
<!-- docker push to remote repo -->
<execution>
<id>docker-push-latest</id>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>docker</executable>
<arguments>
<argument>push</argument>
<argument>${docker.repo.remote.prefix}${project.artifactId}:latest</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>docker-push-version</id>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>docker</executable>
<arguments>
<argument>push</argument>
<argument>${docker.repo.remote.prefix}${project.artifactId}:${project.version}</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
90 changes: 4 additions & 86 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
<parent>
<groupId>io.helidon.applications</groupId>
<artifactId>helidon-mp</artifactId>
<version>2.3.0</version>
<version>2.3.2</version>
<relativePath />
</parent>

<groupId>oracle.demo</groupId>
<artifactId>helidon-demo-mp</artifactId>
<version>2.3.0.0</version>
<version>2.3.2.0</version>
<!-- packaging>jar</packaging -->
<name>${project.artifactId}</name>

Expand Down Expand Up @@ -123,14 +123,14 @@
<artifactId>apm-java-agent-tracer</artifactId>
<!-- version>RELEASE</version -->
<!-- /com/oracle/apm/agent/java/apm-java-agent-tracer/maven-metadata.xml -->
<version>1.0.1389</version>
<version>RELEASE</version>
</dependency>
<dependency>
<groupId>com.oracle.apm.agent.java</groupId>
<artifactId>apm-java-agent-helidon</artifactId>
<!-- version>RELEASE</version -->
<!-- /com/oracle/apm/agent/java/apm-java-agent-helidon/maven-metadata.xml -->
<version>1.0.1389</version>
<version>RELEASE</version>
</dependency>
</dependencies>
<repositories>
Expand Down Expand Up @@ -473,88 +473,6 @@
</configuration>
</plugin>

<!-- making docker image -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<!-- docker build -->
<execution>
<id>docker-local-build</id>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>docker</executable>
<arguments>
<argument>build</argument>
<argument>-t</argument>
<argument>${docker.repo.prefix}${project.artifactId}:${project.version}</argument>
<argument>-t</argument>
<argument>${docker.repo.prefix}${project.artifactId}:latest</argument>
<argument>-f</argument>
<argument>${docker.file}</argument>
<argument>.</argument>
</arguments>
<workingDirectory>${project.basedir}</workingDirectory>
</configuration>
</execution>
<!-- docker build -->
<execution>
<id>docker-build</id>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>docker</executable>
<arguments>
<argument>build</argument>
<argument>-t</argument>
<argument>${docker.repo.prefix}${project.artifactId}:${project.version}</argument>
<argument>-t</argument>
<argument>${docker.repo.prefix}${project.artifactId}:latest</argument>
<argument>-t</argument>
<argument>${docker.repo.remote.prefix}${project.artifactId}:${project.version}</argument>
<argument>-t</argument>
<argument>${docker.repo.remote.prefix}${project.artifactId}:latest</argument>
<argument>-f</argument>
<argument>${docker.file}</argument>
<argument>.</argument>
</arguments>
<workingDirectory>${project.basedir}</workingDirectory>
</configuration>
</execution>
<!-- docker push to remote repo -->
<execution>
<id>docker-push-latest</id>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>docker</executable>
<arguments>
<argument>push</argument>
<argument>${docker.repo.remote.prefix}${project.artifactId}:latest</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>docker-push-version</id>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>docker</executable>
<arguments>
<argument>push</argument>
<argument>${docker.repo.remote.prefix}${project.artifactId}:${project.version}</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>

</plugins>

</build>
Expand Down
9 changes: 8 additions & 1 deletion src/main/java/oracle/demo/tracing/TracingResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.Optional;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.stream.Collectors;

import javax.enterprise.context.ApplicationScoped;
import javax.ws.rs.POST;
Expand All @@ -11,6 +12,8 @@
import javax.ws.rs.client.Client;
import javax.ws.rs.client.ClientBuilder;
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.HttpHeaders;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
Expand All @@ -27,10 +30,14 @@ public class TracingResource{
@POST
@Path("/invoke")
@Produces(MediaType.TEXT_PLAIN)
public Response handleRequest(TraceOrder[] orders){
public Response handleRequest(TraceOrder[] orders, @Context HttpHeaders headers){

logger.info("!!! New request");

headers.getRequestHeaders().forEach((key, values) -> {
values.forEach(val -> logger.info(String.format("Header: %s=%s", key, val)));
});

// SpanContext spanContext = serverRequest.spanContext(); // you can comment out this line
// optional, you could also use GlobalTracer.get() if it is configured
// Tracer tracer = serverRequest.webServer().configuration().tracer(); // you can comment out this line
Expand Down

0 comments on commit da422c8

Please sign in to comment.