forked from hotosm/tasking-manager
-
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.
fix: job workflow as per circleci existing workflow
- Loading branch information
1 parent
f6658b2
commit 5eca227
Showing
4 changed files
with
46 additions
and
32 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 |
---|---|---|
|
@@ -16,32 +16,6 @@ on: | |
workflow_dispatch: | ||
|
||
jobs: | ||
backend-test: | ||
uses: naxa-developers/tasking-manager/.github/workflows/test_compose.yml@ci-gh-workflows | ||
with: | ||
image_name: ghcr.io/${{ github.repository }}/backend | ||
pre_command: | | ||
docker compose --file docker-compose.yml up -d | ||
sleep 15 | ||
docker compose --file docker-compose.yml logs tm-backend | ||
compose_service: tm-backend | ||
build_target: prod | ||
compose_command: curl -i http://localhost:5000/api/v2/ | ||
tag_override: ci-${{ github.ref_name }} | ||
# coverage: true | ||
example_env_file_path: example.env | ||
env_file_path: tasking-manager.env | ||
secrets: inherit | ||
|
||
backend-build: | ||
uses: hotosm/gh-workflows/.github/workflows/[email protected] | ||
with: | ||
context: . | ||
build_target: prod | ||
image_name: ghcr.io/${{ github.repository }}/backend | ||
dockerfile: Dockerfile | ||
scan_image: false | ||
secrets: inherit | ||
|
||
frontend-test: | ||
uses: naxa-developers/tasking-manager/.github/workflows/frontend-test.yml@ci-gh-workflows | ||
|
@@ -51,6 +25,7 @@ jobs: | |
context: ./frontend | ||
cache-key-file: ./frontend/yarn.lock | ||
package-manager: yarn | ||
# TODO: Verify this with frontend team | ||
test_frontend_command: | | ||
CI=true yarn test -w 1 | ||
# test_frontend_build: false | ||
|
@@ -85,11 +60,50 @@ jobs: | |
ls -alh | ||
ls -alh build | ||
backend-test: | ||
uses: naxa-developers/tasking-manager/.github/workflows/test_compose.yml@ci-gh-workflows | ||
with: | ||
image_name: ghcr.io/${{ github.repository }}/backend | ||
pre_command: | | ||
docker compose --file docker-compose.yml up -d | ||
sleep 15 | ||
docker compose --file docker-compose.yml logs tm-backend | ||
compose_service: tm-backend | ||
build_target: prod | ||
# TODO: Compose command to be updated once dev have test setup running. For now just a simple curl command. | ||
compose_command: curl -i http://localhost:5000/api/v2/ | ||
tag_override: ci-${{ github.ref_name }} | ||
# coverage: true | ||
example_env_file_path: example.env | ||
env_file_path: tasking-manager.env | ||
secrets: inherit | ||
|
||
backend-build: | ||
uses: hotosm/gh-workflows/.github/workflows/[email protected] | ||
with: | ||
context: . | ||
build_target: prod | ||
image_name: ghcr.io/${{ github.repository }}/backend | ||
dockerfile: Dockerfile | ||
scan_image: false | ||
secrets: inherit | ||
|
||
backup-database: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- backend-build | ||
- backend-test | ||
name: Backup Database before deployment | ||
steps: | ||
- name: Create Snapshot | ||
run: | ||
echo " TODO Database backup Steps; See CircleCI" | ||
#TODO: Check circleci for references | ||
|
||
backend_deploy_to_vm: | ||
name: Deploy Backend to VM | ||
needs: | ||
- backend-test | ||
- backend-build | ||
- backup-database | ||
uses: naxa-developers/tasking-manager/.github/workflows/remote_deploy_compose.yml@ci-gh-workflows | ||
with: | ||
docker_compose_file: docker-compose.yml | ||
|
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 |
---|---|---|
|
@@ -54,7 +54,7 @@ on: | |
|
||
|
||
jobs: | ||
node-build: | ||
frontend-test: | ||
runs-on: ${{ inputs.runner-class }} | ||
|
||
environment: | ||
|
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