Difference between revisions of "Deploiement - Gestionnaire de packages"

From air
Jump to navigation Jump to search
 
Line 93: Line 93:
 
environment:
 
environment:
 
API_URL: "http://192.168.99.100:1337" # URL to backend-controller API
 
API_URL: "http://192.168.99.100:1337" # URL to backend-controller API
  +
</syntaxhighlight>
  +
  +
== Backend-builder ==
  +
Le builder est lui aussi dans une image docker. Une simple commande dans un terminal permet de le lancer et de récupérer le package .deb dans un dossier. Voici quelques exemples de son utilisation :
  +
  +
'''builder-ant.sh'''
  +
<syntaxhighlight lang="bash" line>
  +
#!/bin/sh
  +
  +
docker run -ti -v $(pwd)/built-ant:/builder/built \
  +
packebian/backend-builder:0.2.1 \
  +
build \
  +
--repository=https://github.com/KingBabou/builder-ant.git \
  +
--package=builder-ant \
  +
--tag=1.0
  +
</syntaxhighlight>
  +
  +
  +
'''builder-gradle.sh'''
  +
<syntaxhighlight lang="bash" line>
  +
#!/bin/sh
  +
  +
docker run -ti -v $(pwd)/built-gradle:/builder/built \
  +
packebian/backend-builder:0.2.1 \
  +
build \
  +
--repository=https://github.com/KingBabou/builder-gradle.git \
  +
--package=builder-gradle \
  +
--tag=1.0
  +
</syntaxhighlight>
  +
  +
  +
'''builder-maven.sh'''
  +
<syntaxhighlight lang="bash" line>
  +
#!/bin/sh
  +
  +
docker run -ti -v $(pwd)/built-maven:/builder/built \
  +
packebian/backend-builder:0.2.1 \
  +
build \
  +
--repository=https://github.com/KingBabou/builder-maven.git \
  +
--package=builder-maven \
  +
--tag=1.0
  +
</syntaxhighlight>
  +
  +
'''builder-procesim.sh'''
  +
<syntaxhighlight lang="bash" line>
  +
#!/bin/sh
  +
  +
docker run -ti -v $(pwd)/built-procesim:/builder/built \
  +
packebian/backend-builder:0.2.1 \
  +
build \
  +
--repository=https://github.com/KingBabou/procesim.git \
  +
--package=procesim \
  +
--tag=1.0
  +
</syntaxhighlight>
  +
  +
'''builder-puissance4.sh'''
  +
<syntaxhighlight lang="bash" line>
  +
#!/bin/sh
  +
  +
docker run -ti -v $(pwd)/built-puissance4:/builder/built \
  +
packebian/backend-builder:0.2.1 \
  +
build \
  +
--repository=https://github.com/KingBabou/puissance4.git \
  +
--package=puissance4 \
  +
--tag=1.0
 
</syntaxhighlight>
 
</syntaxhighlight>

Latest revision as of 09:57, 16 March 2017

Page d'accueil du projet

Compositions docker

Tous les composants de notre application ont été publiés dans des images dockers produites automatiquement avec Travis-ci. Les Dockerfile sont donc disponible sur les dépôts git du projet et les images sont publié dans l'organisation Packebian sur Dockerhub .


Backend-controller

Le backend controller est une API composée de deux containers :

  • sails : L'application sails . Ce container est produit à partir de l'image packebian/backend-controller qui est construite à partir de ce Dockerfile
  • mongodb : La base de donnée de l'API. Ce containeur est produit à partir de ce fichier Dockerfile

docker-compose.yml

 1version: '2'
 2
 3services:
 4# -------------------------------------------
 5# ------------------ Sails ------------------
 6# -------------------------------------------
 7    # sails container
 8    sails:
 9        image: packebian/backend-controller:stable
10        tty: true
11        ports:
12            - "1337:1337"
13        links:
14            - "mongodb:mongodb"
15        environment:
16            # Sails
17            SAILS_SECRET: "c9693b2d5572ffd96a79cae6a8453d57"
18            # Mongo
19            MONGO_HOST: "mongodb"
20            MONGO_PORT: "27017"
21            MONGO_DB: "packebian"
22            MONGO_USER: "packebian"
23            MONGO_PASS: "packebian123"
24            # Auth0
25            AUTH0_SECRET: "secret"
26            AUTH0_ALGO: "HS256"
27            AUTH0_ENDPOINT: "https://packebian.eu.auth0.com"
28            # JWT
29            JWT_SECRET: "secret"
30            JWT_LIFE: 3600
31            JWT_ALGO: "HS256"
32            JWT_ISSUER: "packebian.com"
33            JWT_AUDIENCE: "packebian.com"
34
35# ----------------------------------------------
36# ------------------ Database ------------------
37# ----------------------------------------------
38    # Mongodb
39    mongodb:
40        build: ./builds/mongo
41        tty: true
42        restart: always
43        volumes:
44            - "mongoVolume:/data/db"
45        ports:
46            - "27017:27017"
47        environment:
48            ADMIN_USER: "root"
49            ADMIN_PASS: "mongdb123"
50            MONGO_DB: "packebian"
51            MONGO_USER: "packebian"
52            MONGO_PASS: "packebian123"
53
54volumes:
55  mongoVolume:
56      driver: local

L'image utilisée pour le container mongodb n'est pas publiée. Nous vous conseillons donc d'utiliser cette composition en partant de ce dépot github


Frontend

L'image de l'application Frontend Angular produit est créé à partir de ce Dockerfile

docker-compose.yml

 1version: '2'
 2 
 3services:
 4# -------------------------------------------
 5# ----------------- Angular -----------------
 6# -------------------------------------------
 7    # sails container
 8    frontend:
 9        image: packebian/frontend:stable
10        tty: true
11        ports:
12            - "9000:9000"
13            - "35729:35729"
14        environment:
15            API_URL: "http://192.168.99.100:1337" # URL to backend-controller API

Backend-builder

Le builder est lui aussi dans une image docker. Une simple commande dans un terminal permet de le lancer et de récupérer le package .deb dans un dossier. Voici quelques exemples de son utilisation :

builder-ant.sh

1#!/bin/sh
2
3docker run -ti -v $(pwd)/built-ant:/builder/built \
4    packebian/backend-builder:0.2.1 \
5    build \
6    --repository=https://github.com/KingBabou/builder-ant.git \
7    --package=builder-ant \
8    --tag=1.0


builder-gradle.sh

1#!/bin/sh
2
3docker run -ti -v $(pwd)/built-gradle:/builder/built \
4    packebian/backend-builder:0.2.1 \
5    build \
6    --repository=https://github.com/KingBabou/builder-gradle.git \
7    --package=builder-gradle \
8    --tag=1.0


builder-maven.sh

1#!/bin/sh
2
3docker run -ti -v $(pwd)/built-maven:/builder/built \
4    packebian/backend-builder:0.2.1 \
5    build \
6    --repository=https://github.com/KingBabou/builder-maven.git \
7    --package=builder-maven \
8    --tag=1.0

builder-procesim.sh

1#!/bin/sh
2
3docker run -ti -v $(pwd)/built-procesim:/builder/built \
4    packebian/backend-builder:0.2.1 \
5    build \
6    --repository=https://github.com/KingBabou/procesim.git \
7    --package=procesim \
8    --tag=1.0

builder-puissance4.sh

1#!/bin/sh
2
3docker run -ti -v $(pwd)/built-puissance4:/builder/built \
4    packebian/backend-builder:0.2.1 \
5    build \
6    --repository=https://github.com/KingBabou/puissance4.git \
7    --package=puissance4 \
8    --tag=1.0