Skip to content

Commit

Permalink
Merge pull request #13 from Paulo-Lopes-Estevao/feat/docker-configura…
Browse files Browse the repository at this point in the history
…tion-dev

add configuration docker envromment dev
  • Loading branch information
Paulo-Lopes-Estevao authored Dec 20, 2023
2 parents 600ced9 + 9b7b2b4 commit 93a91d3
Show file tree
Hide file tree
Showing 6 changed files with 157 additions and 10 deletions.
33 changes: 33 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,6 @@ cython_debug/
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

**/workflows/test_**.yml
**/workflows/test_**.yml

.idea/
33 changes: 33 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM python:3.11.4-slim as compile-image

WORKDIR /app

RUN apt-get update
RUN apt-get install -y --no-install-recommends build-essential gcc

RUN python -m venv /opt/venv

ENV PATH="/opt/venv/bin:$PATH"

COPY requirements.txt .
RUN pip install -r requirements.txt

COPY . .

RUN pip install -U .

FROM python:3.11.4-alpine as run-test-stage

RUN pytest ./..

FROM python:3.11.4-alpine as build-stage

WORKDIR /app

COPY --from=compile-image /opt/venv /opt/venv

EXPOSE 8000

ENV PATH="/opt/venv/bin:$PATH"

CMD ["tail", "-f", "/dev/null"]
86 changes: 77 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ It's a command line tool that can be used to generate CI configuration files for

Possible CI systems are:

- [x] Github Actions
- [ ] Jenkins
- [ ] Docker
- [ ] Gitlab CI
* [x] GitHub Actions
* [ ] Jenkins
* [ ] Docker
* [ ] Gitlab CI

They can integrate with the following tools:

Expand All @@ -18,6 +18,29 @@ They can integrate with the following tools:
- DockerFile
- DockerCompose

# Index

* [ci generator](#ci-generator)
* [Installation](#installation)
* [Usage](#usage)
* [GitHub Actions](#github-actions)
* [Github Actions commands available](#github-actions-commands-available)
* [Go](#go)
* [NodeJS](#nodejs)
* [Commands not yet available](#commands-not-yet-available)
* [Jenkins](#jenkins)
* [Docker](#docker)
* [Gitlab CI](#gitlab-ci)
* [Docker Composer](#docker-composer)
* [Python](#python)
* [Installation - Development](#installation--development)
* [Docker [dev]](#docker-dev)
* [Docker Composer [dev]](#docker-composer-dev)
* [Python [dev]](#python-dev)
* [Contributing](#contributing)
* [License](#license)


## Installation

Multiplatform Linux, Windows, MacOs
Expand Down Expand Up @@ -55,13 +78,13 @@ Commands:

```

### [[EXEMPLES OF USAGE]](examples) <- click here
#### [[EXEMPLES OF USAGE]](examples) <- click here

github-actions subcommand can be used to generate Build and Test Github Actions configuration files.

#### Github Actions commands available
### Github Actions commands available

- go
##### **Go**

github-actions Golang example:

Expand All @@ -71,6 +94,8 @@ cigen github-actions go -n myproject -b push main -a 1 -v 1.21.1

[[EXEMPLES OF USAGE GOLANG]](examples/github_action/golang.md) <- click here

##### **NodeJS**

github-actions NodeJS example:

```bash
Expand All @@ -79,7 +104,7 @@ cigen github-actions nodejs -n myproject -b push main -a 1 -v 14.17.3

[[EXEMPLES OF USAGE NODEJS]](examples/github_action/nodejs.md) <- click here

## Commands not yet available
### Commands not yet available

### Jenkins

Expand Down Expand Up @@ -136,7 +161,50 @@ cigen gitlab-ci python -n myproject -b push main -a 1 -v 3.9.6
```

<br>
<br>

## Installation - Development

### Docker [dev]

```bash
docker build -t ci-generator .
```

```bash
docker run -it --rm ci-generator cigen --help
```

### Docker Composer [dev]

```bash
docker-compose up -d
```

```bash
docker-compose run --rm ci-generator cigen --help
```

### Python [dev]

```bash
python3 -m venv venv
```

```bash
source venv/bin/activate
```

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

```bash
pip install -e .
```

```bash
cigen --help
```

**NOTE**: ci generator is not yet fully stable, so it's not recommended to use it in production. It's still in development.

Expand Down
Empty file added cigen/core/github/docker.py
Empty file.
11 changes: 11 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
services:

ci-generator:
build:
context: .
ports:
- 8000:8000
develop:
watch:
- action: rebuild
command: pip install -U .

0 comments on commit 93a91d3

Please sign in to comment.