master
Maxime ROCHER 3 months ago
parent fbabaae7df
commit e6aacb57e2

@ -4,38 +4,33 @@ name: Deploiement
trigger:
event:
push
- push
steps:
- name: Build and Push
image: plugins/docker
settings:
dockerfile: docker/Dockerfile # Le Dockerfile est bien dans le dossier "docker"
context: . # Le contexte est le dossier racine (.)
registry: hub.codefirst.iut.uca.fr
repo: hub.codefirst.iut.uca.fr/WikiFantasy/WF-Database
username:
from_secret: SECRET_REGISTRY_USERNAME
password:
from_secret: SECRET_REGISTRY_PASSWORD
name: Build and Push
image: plugins/docker
settings:
dockerfile: docker/Dockerfile
context: scripts
registry: hub.codefirst.iut.uca.fr
mirror: https://proxy.iut.uca.fr:8443/
repo: hub.codefirst.iut.uca.fr/WikiFantasy/WF-Database
username:
from_secret: SECRET_REGISTRY_USERNAME
password:
from_secret: SECRET_REGISTRY_PASSWORD
name: Deploy
image: hub.codefirst.iut.uca.fr/clement.freville2/plugins/kaniko:latest
environment:
IMAGENAME: hub.codefirst.iut.uca.fr/WikiFantasy/WF-Database
CONTAINERNAME: ASCAS-SQL
COMMAND: create
OVERWRITE: false
PRIVATE: true
CODEFIRST_CLIENTDRONE_ENV_POSTGRES_PASSWORD:
from_secret: POSTGRES_PASSWORD
CODEFIRST_CLIENTDRONE_ENV_POSTGRES_DB:
from_secret: POSTGRES_DB
CODEFIRST_CLIENTDRONE_ENV_POSTGRES_USER:
from_secret: POSTGRES_USER
ADMINS: maximerocher
- name: Deploy
image: hub.codefirst.iut.uca.fr/clement.freville2/plugins/kaniko:latest
environment:
IMAGENAME: hub.codefirst.iut.uca.fr/WikiFantasy/WF-Database
CONTAINERNAME: ASCAS-SQL
POSTGRES_PASSWORD:
from_secret: POSTGRES_PASSWORD
POSTGRES_DB:
from_secret: POSTGRES_DB
POSTGRES_USER:
from_secret: POSTGRES_USER
commands:
- docker stop $CONTAINERNAME || true
- docker rm $CONTAINERNAME || true
- docker run -d --name $CONTAINERNAME -e POSTGRES_PASSWORD=$POSTGRES_PASSWORD -e POSTGRES_DB=$POSTGRES_DB -e POSTGRES_USER=$POSTGRES_USER -p 5432:5432 $IMAGENAME

@ -0,0 +1,13 @@
image: docker:latest
services:
- docker:dind
stages:
- build
build_job:
stage: build
script:
- docker build -t my_postgres_db .
- docker run -d --name my_postgres_db -e POSTGRES_PASSWORD=sucepute -p 5432:5432 my_postgres_db
Loading…
Cancel
Save