Commit e35d1276 authored by Syed Bilal Raees's avatar Syed Bilal Raees

changes in yaml12

parent 3cf86565
stages: #stages:
# - deploy # - deploy
- build # - build
#test_app: #test_app:
build_app: #build_app:
image: python:3.6 # image: python:3.6
# stage: test # stage: test
stage: build # stage: build
before_script: # before_script:
- python3 -V # - python3 -V
- ls -ltr # - ls -ltr
- python3 -m venv venv # - python3 -m venv venv
- python3 -m venv python3-virtualenv # - python3 -m venv python3-virtualenv
- source python3-virtualenv/bin/activate # - source python3-virtualenv/bin/activate
- pwd # - pwd
- whoami # - whoami
script: # script:
- pip install Flask # - pip install Flask
- echo $PATH # - echo $PATH
# - export FLASK_APP=hello.py # - export FLASK_APP=hello.py
# - export FLASK_ENV=development # - export FLASK_ENV=development
# - flask run # - flask run
...@@ -30,17 +30,54 @@ build_app: ...@@ -30,17 +30,54 @@ build_app:
# - sudo systemctl start python.service # - sudo systemctl start python.service
# - sudo systemctl start prod.service # - sudo systemctl start prod.service
# - sudo systemctl status python.service # - sudo systemctl status python.service
- | # - |
if [[ $CI_COMMIT_REF_NAME = master ]]; then # if [[ $CI_COMMIT_REF_NAME = master ]]; then
echo "deploying to prod server" # echo "deploying to prod server"
sudo systemctl start python.service # sudo systemctl start python.service
elif [[ $CI_COMMIT_REF_NAME = dev ]]; then # elif [[ $CI_COMMIT_REF_NAME = dev ]]; then
sudo systemctl start python.service # sudo systemctl start python.service
else # else
echo "hello world" # echo "hello world"
fi # fi
# environment: # environment:
# name: staging # name: staging
# url : http://localhost/test # 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 prod 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: tags:
- ci - ci
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment