Skip to content

Commit

Permalink
Merge pull request #508 from zurdi15/feature/improve_build_workflow
Browse files Browse the repository at this point in the history
Feature/improve build workflow
  • Loading branch information
zurdi15 committed Dec 22, 2023
2 parents 28eb442 + 366967c commit 865bd10
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Get last image rc version
if: github.ref == format('refs/heads/{0}', 'master')
run: |
CURRENT_RC_VERSION=$(wget -q -O - "https://hub.docker.com/v2/repositories/zurdi15/romm/tags?page_size=2" | grep -o '"name": *"[^"]*' | grep -o '[^"]*$' | grep "dev-${{ inputs.version }}-rc" | cut -d "-" -f 3 | cut -d "." -f 2)
[[ -z $CURRENT_RC_VERSION ]] && CURRENT_RC_VERSION=0
echo "NEXT_RC_VERSION=$(($CURRENT_RC_VERSION + 1))" >> $GITHUB_ENV
echo "NEXT_RC_VERSION: $NEXT_RC_VERSION"
- name: Generate Docker metadata
id: meta
uses: docker/metadata-action@v4
Expand All @@ -55,6 +63,7 @@ jobs:
# latest on release branch, prefix dev on other branches
latest=true
prefix=${{ github.ref != format('refs/heads/{0}', 'release') && 'dev-' || '' }},onlatest=true
suffix=${{ github.ref == format('refs/heads/{0}', 'master') && '-rc.$NEXT_RC_VERSION' || '' }},onlatest=false
tags: |
type=raw,value=${{ inputs.version }}
labels: |
Expand Down
16 changes: 8 additions & 8 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
{
"tasks": [
{
"label": "Launch frontend",
"type": "npm",
"script": "dev",
"path": "frontend",
"problemMatcher": [],
"label": "Launch frontend"
"script": "dev",
"problemMatcher": []
},
{
"label": "Launch backend",
"type": "shell",
"command": "cd backend && poetry run python3 main.py",
"label": "Launch backend",
"problemMatcher": []
},
{
"label": "Launch worker",
"type": "shell",
"command": "cd backend && poetry run python3 worker.py",
"label": "Launch worker",
"problemMatcher": []
},
{
"label": "Execute tests",
"type": "shell",
"command": "cd backend && poetry run pytest -vv -c ../pytest.ini",
"label": "Execute tests",
"problemMatcher": []
},
{
"label": "Setup development environment",
"type": "shell",
"command": "docker compose up -d",
"label": "Setup development environment",
"problemMatcher": []
},
{
"label": "Setup testing environment",
"type": "shell",
"command": "export $(cat .env | grep DB_ROOT_PASSWD | xargs) && docker exec -i mariadb mariadb -u root -p$DB_ROOT_PASSWD < backend/romm_test/setup.sql",
"label": "Setup testing environment",
"problemMatcher": []
}
]
Expand Down

0 comments on commit 865bd10

Please sign in to comment.