diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..5fd4c4308 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,19 @@ +on: [push] + +jobs: + zap_scan: + runs-on: ubuntu-latest + name: Scan the webapplication + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + ref: master + - name: ZAP Scan + uses: zaproxy/action-full-scan@v0.3.0 + with: + token: ${{ secrets.GITHUB_TOKEN }} + docker_name: 'owasp/zap2docker-stable' + target: 'http://itsecgames.com/' + rules_file_name: '.zap/rules.tsv' + cmd_options: '-a' diff --git a/.github/workflows/pythonapp.yml b/.github/workflows/pythonapp.yml index c3e5d3176..044838a8d 100644 --- a/.github/workflows/pythonapp.yml +++ b/.github/workflows/pythonapp.yml @@ -1,7 +1,7 @@ name: Python application on: - push: + pull_request: paths: - 'python/*' @@ -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 "aakram786" --password-stdin + docker image build -t aakram786/gitops:hellov1.2 . + docker push aakram786/gitops:hellov1.2 diff --git a/python/app.py b/python/app.py index 358088e4c..387562c7d 100644 --- a/python/app.py +++ b/python/app.py @@ -3,7 +3,7 @@ @app.route("/") def hello(): - return "Hello World!" + return "Hello LA Student! Pull request" if __name__ == "__main__": app.run(host='0.0.0.0', port=8000) diff --git a/workloads/hello.yaml b/workloads/hello.yaml new file mode 100644 index 000000000..c0e630aa6 --- /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