Commit 5a7c1a35 authored by Syed Bilal Raees's avatar Syed Bilal Raees

deploying

parent add0ca8e
Pipeline #2026 passed with stage
in 10 seconds
stages: stages:
- test # - test
- deploy
test_app: #test_app:
deploy_app:
image: python:3.6 image: python:3.6
stage: test # stage: test
stage: deploy
before_script: before_script:
- python3 -V - python3 -V
...@@ -14,6 +16,10 @@ test_app: ...@@ -14,6 +16,10 @@ test_app:
- source python3-virtualenv/bin/activate - source python3-virtualenv/bin/activate
script: script:
- pip install Flask - pip install Flask
- python test.py # - python test.py
- echo "deploy to staging server"
environment:
name: staging
url : http://myApp.com
tags: tags:
- ci - ci
#import flask import flask
from flask import Flask, request #from flask import Flask, request
#app = flask.Flask(__name__) app = flask.Flask(__name__)
#app.config["DEBUG"] = True app.config["DEBUG"] = True
app = Flask(__name__) #app = Flask(__name__)
@app.route('/', methods=['GET']) @app.route('/', methods=['GET'])
def home(): def home():
return "<h1>HelloO DevOps people</h1><p>This site is a prototype API for greeting Nisum DevOps!</p>" return "<h1>HelloO DevOps people</h1><p>This site is a prototype API for greeting Nisum DevOps!</p>"
#app.run(host='myApp.com', port=5000) app.run(host='myApp.com', port=5000)
@app.route('/') #@app.route('/')
def calc(): #def calc():
a = int(request.args.get('a')) # a = int(request.args.get('a'))
b = int(request.args.get('b')) # b = int(request.args.get('b'))
return str(sum(a, b)) # return str(sum(a, b))
def sum(a, b): #def sum(a, b):
return a + b # return a + b
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