Install Raspberry Pi OS Lite 64bit with the Raspberry Pi Imager.
Enable ssh with key authentication, change the host name, set the user password, the WiFi password. etc.
- Boot the Pi.
| ARG PYTHON_VERSION=3.10 | |
| ARG BASE_IMAGE=python:${PYTHON_VERSION}-slim | |
| ARG MITEMP_TARGET_DIR=/mitemp2 | |
| FROM ${BASE_IMAGE} AS builder | |
| ARG MITEMP_TARGET_DIR | |
| ENV PATH=$MITEMP_TARGET_DIR/bin:$PATH | |
| RUN apt-get update && apt-get install -y --no-install-recommends build-essential gcc git libglib2.0-dev && rm -rf /var/lib/apt/lists/* |
Install Raspberry Pi OS Lite 64bit with the Raspberry Pi Imager.
Enable ssh with key authentication, change the host name, set the user password, the WiFi password. etc.
| package com.kaffeinelabs.test.extension; | |
| import org.junit.jupiter.api.extension.AfterAllCallback; | |
| import org.junit.jupiter.api.extension.BeforeAllCallback; | |
| import org.junit.jupiter.api.extension.ExtensionContext; | |
| import java.io.File; | |
| import java.io.IOException; | |
| import java.util.List; | |
| import java.util.stream.Collectors; |
| package com.kaffeinelabs; | |
| import com.kaffeinelabs.test.junit.extension.LoggerExtension; | |
| import org.junit.jupiter.api.Test; | |
| class FooTest { | |
| @RegisterExtension | |
| LoggerExtension loggerExtension = LoggerExtension.forLogger(Foo.class); | |
| @Test |
| package pl.zalas.eventbus | |
| interface EventBus<in E> { | |
| fun publish(event: E) | |
| } |
| package pl.zalas.acme.config | |
| import com.fasterxml.jackson.databind.Module | |
| import org.springframework.context.annotation.Bean | |
| import org.springframework.context.annotation.Configuration | |
| import pl.zalas.jackson.module.subtype.SubTypeModule | |
| @Configuration | |
| class JacksonConfig { | |
| @Bean |
| tasks.register("bootRunDev") { | |
| group = "application" | |
| description = "Runs this project as a Spring Boot application with the dev profile" | |
| doFirst { | |
| tasks.bootRun.configure { | |
| systemProperty("spring.profiles.active", "dev") | |
| } | |
| } | |
| finalizedBy("bootRun") | |
| } |
| package acme.aws; | |
| import com.amazonaws.auth.DefaultAWSCredentialsProviderChain; | |
| import com.amazonaws.services.rds.auth.GetIamAuthTokenRequest; | |
| import com.amazonaws.services.rds.auth.RdsIamAuthTokenGenerator; | |
| import org.springframework.beans.factory.annotation.Value; | |
| import org.springframework.boot.autoconfigure.jdbc.DataSourceProperties; | |
| import org.springframework.stereotype.Component; | |
| @Component |
| package acme.test; | |
| import org.springframework.test.context.ActiveProfilesResolver; | |
| public class EnvironmentActiveProfileResolver implements ActiveProfilesResolver { | |
| @Override | |
| public String[] resolve(Class<?> aClass) { | |
| return new String[]{System.getenv("BUILD_ID") == null ? "test" : "test,ci"}; | |
| } | |
| } |
| package acme.testcontainers; | |
| import org.junit.jupiter.api.extension.BeforeAllCallback; | |
| import org.junit.jupiter.api.extension.ExtensionContext; | |
| import org.testcontainers.containers.PostgreSQLContainer; | |
| import org.testcontainers.junit.jupiter.Testcontainers; | |
| @Testcontainers | |
| public class DatabaseContainerExtension implements BeforeAllCallback { | |
| private final PostgreSQLContainer postgreSQLContainer = SharedPostgreSQLContainer.getInstance(); |