Skip to content

Commit

Permalink
Adding common Testcontainers Guide template content
Browse files Browse the repository at this point in the history
  • Loading branch information
sivaprasadreddy committed Mar 10, 2023
1 parent 0e8e380 commit afc299f
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea
54 changes: 54 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
= GUIDE_TITLE

This is sample code for [GUIDE_TITLE](https://testcontainers.com/guides/GUIDE_URL) Guide.

== 1. Setup Environment
Make sure you have a [compatible Docker environment](https://www.testcontainers.org/supported_docker_environment/) installed.

For example:

[source,shell]
----
$ docker version
...
Server: Docker Desktop 4.12.0 (85629)
Engine:
Version: 20.10.17
API version: 1.41 (minimum version 1.12)
Go version: go1.17.11
...
----

* Add language specific prerequisites here

[source,shell]
----
$ java -version
openjdk version "17.0.4" 2022-07-19
OpenJDK Runtime Environment Temurin-17.0.4+8 (build 17.0.4+8)
OpenJDK 64-Bit Server VM Temurin-17.0.4+8 (build 17.0.4+8, mixed mode, sharing)
----

== 2. Setup Project

* Clone the repository
[source,shell]
----
git clone https://github.com/testcontainers/TC_GUIDE_REPO_NAME.git
cd TC_GUIDE_REPO_NAME
----
* Open the **TC_GUIDE_REPO_NAME** project in your favorite IDE.

== 3. Run Tests

Run the command to run the tests.

[source,shell]
----
$ ./gradlew test //for Gradle
$ ./mvnw verify //for Maven
$ go test ./... //for Go
$ npm test //for Node
----

The tests should pass.
76 changes: 76 additions & 0 deletions guide/replace-me-with-guide-url/index.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
title: "GUIDE_TITLE"
date: 2023-03-07T09:39:58+05:30
draft: false
description: GUIDE_SHORT_DESCRIPTION
repo: https://github.com/testcontainers/TC_GUIDE_REPO_NAME
languages:
- Java
tags:
- spring-boot
- postgresql
---
:toc:
:toclevels: 2
:codebase: https://raw.githubusercontent.com/testcontainers/TC_GUIDE_REPO_NAME/main

In this guide you will learn how to

* Perform task 1
* Perform task 2

== Prerequisites
* Java 17+ / Go 1.20+ / Node 16.x etc
* Your favorite IDE (Intellij IDEA, Eclipse, NetBeans, VS Code)
* A Docker environment supported by Testcontainers https://www.testcontainers.org/supported_docker_environment/

== What we are going to achieve in this guide

Summary of what we are going to implement and learn in one or two paragraphs.

== Getting Started
Explain how to create a new project with your favourite build tool support.

Here is how you can include an inline code block:

[source,java]
----
class Hello {
void method1() {
System.out.println("Hello");
}
}
----

== Step 1

Here is how you can include entire file from sample code:

[source,sql]
----
include::{codebase}/src/test/resources/init-db.sql[]
----

[WARNING]
A warning message here.

== Step 2

Here is how you can include specific lines of code segments from sample code:

[source,java]
----
include::{codebase}/src/test/java/com/testcontainers/demo/LocalStackTest.java[lines="23..48,55..76"]
----

[NOTE]
An important note here.

== Summary
Summary of what we have learned and add call-to-action.

To learn more about Testcontainers visit http://testcontainers.com

== Further Reading
* https://testcontainers.com/guides/introducing-testcontainers/
* https://www.testcontainers.org/quickstart/junit_5_quickstart/

0 comments on commit afc299f

Please sign in to comment.