#stages:
# - deploy
#  - build
#test_app:
#build_app:
# image: python:3.6
# stage: test
# stage: build

# before_script:
# - python3 -V
# - ls -ltr
# - python3 -m venv venv
# - python3 -m venv python3-virtualenv
# - source python3-virtualenv/bin/activate
# - pwd
# - whoami
# script:
# - pip install Flask
# - echo $PATH
# - export FLASK_APP=hello.py
# - export FLASK_ENV=development
# - flask run  
# - echo "deploy to staging server"
# - systemctl daemon-reload
# - systemctl enable python.service
# - systemctl start python.service
# - systemctl status python.service 
# - echo "deploying to staging server"
# - sudo systemctl start python.service
# - sudo systemctl start prod.service
# - sudo  systemctl status python.service
# - |
 #       if [[ $CI_COMMIT_REF_NAME = master ]]; then
 #    echo "deploying to prod server"
    #   sudo systemctl start python.service
  #  elif [[ $CI_COMMIT_REF_NAME = dev ]]; then
  #    sudo systemctl start python.service
  #  else 
  #   echo "hello world"
  #   fi 
# environment:
 #  name: staging
  # url : http://localhost/test
# tags:
# - ci
job1:

 before_script:
   - python3 -V
   - ls -ltr
   - python3 -m venv venv
   - python3 -m venv python3-virtualenv
   - source python3-virtualenv/bin/activate
   - pwd
  # - whoami

 #stages:
 #  - production
 #  - development

 #production:
#  stage: production
 image: python:3.6
 script:
   - pip install Flask
   - echo "deploying to production server"
   - sudo systemctl start python.service
 only:
   - master

# development:
 # stage: development
 image: python:3.6
 script:
   - pip install Flask
   - echo "deploying to development server"
   - sudo systemctl start prod.service
 only:
   - dev
 tags:
 - ci
 
