Establish preliminary structure for documentation

This commit is contained in:
Konstantin Schaper
2020-05-06 19:56:34 +02:00
parent daeb8b7cbb
commit 8b2d9d1d95
34 changed files with 366 additions and 21 deletions

View File

@@ -0,0 +1,17 @@
---
title: Logging
---
SCM-Manager logs information which can be useful, if the system does not behave as expected.
The logging behavior depends on your operating system and installation.
| Type of Installation | Logging |
|----------------------|---------|
| Docker | stdout |
| RPM | /var/log/scm |
| DEB | /var/log/scm |
| Unix | $BASEDIR/logs |
| Mac OS X | ~/Library/Logs/SCM-Manager |
| Windows | $BASEDIR\logs |
The location of the **$BASEDIR** can be found [here](basedirectory).

View File

Before

Width:  |  Height:  |  Size: 89 KiB

After

Width:  |  Height:  |  Size: 89 KiB

View File

@@ -0,0 +1,6 @@
---
title: Configuration
partiallyActive: true
---
* [Base Directory](basedirectory/)

View File

@@ -1,23 +1,3 @@
---
title: Logging
---
SCM-Manager logs information which can be useful, if the system does not behave as expected.
The logging behavior depends on your operating system and installation.
| Type of Installation | Logging |
|----------------------|---------|
| Docker | stdout |
| RPM | /var/log/scm |
| DEB | /var/log/scm |
| Unix | $BASEDIR/logs |
| Mac OS X | ~/Library/Logs/SCM-Manager |
| Windows | $BASEDIR\logs |
The location of the **$BASEDIR** can be found [here](basedirectory).
## Configuration
The logging behaviour of SCM-Manager can be configured via an xml file.
The syntax and properties can be found [here](http://logback.qos.ch/manual/configuration.html).
The location of the file depends also on the type of installation.

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 MiB

View File

@@ -0,0 +1,27 @@
---
title: Create a plugin
subtitle: Create a plugin from Maven Archetype
displayToc: true
---
# Requirements
Be sure you have installed the following software:
* [Java 8](https://java.com/de/download/)
* [Apache Maven](http://maven.apache.org/)
# Create the plugin structure
Use the scm-manager plugin [archetype](https://maven.apache.org/guides/introduction/introduction-to-archetypes.html)
to create the plugin structure.
```bash
mvn archetype:...
```
Answer the questions of the archetype.
# Implement your plugin
... draw the rest of the owl

View File

@@ -0,0 +1,41 @@
---
title: Plugin Creation
---
### Software Requirements
- JDK 1.7 or higher
([download](http://www.oracle.com/technetwork/java/index.html))
- Maven 3 or higher ([download](http://maven.apache.org/))
### Create plugin
```bash
mvn archetype:generate\
-DarchetypeGroupId=sonia.scm.maven\
-DarchetypeArtifactId=scm-plugin-archetype\
-DarchetypeVersion=1.60\
-DarchetypeRepository=http://maven.scm-manager.org/nexus/content/groups/public/
```
### Test the plugin
```bash
mvn scmp:run
```
### Samples
- [Hello World](https://bitbucket.org/sdorra/scm-manager/src/1.x/scm-samples/scm-sample-hello/)
- [Authentication Plugin](https://bitbucket.org/sdorra/scm-manager/src/1.x/scm-samples/scm-sample-auth/)
### Further reading
- [Injection framework - Google Guice](http://code.google.com/p/google-guice/)
- [Restful WebService - Jersey](http://jersey.java.net/nonav/documentation/latest/user-guide.html)
- [ XML transformation - JAXB](http://jaxb.java.net/guide/)
- [User interface - Ext JS](http://www.sencha.com/products/extjs3/)
### Questions/Help
If you have questions or you need help, please write to the mailing
list: <https://groups.google.com/forum/#!forum/scmmanager>

View File

@@ -0,0 +1,121 @@
---
title: I18n
subtitle: Howto do internationalization
displayToc: false
---
SCM-Manager uses [react-i18next](https://react.i18next.com) for internationalization.
The keys for the translation are stored in json files called `plugins.json` at `src/main/resources/locales/`,
followed by a folder for each language (e.g.: en for English, de for German).
The keys should be prefixed with the name of the plugin to avoid collisions e.g.:
`.../locales/en/plugins.json`:
```json
{
"scm-sample-plugin": {
"title": "Sample Title"
}
}
```
`.../locales/de/plugins.json`:
```json
{
"scm-sample-plugin": {
"title": "Beispiel Titel"
}
}
```
The translations keys can now be used with in the frontend.
**Function Component**:
```tsx
import React from "react";
// import hook from react-i18next library
import { useTranslation } from "react-i18next";
const Title = () => {
// use hook to obtain translate function for the namespace plugins
const { t } = useTranslation("plugins");
// use translate function to translate key scm-sample-plugin.title
return <p>{t("scm-sample-plugin.title")}</p>;
};
export default Title;
```
**Class Component**:
```tsx
import React from "react";
// import higher order component and types for out Props
import { WithTranslation, withTranslation } from "react-i18next";
// extend our props with WithTranslation
type Props = WithTranslation & {};
class Title extends React.Component<Props> {
render() {
// get translate function from props
const { t } = this.props;
// use translate function to translate key scm-sample-plugin.title
return <p>{t("scm-sample-plugin.title")}</p>;
}
};
// wrap our component with withTranslation for the namespace plugins
export default withTranslation("plugins")(Title);
```
If it is required to replace values in the content the `Trans` component can be used.
To achieve this goal we have to add placeholders to our translations e.g.:
`.../locales/en/plugins.json`:
```json
{
"scm-sample-plugin": {
"title": "Sample Title",
"greetings": "<0/> at <1/>"
}
}
```
`.../locales/de/plugins.json`:
```json
{
"scm-sample-plugin": {
"title": "Beispiel Titel",
"greetings": "<0/> um <1/>"
}
}
```
Now we can use the `Trans` component, not we have to specified the namespace with in the key:
```tsx
<Trans
i18nKey="plugins:scm-sample-plugin.greetings"
values={["Bob", new Date().toString()]}
/>
```
We can also replace the placeholders with react components:
```tsx
import {DateFromNow} from "@scm-manager/ui-components";
...
<Trans
i18nKey="plugins:scm-sample-plugin.greetings"
components={[
<p>"Bob"</p>,
<DateFromNow date={new Date()} />
]}
/>
```

View File

@@ -0,0 +1,42 @@
---
title: Publish
subtitle: Publish your Plugin
---
If you want to share your plugin with SCM-Manager users, you can publish it to the SCM-Manager Plugin Center by following the steps below.
* Create a Mercurial or Git repository for your plugin
* Develop your plugin as described in [Create a plugin](/docs/create)
* Fork the [Plugin Center Repository](https://bitbucket.org/scm-manager/plugin-center)
* Create a folder with the name of your plugin under the `src/plugins` directory
* Put a `index.md` which starts with frontmatter metadata, which describes your plugin e.g.:
```yaml
---
name: scm-cas-plugin
displayName: CAS
description: CAS Authentication plugin for version 2.x of SCM-Manager
category: authentication
author: Cloudogu GmbH
---
```
* Document your plugin with [markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) below the frontmatter header
* Commit your work and open a pull request. Put the url to your plugin repository into the description of the pull request.
After you have opened the pull request.
We will do a few steps to integrate your plugin into the plugin center:
* We will create a fork of your plugin under the [SCM-Manager Team](https://bitbucket.org/scm-manager/) and give your account write permissions
* After that we will create a Jenkins job for your plugin on [oss.cloudogu.com](https://oss.cloudogu.com/jenkins/job/scm-manager/job/scm-manager-bitbucket/)
* At the end we will accept your pull request
From now on you can work with the repository in the [SCM-Manager Team](https://bitbucket.org/scm-manager/).
Every time you release your plugin (push a tag to the repository) the Jenkins job will build your plugin and release it to the plugin center.
# Architecture
The following picture shows the architecture of the involved systems.
![Architecture](architecture.jpg "Plugin Center Architecture")

View File

@@ -54,7 +54,7 @@ repositories over http.
- [Style Guide](style-guide.md)
- [Error Handling in REST, Java, UI](error-handling.md)
- [Create a new Plugin](create-plugin.md)
- [Migration Wizard](migration-wizard.md)
- [Migration Wizard](content/docs/2.0.x/en/migrate-scm-manager-from-v1.md)
- [Plugin Development](plugin-development.md)
- [i18n for Plugins](i18n-for-plugins.md)
- [Extension Points](extension-points.md)

View File

@@ -0,0 +1,35 @@
---
title: Docker
subtitle: Install scm-manager with docker
displayToc: true
---
## Quickstart
```text
docker run --name scm -p 8080:8080 -v scm-home:/var/lib/scm scmmanager/scm-manager:2.0.0-rc5
```
## Persistence
It is recommended to create a persistent volume for the scm-manager home directory.
This allows scm-manager updates and recreation of the container without lose of data.
The home directory is located at `/var/lib/scm`.
It is recommended to use a volume managed by docker.
If it is required to use a host directory, keep in mind that the scm-manager process is executed with a user which has the id 1000.
So ensure that the user with the uid 1000 can write to the directory e.g.:
```text
mkdir /scm_home
chown 1000:1000 /scm_home
docker run --name scm -p 8080:8080 -v /scm_home:/var/lib/scm scmmanager/scm-manager:2.0.0-rc5
```
## Exposed Ports
SCM-Manager exposes its http port on port 8080.
If you want to use the ssh plugin, keep in mind that this plugin requires an extra port (default is 2222).
```text
docker run --name scm -p 2222:2222 -p 8080:8080 -v scm-home:/var/lib/scm scmmanager/scm-manager:2.0.0-rc5
```

View File

@@ -0,0 +1,13 @@
---
title: Installation
subtitle: Installation of scm-manager
partiallyActive: true
---
* [Docker](docker/)
* Kubernetes
* Debian based
* Red Hat based
* [Linux General](linux/)
* Mac OS X
* Windows

View File

@@ -0,0 +1,43 @@
---
title: Linux
subtitle: General linux installation
displayToc: true
---
## Requirements
Ensure that Java JRE is installed at least in version 8.
Recommended is Java 11.
If you want to use [Mercurial](https://www.mercurial-scm.org/), ensure it is installed on your machine.
## Installation
Download [scm-server-2.0.0-rc5-app.tar.gz](https://maven.scm-manager.org/nexus/service/local/repositories/releases/content/sonia/scm/scm-server/2.0.0-rc5/scm-server-2.0.0-rc5-app.tar.gz)
and verify the checksum (sha1: 3b2dff3fda0c46362c518be37edd4e77bccc88bb).
```bash
wget https://maven.scm-manager.org/nexus/service/local/repositories/releases/content/sonia/scm/scm-server/2.0.0-rc5/scm-server-2.0.0-rc5-app.tar.gz
echo "3b2dff3fda0c46362c518be37edd4e77bccc88bb *scm-server-2.0.0-rc5-app.tar.gz" | sha1sum -c -
```
Extract the archive:
```bash
tar xvfz scm-server-2.0.0-rc5-app.tar.gz -C /opt
```
## Start
The application can be started by using the scm-server script.
```bash
/opt/scm-server/bin/scm-server
```
## Daemonize
To start the application in background, we can use the `start` parameter.
```bash
/opt/scm-server/bin/scm-server start
```

20
docs/en/navigation.yml Normal file
View File

@@ -0,0 +1,20 @@
- section: Getting started
entries:
- /installation/
- /configuration/
- /migrate-scm-manager-from-v1/
- /migrate-plugin-from-v1/
- /faq/
- /known-issues/
- section: Administration
entries:
- /administration/scm-server-ssl/
- /administration/logging/
- /administration/permission-concept/
- /administration/command-line-client/
- section: Development
entries:
- /development/plugins
- /development/intellij-idea-configuration/