diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index c3e5d31..5a3df5d 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -1,10 +1,10 @@ name: Python application on: - push: + pull_request: paths: - 'python/*' - + jobs: build: @@ -23,6 +23,6 @@ jobs: - name: Build & Push Image run: | cd ./python - echo "${{ secrets.DOCKERPW }}" | docker login -u "[your dockerhub login here]" --password-stdin - docker image build -t [your dockerhub username here]/gitops:hellov1.0 . - docker push [your docker hub username here]/gitops:hellov1.0 + echo "${{ secrets.DOCKERPW }}" | docker login -u "julianoalberto" --password-stdin + docker image build -t julianoalberto/gitops:hellov1.2 . + docker push julianoalberto/gitops:hellov1.2 diff --git a/production/hello.yaml b/production/hello.yaml new file mode 100644 index 0000000..337d579 --- /dev/null +++ b/production/hello.yaml @@ -0,0 +1,19 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: hello + namespace: lasample + labels: + app: hello +spec: + selector: + matchLabels: + app: hello + template: + metadata: + labels: + app: hello + spec: + containers: + - name: hello + image: linuxacademycontent/gitops:hellov1.2 diff --git a/python/app.py b/python/app.py index 358088e..c6c628d 100644 --- a/python/app.py +++ b/python/app.py @@ -1,9 +1,12 @@ from flask import Flask + app = Flask(__name__) + @app.route("/") def hello(): - return "Hello World!" + return "Hello from prod!" + if __name__ == "__main__": - app.run(host='0.0.0.0', port=8000) + app.run(host="0.0.0.0", port=8000) diff --git a/qa/hello.yaml b/qa/hello.yaml new file mode 100644 index 0000000..337d579 --- /dev/null +++ b/qa/hello.yaml @@ -0,0 +1,19 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: hello + namespace: lasample + labels: + app: hello +spec: + selector: + matchLabels: + app: hello + template: + metadata: + labels: + app: hello + spec: + containers: + - name: hello + image: linuxacademycontent/gitops:hellov1.2 diff --git a/workloads/hello.yaml b/workloads/hello.yaml new file mode 100644 index 0000000..c0e630a --- /dev/null +++ b/workloads/hello.yaml @@ -0,0 +1,19 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: hello + namespace: lasample + labels: + app: hello +spec: + selector: + matchLabels: + app: hello + template: + metadata: + labels: + app: hello + spec: + containers: + - name: hello + image: linuxacademycontent/gitops:hellov1.0