stages:
  - build
  - deploy

build:
  image: docker:stable
  variables:
    DOCKER_HOST: tcp://docker:2375/
    DOCKER_DRIVER: overlay2
  services:
    - docker:dind
  stage: build
  script:
    - echo $DOCKERHUBUSER
    - echo $DOCKERHUBPASSWORD
    - docker login -u $DOCKERHUBUSER -p $DOCHERHUBPASSWORD docker.io
    - docker build --tag=tes .
    - docker push l1ll1/tes:latest
  artifacts:
    paths:
      - tes.tar.gz

deploy_test:
  stage: deploy
  only:
    - testing@hpc-team/strudelv2_spa
  tags: 
    - deploy_test
  script:
    - echo "deploying test"
  dependencies:
    - build

deploy_dev:
  stage: deploy
  only:
    - dev@hpc-team/strudelv2_spa
  tags: 
    - deploy_dev
  script:
    - echo "deploying dev"
    - ls -l
    - ./install.sh
  dependencies:
    - build
