<commit_before># Jenkins plugin site
This is a simple rendering of the plugin list as taken from updates.jenkins-ci.org/current/update-center.json.

# Architecture in deploy

![alt text](./architecture.png "architecture")

We have 2 docker images, one is a vanilla mongodb image and the other our plugin-site (see below how to 
build it with docker).

Under the hood we have two services running one on port 3000 and another on 5000 on our docker image.
 
The 3000 is communicating with mongo and doing the indexing work of the plugins. In the initial connect of that service 
with the db we are requesting the jsonp from the official site and indexing our mongodb with it. 
We further created a cron job in that server to index the plugins once a day at 1:1:1. 
On the port 5000 service we created a proxy to mask the other service (port 3000) and to make it impossible to trigger 
the re-index of the plugins from outside (magic url -> /indexDb). 

The only visible service it the react app served from a webpack server (and some proxy magic to access
[plugins, getCategories, latest] without exposing the backend). 

Besides the docker images there is nothing to be installed on any hosting service only a http proxy 
to do plugins.xxx.io -> x.x.x.x:5000 ...and of course docker.


### Run with Docker

```
docker pull mongo
docker run -d --name pluginDB mongo

docker build -t jenkinsciinfra/plugin-site .
docker run -d -p 5000:5000 --link=pluginDB:mongodb --name plugin-site jenkinsciinfra/plugin-site
Point to http://0.0.0.0:5000/
```

### Usage with npm


```
npm install
npm start
Open http://localhost:5000
```

### Code Integrity

To test the integrity of our code base we are using a compination of eslint and tests.

```
npm run integrity
```

To make sure you do not push faulty code we create as well a pre-push hook which will call the test. However since we
are using the Jenkinsfile to describe our deploy pipeline, we added the check in the commit stage.

However fell free to activate it with:

```
ln -s `pwd`/pre-push.sh .git/hooks/pre-push
```

### Linting with npm

ESLint with React linting options have been enabled.

```
npm run lint
```

You can use the command lint:fix and it will try to fix all
offenses, whoever there maybe some more that you need to fix manually.

Remember:<commit_msg>typo fix<commit_after># Jenkins plugin site
This is a simple rendering of the plugin list as taken from updates.jenkins-ci.org/current/update-center.json.

# Architecture in deploy

![alt text](./architecture.png "architecture")

We have 2 docker images, one is a vanilla mongodb image and the other our plugin-site (see below how to 
build it with docker).

Under the hood we have two services running one on port 3000 and another on 5000 on our docker image.
 
The 3000 is communicating with mongo and doing the indexing work of the plugins. In the initial connect of that service 
with the db we are requesting the jsonp from the official site and indexing our mongodb with it. 
We further created a cron job in that server to index the plugins once a day at 1:1:1. 
On the port 5000 service we created a proxy to mask the other service (port 3000) and to make it impossible to trigger 
the re-index of the plugins from outside (magic url -> /indexDb). 

The only visible service it the react app served from a webpack server (and some proxy magic to access
[plugins, getCategories, latest] without exposing the backend). 

Besides the docker images there is nothing to be installed on any hosting service only a http proxy 
to do plugins.xxx.io -> x.x.x.x:5000 ...and of course docker.


### Run with Docker

```
docker pull mongo
docker run -d --name pluginDB mongo

docker build -t jenkinsciinfra/plugin-site .
docker run -d -p 5000:5000 --link=pluginDB:mongodb --name plugin-site jenkinsciinfra/plugin-site
Point to http://0.0.0.0:5000/
```

### Usage with npm


```
npm install
npm start
Open http://localhost:5000
```

### Code Integrity

To test the integrity of our code base we are using a compination of eslint and tests.

```
npm run integrity
```

To make sure you do not push faulty code we create as well a pre-push hook which will call the test. However since we
are using the Jenkinsfile to describe our deploy pipeline, we added the check in the commit stage.

However fell free to activate it with:

```
ln -s `pwd`/pre-push.sh .git/hooks/pre-push
```

### Linting with npm

ESLint with React linting options have been enabled.

```
npm run lint
```

You can use the command lint:fix and it will try to fix all
offenses, however there maybe some more that you need to fix manually.

Remember:
{'fraction_non_alphanumeric': 0.06737205787087022, 'fraction_numerical': 0.020729863960267762, 'mean_word_length': 3.804979253112033, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3327744', 'n_tokens_mistral': 1453, 'n_tokens_neox': 1264, 'n_words': 720}