-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #12 from OWASP/dev
Dev Merge and add create GH action workflow
- Loading branch information
Showing
21 changed files
with
310 additions
and
149 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: "Dev Release: Build and Push OWASP OFFAT Docker Images to DockerHub" | ||
|
||
on: | ||
push: | ||
branches: | ||
- "dev" | ||
|
||
jobs: | ||
build-and-push-dev-docker-images: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Branch Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Build and push offat-base docker image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: ./src/ | ||
file: ./src/DockerFiles/base-Dockerfile | ||
push: true | ||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/offat-base:dev | ||
platforms: linux/amd64,linux/arm64 | ||
- name: Build and push offat docker image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: ./src/ | ||
file: ./src/DockerFiles/dev/cli-Dockerfile | ||
push: true | ||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/offat:dev | ||
platforms: linux/amd64,linux/arm64 | ||
- name: Build and push offat-api docker image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: ./src/ | ||
file: ./src/DockerFiles/dev/backend-api-Dockerfile | ||
push: true | ||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/offat-api:dev | ||
platforms: linux/amd64,linux/arm64 | ||
- name: Build and push offat-api-worker docker image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: ./src/ | ||
file: ./src/DockerFiles/dev/backend-api-worker-Dockerfile | ||
push: true | ||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/offat-api-worker:dev | ||
platforms: linux/amd64,linux/arm64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# This workflow will upload a Python Package using Twine when a release is created | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries | ||
|
||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
name: Upload OWASP OFFAT Python Package to PyPi | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
deploy: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.x' | ||
- name: change cwd to src directory | ||
run: cd src | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
- name: Build package | ||
run: | | ||
cd src | ||
python -m build | ||
- name: Publish package | ||
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
packages_dir: src/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: "Release: Build and Push OWASP OFFAT Docker Images to DockerHub" | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
build-and-push-main-docker-images: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Branch Checkout | ||
uses: actions/checkout@v2 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Build and push offat-base docker image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: ./src/ | ||
file: ./src/DockerFiles/base-Dockerfile | ||
push: true | ||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/offat-base:latest | ||
platforms: linux/amd64,linux/arm64 | ||
- name: Build and push offat docker image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: ./src/ | ||
file: ./src/DockerFiles/main/cli-Dockerfile | ||
push: true | ||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/offat:latest | ||
platforms: linux/amd64,linux/arm64 | ||
- name: Build and push offat-api docker image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: ./src/ | ||
file: ./src/DockerFiles/main/backend-api-Dockerfile | ||
push: true | ||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/offat-api:latest | ||
platforms: linux/amd64,linux/arm64 | ||
- name: Build and push offat-api-worker docker image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: ./src/ | ||
file: ./src/DockerFiles/main/backend-api-worker-Dockerfile | ||
push: true | ||
tags: ${{ secrets.DOCKERHUB_USERNAME }}/offat-api-worker:latest | ||
platforms: linux/amd64,linux/arm64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM dmdhrumilmistry/offat-base:dev | ||
|
||
EXPOSE 8000 | ||
|
||
ENTRYPOINT [ "python", "-m", "offat.api" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
FROM dmdhrumilmistry/offat-base:dev | ||
|
||
WORKDIR /offat | ||
|
||
ENTRYPOINT [ "rq", "worker", "offat_task_queue" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM dmdhrumilmistry/offat-base:dev | ||
|
||
ENTRYPOINT [ "offat" ] |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
from uvicorn import run | ||
|
||
|
||
if __name__ == '__main__': | ||
def start(): | ||
run( | ||
app='offat.api.app:app', | ||
host="0.0.0.0", | ||
port=8000, | ||
workers=2, | ||
reload=True | ||
) | ||
) | ||
|
||
if __name__ == '__main__': | ||
start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.