-
Notifications
You must be signed in to change notification settings - Fork 42
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 #100 from batamsieuhang/test-loadbalancers
DoAnhTu nop bai giua ki
- Loading branch information
Showing
54 changed files
with
2,681 additions
and
0 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,48 @@ | ||
# This is a basic workflow to help you get started with Actions | ||
|
||
name: CI | ||
|
||
# Controls when the workflow will run | ||
on: | ||
# Triggers the workflow on push or pull request events but only for the "main" branch | ||
push: | ||
branches: ["*"] | ||
pull_request: | ||
branches: ["main"] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
# This workflow contains a single job called "build" | ||
build: | ||
# The type of runner that the job will run on | ||
runs-on: ubuntu-latest | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v3 | ||
|
||
# deploy apllication by docker compose to test | ||
- name: Docker Compose Action | ||
uses: isbang/[email protected] | ||
with: | ||
compose-file: "./10.GK/DoAnhTu/docker-compose.yml" | ||
down-flags: "--volumes" | ||
|
||
# Test application run or die | ||
- name: Test application run or die | ||
run: | | ||
curl 127.0.0.1:5000 | ||
curl 127.0.0.1:5001 | ||
curl 127.0.0.1:8000 | ||
- name: Run test by pytest | ||
run: | | ||
cd 10.GK/DoAnhTu/app/test | ||
python3 --version | ||
pip install pytest | ||
pip install -r test_requirements.txt | ||
pytest -s |
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,32 @@ | ||
name: Release Workflow | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
jobs: | ||
build-and-push: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Login to Docker Hub | ||
run: | | ||
echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin | ||
env: | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USER}} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Build and push Docker images | ||
run: | | ||
cd 10.GK/DoAnhTu/ | ||
docker-compose build | ||
docker images | ||
docker tag doanhtu_appuser ${{ secrets.DOCKER_USER}}/doanhtu_appuser:${{ github.ref_name }} | ||
docker push ${{ secrets.DOCKER_USER}}/doanhtu_appuser:${{ github.ref_name }} | ||
env: | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USER }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} |
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,8 @@ | ||
.vscode/ | ||
flask-env/ | ||
instance/ | ||
__pycache__/ | ||
|
||
flask_app/ | ||
.vscode/ | ||
settings.json |
Oops, something went wrong.