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

Docs/3306/restructure-analysis-docker-docs #3312

Merged
merged 12 commits into from
Jun 2, 2023
Merged
Show file tree
Hide file tree
Changes from 7 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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/)

## [unreleased] (Added 🚀 | Changed | Removed 🗑 | Fixed 🐞 | Chore 👨‍💻 👩‍💻)

### Added 🚀

- Expanded and restructured documentation regarding Docker usage [#3312](https://github.com/MaibornWolff/codecharta/pull/3312) </br>
moritz-suckow-mw marked this conversation as resolved.
Show resolved Hide resolved

## [1.117.0] - 2023-05-19

### Added 🚀
Expand Down
27 changes: 26 additions & 1 deletion analysis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ Components that export data from visualisation data to other formats.
- Bash or similar
- JRE 8-11 (Oracle Java or OpenJDK)

# Installation

You can start with **Codecharta Analysis** on multiple ways:

- Installation as a [npm package](#installation-via-npm) (Recommended)
- Use our [Docker Image](#installation-via-docker) to run the analysis in a container
- Use [docker-compose](https://maibornwolff.github.io/codecharta/docs/docker-containers/) to run the analysis in a complete environment with other needed tools like Sonar and a running CodeCharta Visualization instance to view your city map.
- Download the SourceCode and [build it yourself](#manual-installation)

## Installation via npm

This installs all binaries to run the analysis. Java 11 is recommended, while Java 8 is still supported.
Expand All @@ -61,7 +70,21 @@ This installs all binaries to run the analysis. Java 11 is recommended, while Ja

To run it you can call `ccsh`

## Installation
## Installation via Docker

You can use Codecharta analysis in multiple ways. This section will deal with how to use the analysis as a standalone container. For information on how to use with docker compose, please check out our [docker compose documentation](https://maibornwolff.github.io/codecharta/docs/docker-containers/).
We assume that you already installed docker, if not, you have to do that before!

To containerize the analysis, please follow the below listed steps.

- Navigate into the directory you want to analyse with CodeCharta. There are multiple ways to use the docker image:
1. Start the docker container and a bash shell in it with `docker run --name codecharta-analysis -it -v $(pwd):$(pwd) -w $(pwd) codecharta/codecharta-analysis bash`. This runs the image, names it `codecharta-analysis` and mounts the current directory and sets it as the working directory in the image. You can now use the codecharta shell or any other of the tools installed in the container via the command line.
moritz-suckow-mw marked this conversation as resolved.
Show resolved Hide resolved
2. Start the docker container and directly use some command (like the ccsh): `docker run --name codecharta-analysis -it -v $(pwd):$(pwd) -w $(pwd) codecharta/codecharta-analysis ccsh`. This starts the Ccsh without any commands, which will open an interactive codecharta shell that will guide you through the parsing/analyzing process. Your current directory will be your previous working directory.
moritz-suckow-mw marked this conversation as resolved.
Show resolved Hide resolved
3. Start the docker container and directly use a specific parser: `docker run --name codecharta-analysis -it -v $(pwd):$(pwd) -w $(pwd) codecharta/codecharta-analysis ccsh rawtextparser .`. This starts the RawTextParser in the current working directory in a container.
- After executing the run command once, you can repeat the same docker configuration with `docker start codecharta-analysis` or you have to change the name or delete the old container if you want to `docker run` a different configuration.
- After analysing, you can copy any results with `docker cp codecharta-analysis:/your/path/fileName.cc.json fileName.cc.json` to your current working directory (replace `/your/path/` with correct path in container). If this does not work, make sure you assigned the name `codecharta-analysis` to your container, if not use the correct name or container id.

## Manual Installation

- Download / build package
- Unzip / untar package in desired destination folder (named CC_INSTALL_DIR)
Expand All @@ -72,6 +95,8 @@ To run it you can call `ccsh`
- Enter `ccsh` and press `TAB` to see available commands
- Enter `ccsh <ANY-COMMAND> -` and press `TAB` to see available parameters

# Other

## Build

Via gradle:
Expand Down
4 changes: 2 additions & 2 deletions gh-pages/_data/navigation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ docs:
url: /docs/quick-start-guide/
- title: "Installation"
url: /docs/installation/
- title: "Docker Containers"
url: /docs/docker-containers/
- title: "Versioning"
url: /docs/versioning/
- title: "Price"
Expand All @@ -38,8 +40,6 @@ docs:
url: /docs/custom-metrics/
- title: "Analyze with SonarQube"
url: /docs/analyze-with-sonarqube/
- title: "Docker Containers"
url: /docs/docker-containers/

- title: Analysing-Tools
children:
Expand Down
4 changes: 2 additions & 2 deletions gh-pages/_docs/07-01-new-to-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ When updating your branch, we prefer using a rebase instead of merging to keep t

# Code Style Guide

Besides the rules enforced by our linter, we do not follow a set of defined style guidelines for our code.
Just try to make your code readable and follow common best practices.
Besides the rules enforced by our linter, we generally do not follow a set of defined style guidelines for our code.
For the analysis there is an XML file containing a few style rules for your IDE, you can find out more about that in the analysis readme.

# GitHub Actions

Expand Down
14 changes: 13 additions & 1 deletion visualization/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# CodeCharta Visualization

[![Build Status](https://travis-ci.org/MaibornWolff/codecharta.svg?branch=main)](https://travis-ci.org/MaibornWolff/codecharta)
[![Quality Gate Status For Visualization](https://sonarcloud.io/api/project_badges/measure?project=maibornwolff-gmbh_codecharta_visualization&metric=alert_status)](https://sonarcloud.io/project/overview?id=maibornwolff-gmbh_codecharta_visualization)

> CodeCharta by [MaibornWolff](https://www.maibornwolff.de)

Expand All @@ -19,6 +19,8 @@ You can start with **Codecharta Visualization** on multiple ways:
- Installation as a [npm package](#npm-package) (Recommended)
- Run an operating system specific [standalone](#run-a-standalone)
- Build it yourself from the github [repository](#build-it-yourself)
- Use [docker-compose](https://maibornwolff.github.io/codecharta/docs/docker-containers/) to run this with other needed tools like a Sonar instance or analyzing tools of codecharta-analysis.
- Use our [Dockerfile](#run-in-docker-container) to run the visualization in a container
- Try out the [online version](https://maibornwolff.github.io/codecharta/visualization/app/index.html?file=codecharta.cc.json&file=codecharta_analysis.cc.json)

> Be aware, that if you are on Apple Silicon, you need to do additional config for npm installation
Expand Down Expand Up @@ -140,6 +142,16 @@ $ npm run e2e:auto

> To follow/watch the steps the e2e test is performing, deactivate headless mode in `jest-puppeteer.config.js` (and maybe set the `slowMo` parameter)

## Run in Docker container

You can use this via docker compose or as a standalone container. This section will deal with how to use the visualization as a standalone container. For information on how to use this with docker compose, please check out [Docker Getting Started](https://maibornwolff.github.io/codecharta/docs/docker-containers/)
We assume that you already installed docker, if not, you have to do that before!

To containerize the visualization, please follow the below listed steps.

- Start the docker container: `docker run -d -p 9000:80 codecharta/codecharta-visualization`. This detaches the container and exposes port 80 on the container and port 9000 on the host.
- Open `localhost:9000` in your browser and you can already use the visualization, upload `cc.json` files and play around!

# JSON structure

[Example Data](/visualization/app/codeCharta/assets/sample1.cc.json)
Expand Down