Commit 4fadfb90 authored by Syed Bilal Raees's avatar Syed Bilal Raees

environment changes in yaml

parent a86594f0
Pipeline #2069 failed
stages:
#stages:
# - deploy
- build
# - build
#test_app:
build_app:
image: python:3.6
#build_app:
# image: python:3.6
# stage: test
stage: build
# 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
# 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
# - /usr/bin/find / -name systemctl
# - export FLASK_APP=hello.py
# - export FLASK_ENV=development
......@@ -31,17 +31,50 @@ build_app:
# - sudo systemctl start python.service
# - sudo systemctl start prod.service
# - sudo systemctl status python.service
- |
if [[ $CI_COMMIT_REF_NAME == master ]]; then
echo "it's a prod server"
sudo systemctl start prod.service
# - |
# if [[ $CI_COMMIT_REF_NAME == master ]]; then
# echo "it's a prod server"
# sudo systemctl start prod.service
# elif [[ $CI_COMMIT_REF_NAME == dev ]]; then
else
echo "it's a dev server"
sudo systemctl start python.service
fi
# else
# echo "it's a dev server"
# sudo systemctl start python.service
# fi
# environment:
# name: staging
# url : http://localhost/test
tags:
- ci
build_app:
image: python:3.6
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
script:
- pip install Flask
- sudo systemctl start prod.service
only:
- dev
development:
stage: development
script:
- pip install Flask
# - echo $PATH
- echo "deploying to staging server"
- sudo systemctl start python.service
only:
- master
tags:
- 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