-
Notifications
You must be signed in to change notification settings - Fork 0
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 #3 from TogetherCrew/feature/10-create-a-python-se…
…rvice-template-repository Github action
- Loading branch information
Showing
8 changed files
with
60 additions
and
8 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,12 @@ | ||
name: Production CI/CD Pipeline | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
ci: | ||
uses: TogetherCrew/operations/.github/workflows/ci.yml@main | ||
secrets: | ||
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} |
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,9 @@ | ||
name: Staging CI/CD Pipeline | ||
|
||
on: pull_request | ||
|
||
jobs: | ||
ci: | ||
uses: TogetherCrew/operations/.github/workflows/ci.yml@main | ||
secrets: | ||
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} |
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,13 +1,12 @@ | ||
FROM python:3.10-alpine AS base | ||
# It's recommended that we use `bullseye` for Python (alpine isn't suitable as it conflcts with numpy) | ||
FROM python:3.10-bullseye AS base | ||
WORKDIR /project | ||
COPY . . | ||
RUN pip3 install -r requirements.txt | ||
|
||
FROM base AS test | ||
CMD ["python3", "-m", "coverage", "run" ,"-m", "pytest", "tests"] | ||
RUN python3 -m coverage run -m pytest tests | ||
CMD ["python3", "-m", "coverage", "lcov" ,"-o", "coverage/lcov.info"] | ||
|
||
FROM base AS prod-server | ||
FROM base AS prod | ||
CMD ["python3", "server.py"] | ||
|
||
FROM base as prod-worker | ||
CMD ["python3", "worker.py"] |
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,14 @@ | ||
version: "3.9" | ||
|
||
services: | ||
server: | ||
build: | ||
context: . | ||
target: prod | ||
dockerfile: Dockerfile | ||
worker: | ||
build: | ||
context: . | ||
target: prod | ||
dockerfile: Dockerfile | ||
command: python3 worker.py |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
attrs==22.2.0 | ||
dnspython==2.2.1 | ||
exceptiongroup==1.1.0 | ||
iniconfig==2.0.0 | ||
numpy==1.25.1 | ||
packaging==23.0 | ||
pluggy==1.0.0 | ||
pymongo==4.3.3 | ||
pytest==7.2.0 | ||
python-dateutil==2.8.2 | ||
pytz==2022.7.1 | ||
python-dotenv==0.21.1 | ||
six==1.16.0 | ||
tomli==2.0.1 | ||
pandas==2.0.3 | ||
coverage==7.2.7 | ||
networkx | ||
neo4j |
Empty file.
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,2 @@ | ||
def test_sample(): | ||
assert 3 != 5 |