An open API service indexing awesome lists of open source software.

https://github.com/lpsm-dev/gitlab-analytics

✔️ In this repository we will create a script to get information in GitLab API
https://github.com/lpsm-dev/gitlab-analytics

Last synced: 12 months ago
JSON representation

✔️ In this repository we will create a script to get information in GitLab API

Awesome Lists containing this project

README

          


gitlab

Welcome to GitLab Analytics Repository


In this repository we will create a simple script to get some information in GitLab API



Open Source


GitHub Contributors


GitHub Language Count


GitHub Top Language


GitHub Stars


GitHub Last Commit


Repository Size


Repository Issues


MIT License

### Menu


Pre-Requisites   |   
About   |   
Description   |   
Testing   |   
How to contribute

### By me a coffe

Pull requests are welcome. If you'd like to support the work and buy me a ☕, I greatly appreciate it!

Buy Me A Coffee

### Getting Started

To use this repository you need a **git clone**:

```bash
git clone --depth 1 https://github.com/lpmatos/gitlab-analytics.git -b master
```

This will give access of the project on your local machine.

### Pre Requisites

To this project you yeed:

* Python 3.8.
* Docker and Docker Compose.
* GitLab Server.

### Built with

- [Python](https://www.python.org/)
- [Docker](https://docs.docker.com/)
- [Docker Compose](https://docs.docker.com/compose/)

### How to use it?

1. Set the gitlab environment variables.
2. Install python packages in requirements.txt.
2. Run this script with docker-compose, Dockerfile or into your local machine with Python command.
3. Profit.

Press CTRL + C to stop it in Docker Compose or Dockerfile.

### Description

In this project we build a simples CLI application that help you to get some information in your GitLab API.

### Running pip

The **pip** is a command line program. When you install **pip**, a **pip** command is added to your system, which can be run from the command prompt as follows:

```bash
$ pip
```

If you cannot run the pip command directly (possibly because the location where it was installed isn't on your operating systems **PATH**) then you can run **pip** via the **Python** interpreter:

```bash
$ python -m pip
```

On **Windows**, the py launcher can be used:

```bash
$ py -m pip
```

### Installing Packages

#### Pip

The **pip** supports installing from **PyPI**, version control, local projects, and directly from distribution files.

The most common scenario is to install from **PyPI** using Requirement specifiers.

```bash
$ pip install SomePackage # latest version
$ pip install SomePackage==1.0.4 # specific version
$ pip install somePackage>=1.0.4 # minimum version
```

#### Pipenv

**Pipenv** is a tool that aims to bring the best of all packaging worlds (bundler, composer, npm, cargo, yarn, etc.) to the **Python** world. **Windows** is a firsts-class citizen, in our world.

It automatically creates and manages a **virtualenv** for your projects, as well as adds/removes packages from your **Pipfile** as you install/uninstall packages. It also generates the ever-important **Pipfile.lock**, which is used to produce deterministic builds.

##### Installation

```bash
$ pip install pipenv
```

##### Create a TOML Spec Pipfile

You can build the **Pipfile** to specifying:

* Versions of a Package.
* Versions of **Python**.
* Basic configurations.

##### Pipenv Workflow

Clone/create project repository:

```bash
$ cd myproject
```

Install from **Pipfile**, if there is one:

```bash
$ pipenv install
```

Install from **Pipfile** dev:

```bash
$ pipenv install --dev
```

### Requirement File

**Requirement File** are files containing a list of items to be installed using **pip** install like so:

```bash
$ pip install -r requirements.txt
```

Logically, a **Requirement File** is just a list of **pip** install arguments placed in a file. Note that you should not rely on the items in the file being installed by **pip** in any particular order.

### Environment variables

**Name** | **Description**
:---: | :---:
**GITLAB_URL** | Just your GitLab Server Host
**GITLAB_TOKEN** | Just your GitLab Token
**LOG_PATH** | Just the Log Path
**LOG_FILE** | Just the Log File
**LOG_LEVEL** | Just the Log Level
**LOGGER_NAME** | Just the Logger name

### 🐋 Development with Docker

Steps to build the Docker Image.

#### Build

```bash
docker image build -t -f
docker image build -t . (This context)
```

#### Run

Steps to run the Docker Container.

* **Linux** running:

```bash
docker container run -d -p
docker container run -it --rm --name -p
```

* **Windows** running:

```
winpty docker.exe container run -it --rm
```

For more information, access the [Docker](https://docs.docker.com/) documentation or [this](docs/annotations/docker.md).

### 🐋 Development with Docker Compose

Build and run a docker-compose.

```bash
docker-compose up --build
```

Down all services deployed by docker-compose.

```bash
docker-compose down
```

Down all services and delete all images.

```bash
docker-compose down --rmi all
```

## Usage

python ./main.py --help - Helper

## Params

![Alt text](docs/images/USAGE.PNG?raw=true "Usage")

## ➤ Author

👤 Hey!! If you like this project or if you find some bugs feel free to contact me in my channels:

>
> * Linktree: https://linktr.ee/lpmatos
>

## ➤ Versioning

To check the change history, please access the [**CHANGELOG.md**](CHANGELOG.md) file.

## ➤ Project status

This repository is a study project, therefore, it will not always be maintained 👻.

## ➤ Donations



BTC Address


Litecoin Address

## ➤ Show your support

Give me a ⭐️ if this project helped you!


gif-header

Made with 💜 by [me](https://github.com/lpmatos) 👋 inspired on [readme-md-generator](https://github.com/kefranabg/readme-md-generator)