kind: pipeline
type: docker
name: Portfolio

trigger:
  event:
    - push

steps:

  - name: build-portfolio
    image: plugins/docker
    settings:
      dockerfile: ./site/Dockerfile
      context: ./site
      registry: hub.codefirst.iut.uca.fr
      repo: hub.codefirst.iut.uca.fr/dorian.hodin/portfolio
      username:
        from_secret: SECRET_USERNAME
      password:
        from_secret: SECRET_PASSWD

  - name: deploy-portfolio
    image: hub.codefirst.iut.uca.fr/thomas.bellembois/codefirst-dockerproxy-clientdrone:latest
    environment:
      IMAGENAME: hub.codefirst.iut.uca.fr/dorian.hodin/portfolio:latest
      CONTAINERNAME: portfolio
      COMMAND: create
      OVERWRITE: true
      ADMINS: dorianhodin
    depends_on: [ build-portfolio]
