# E.S.L. Docker environement Repo sync & Dev

## Struct

```
.
├── bin
│   ├── empty.sh
│   ├── run.sh
│   └── sync.sh
├── define.conf -> .env
├── docker-compose.yml
├── Dockerfile
├── generate_env.sh
├── README.md
└── Template
    ├── docker-compose.yml.gen
    ├── docker-compose.yml.repo
    ├── Dockerfile.gen
    ├── Dockerfile.repo
    └── function

2 directories, 13 files
```

## Help

```
devbase-astierg@[navalgroup-astierg]- ~ : $ /data/DOCKER/centos79repo/generate_env.sh 

/data/DOCKER/centos79repo/generate_env.sh [image/repo/esl/all]

	* image : Generate docker images
	* image-gen : Generate docker image for esl compilator
	* image-repo : Generate docker image  for repository sync 
	* repo  : start docker compose and generate repositories
	* gen 	: start docker compose and generarte esl
	* all 	: Do everything
	* run-gen : Connect and run bash on instance gen
	* run-repo : Connect and run bash on instance repo
	* stop 	: stop all docker image

```

## Config File 


```
devbase-astierg@[navalgroup-astierg]- ~ : $ cat /data/DOCKER/centos79repo/define.conf

#####################################
# Repository generator

# Version of image
RepoVers=1
# Centos Version
CentOsVersion=7.9.2009
# Sync repo script 
Run=/bin/sync.sh
# Sync arg script
# * del : delete all local repo
# * debug : only start docker instance
# * empty : sync whithout delete
RunArg=del

#####################################
# Esl compilator

# Version of image
GenVers=1
# Programme local directory
ProgrammeDir=/data/GIT/ESL_PRODUIT
# Repositories Directory
RepoDir=./data/repo
# If auto gen script esl Else leave empty and only start docker instance
GenScript=/data/gen.sh
```

## Build Everything.

```
devbase-astierg@[navalgroup-astierg]- ~ : $  time  /data/DOCKER/centos79repo/generate_env.sh all 
Delete Dockerfile ... : OK
Delte old images gen ... : OK
generate Dockerfile gen ... : OK
Generate gen  Docker image ... : OK

------ Log Compil -----------
/tmp/BuildDocker-gen.log
-----------------------------

Delete Dockerfile ... : OK
Delte old images repo ... : OK
generate Dockerfile repo ... : OK
Generate repo  Docker image ... : OK

------ Log Compil -----------
/tmp/BuildDocker-repo.log
-----------------------------

Starting DOCKER repo ... : OK

--------- Log Esl -----------
/tmp/RunDocker-repo.log
-----------------------------

Starting DOCKER gen ... : OK

--------- Log Esl -----------
/tmp/RunDocker-gen.log
-----------------------------


real	29m43,812s
user	0m3,405s
sys	0m0,579s
```

## Debug / Function

```
devbase-astierg@[navalgroup-astierg]- /data/DOCKER/ESL-devenv : $ source Template/function 
devbase-astierg@[navalgroup-astierg]- /data/DOCKER/ESL-devenv : $  cat  Template/function  | grep '()' | cut -d"(" -f1
TestEnv
Res
help 
DeleteFile
DockerConnect
DockerPs
DockerStop
DeleteImg 
DockerGen
DockerComposeRun 
GenAll 
```

## Real life

## define

![](./doc/0_define.png) 

## help

![](./doc/1_help.png) 

## image

![](./doc/2_image.png) 

## image-gen

![](./doc/3_image-gen.png) 

## image-repo

![](./doc/4_image-repo.png) 

## repo

![](./doc/5_repo.png) 

## gen-connect

![](./doc/6_gen-connect.png) 

## gen

![](./doc/7_gen.png) 

## all

![](./doc/8_all.png) 





