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

Updates package names #16

Open
wants to merge 8 commits into
base: main
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
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@


# EditorConfig is awesome: https://editorconfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2

[*.xml]
indent_size = 4
indent_style = tab
48 changes: 48 additions & 0 deletions .github/workflows/provide-docker-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Provide needed docker images in ghcr.io

on:
workflow_dispatch:
push:

env:
REGISTRY_IMAGE: ghcr.io/novatecconsulting/opentelemetry-training

jobs:
retag_and_push:
name: Provide docker image ${{ matrix.image.namespace }}/${{ matrix.image.name }}:${{ matrix.image.tag }} on ghcr.io
runs-on: [ubuntu-latest]
strategy:
matrix:
image:
- name: todobackend-springboot
tag: v2404
namespace: maeddes
- name: todoui-thymeleaf
tag: v2404
namespace: maeddes
- name: todoui-flask
tag: v2404
namespace: maeddes
- name: simple-generator
tag: v2404
namespace: maeddes
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Pull image from Docker Hub
run: |
docker pull docker.io/${{ matrix.image.namespace }}/${{ matrix.image.name }}:${{ matrix.image.tag }}
- name: Retag the image for GitHub Container Registry
run: |
docker tag ${{ matrix.image.namespace }}/${{ matrix.image.name }}:${{ matrix.image.tag }} ${{ env.REGISTRY_IMAGE }}-${{ matrix.image.name }}:${{ matrix.image.tag }}
- name: Push image to GitHub Container Registry
run: |
docker push ${{ env.REGISTRY_IMAGE }}-${{ matrix.image.name }}:${{ matrix.image.tag }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
*.jar

settings.json
.direnv
.devenv
.envrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker.io/maven:3-eclipse-temurin-21 as build
FROM docker.io/maven:3-eclipse-temurin-21 AS build
WORKDIR /workspace/app

COPY pom.xml .
Expand All @@ -20,4 +20,4 @@ COPY --from=build ${DEPENDENCY}/BOOT-INF/classes /opt/todobackend/app

ADD https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v2.8.0/opentelemetry-javaagent.jar /opt/todobackend

ENTRYPOINT ["java", "-cp", "/opt/todobackend/app:/opt/todobackend/app/lib/*", "-javaagent:/opt/todobackend/opentelemetry-javaagent.jar","io.novatec.todobackend.TodobackendApplication"]
ENTRYPOINT ["java", "-cp", "/opt/todobackend/app:/opt/todobackend/app/lib/*", "-javaagent:/opt/todobackend/opentelemetry-javaagent.jar","info.novatec.todobackend.TodobackendApplication"]
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<relativePath /> <!-- lookup parent from repository -->
</parent>

<groupId>io.novatec</groupId>
<groupId>info.novatec</groupId>
<artifactId>todobackend-automatic</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>todobackend-automatic</name>
Expand Down Expand Up @@ -53,6 +53,20 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
</exclusion>
<exclusion>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
</exclusion>
<exclusion>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy-agent</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.novatec.todobackend;
package info.novatec.todobackend;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -87,13 +87,13 @@ String someInternalMethod(String todo){
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
if(todo.equals("fail")){

System.out.println("Failing ...");
throw new RuntimeException();
}

}
return todo;

}
Expand Down Expand Up @@ -136,4 +136,4 @@ public void setTodo(String todo) {

interface TodoRepository extends CrudRepository<Todo, String> {

}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.novatec.todobackend;
package info.novatec.todobackend;

import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
Expand All @@ -9,4 +9,4 @@ public class TodobackendApplicationIntegrationTests {
@Test
void contextLoads() {
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker.io/maven:3-eclipse-temurin-21 as build
FROM docker.io/maven:3-eclipse-temurin-21 AS build
WORKDIR /workspace/app

COPY pom.xml .
Expand All @@ -20,4 +20,4 @@ COPY --from=build ${DEPENDENCY}/BOOT-INF/classes /opt/todobackend/app

ADD https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v2.8.0/opentelemetry-javaagent.jar /opt/todobackend

ENTRYPOINT ["java", "-cp", "/opt/todobackend/app:/opt/todobackend/app/lib/*", "-javaagent:/opt/todobackend/opentelemetry-javaagent.jar","io.novatec.todobackend.TodobackendApplication"]
ENTRYPOINT ["java", "-cp", "/opt/todobackend/app:/opt/todobackend/app/lib/*", "-javaagent:/opt/todobackend/opentelemetry-javaagent.jar","info.novatec.todobackend.TodobackendApplication"]
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<relativePath /> <!-- lookup parent from repository -->
</parent>

<groupId>io.novatec</groupId>
<groupId>info.novatec</groupId>
<artifactId>todobackend-automatic-solution</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>todobackend-automatic-solution</name>
Expand Down Expand Up @@ -53,6 +53,20 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
</exclusion>
<exclusion>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
</exclusion>
<exclusion>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy-agent</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>io.opentelemetry.instrumentation</groupId>
Expand All @@ -71,4 +85,4 @@
<finalName>todobackend-${version}</finalName>
</build>

</project>
</project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.novatec.todobackend;
package info.novatec.todobackend;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -91,13 +91,13 @@ String someInternalMethod(@SpanAttribute String todo){
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
if(todo.equals("fail")){

System.out.println("Failing ...");
throw new RuntimeException();
}

}
return todo;

}
Expand Down Expand Up @@ -140,4 +140,4 @@ public void setTodo(String todo) {

interface TodoRepository extends CrudRepository<Todo, String> {

}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.novatec.todobackend;
package info.novatec.todobackend;

import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
Expand All @@ -9,4 +9,4 @@ public class TodobackendApplicationIntegrationTests {
@Test
void contextLoads() {
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker.io/maven:3-eclipse-temurin-21 as build
FROM docker.io/maven:3-eclipse-temurin-21 AS build
WORKDIR /workspace/app

COPY pom.xml .
Expand All @@ -20,4 +20,4 @@ COPY --from=build ${DEPENDENCY}/BOOT-INF/classes /opt/todobackend/app

ADD https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v2.8.0/opentelemetry-javaagent.jar /opt/todobackend

ENTRYPOINT ["java", "-cp", "/opt/todobackend/app:/opt/todobackend/app/lib/*", "-javaagent:/opt/todobackend/opentelemetry-javaagent.jar","io.novatec.todobackend.TodobackendApplication"]
ENTRYPOINT ["java", "-cp", "/opt/todobackend/app:/opt/todobackend/app/lib/*", "-javaagent:/opt/todobackend/opentelemetry-javaagent.jar","info.novatec.todobackend.TodobackendApplication"]
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<relativePath /> <!-- lookup parent from repository -->
</parent>

<groupId>io.novatec</groupId>
<groupId>info.novatec</groupId>
<artifactId>todobackend-manual</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>todobackend-manual</name>
Expand Down Expand Up @@ -53,6 +53,20 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
</exclusion>
<exclusion>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
</exclusion>
<exclusion>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy-agent</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand All @@ -72,4 +86,4 @@
<finalName>todobackend-${version}</finalName>
</build>

</project>
</project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.novatec.todobackend;
package info.novatec.todobackend;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -82,25 +82,25 @@ String addTodo(HttpServletRequest request, HttpServletResponse response, @PathVa

return todo;

}
}

String someInternalMethod(String todo){

todoRepository.save(new Todo(todo));

if(todo.equals("slow")){
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
if(todo.equals("fail")){

System.out.println("Failing ...");
throw new RuntimeException();
}

}

return todo;

Expand Down Expand Up @@ -146,4 +146,4 @@ public void setTodo(String todo) {

interface TodoRepository extends CrudRepository<Todo, String> {

}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.novatec.todobackend;
package info.novatec.todobackend;

import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
Expand All @@ -9,4 +9,4 @@ public class TodobackendApplicationIntegrationTests {
@Test
void contextLoads() {
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker.io/maven:3-eclipse-temurin-21 as build
FROM docker.io/maven:3-eclipse-temurin-21 AS build
WORKDIR /workspace/app

COPY pom.xml .
Expand All @@ -21,6 +21,6 @@ COPY --from=build ${DEPENDENCY}/BOOT-INF/classes /opt/todoui/app

ADD https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v2.8.0/opentelemetry-javaagent.jar /opt/todoui

ENTRYPOINT ["java","-cp","/opt/todoui/app:/opt/todoui/app/lib/*", "-javaagent:/opt/todoui/opentelemetry-javaagent.jar", "io.novatec.todoui.TodouiApplication"]
#ENTRYPOINT ["java", "-cp", "/opt/todobackend/app:/opt/todobackend/app/lib/*", "-javaagent:/opt/todobackend/opentelemetry-javaagent.jar","io.novatec.todobackend.TodobackendApplication"]
ENTRYPOINT ["java","-cp","/opt/todoui/app:/opt/todoui/app/lib/*", "-javaagent:/opt/todoui/opentelemetry-javaagent.jar", "info.novatec.todoui.TodouiApplication"]
#ENTRYPOINT ["java", "-cp", "/opt/todobackend/app:/opt/todobackend/app/lib/*", "-javaagent:/opt/todobackend/opentelemetry-javaagent.jar","info.novatec.todobackend.TodobackendApplication"]

Loading