Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: larc-logs-transparentes/logs-transparentes
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.0.0
Choose a base ref
...
head repository: larc-logs-transparentes/logs-transparentes
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing 544 changed files with 83,720 additions and 33,471 deletions.
198 changes: 198 additions & 0 deletions .github/workflows/docker-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
name: Generate Tested Images

on:
push:
branches: [ "main" ]

env:
IMAGE_TAG: gh-${{github.run_number}}


jobs:

build:

runs-on: ubuntu-latest

steps:
- name: Download logs-transparentes source
uses: actions/checkout@v4
with:
repository: 'larc-logs-transparentes/logs-transparentes'
path: 'logs-transparentes'

- name: Set up QEMU for Docker
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

#- name: Add Multi platform support for Docker buildx
# run: docker run --privileged --rm tonistiigi/binfmt --install all

- name: Docker Image - BU Service
run: |
cd logs-transparentes/backend/bu_service
docker buildx build --tag ghcr.io/larc-logs-transparentes/bu-service:${{env.IMAGE_TAG}} \
--output "type=docker" \
--platform linux/amd64 .
- name: Docker Image - Backend Public
run: |
cd logs-transparentes/backend/public
docker buildx build --tag ghcr.io/larc-logs-transparentes/back-pub:${{env.IMAGE_TAG}} \
--output "type=docker" \
--platform linux/amd64 .
- name: Docker Image - Frontend
run: |
cd logs-transparentes/frontend_new
docker buildx build --tag ghcr.io/larc-logs-transparentes/frontend:${{env.IMAGE_TAG}} \
--output "type=docker" \
--platform linux/amd64 .
- name: Docker Image - TL Manager
run: |
cd logs-transparentes/tlmanager
docker buildx build --tag ghcr.io/larc-logs-transparentes/tlmanager:${{env.IMAGE_TAG}} \
--output "type=docker" \
--platform linux/amd64 .
- name: Docker Image - BU Utils
run: |
cd logs-transparentes/bu_utils
docker buildx build --tag ghcr.io/larc-logs-transparentes/bu-utils:${{env.IMAGE_TAG}} \
--output "type=docker" \
--platform linux/amd64 .
- name: Download config source
uses: actions/checkout@v4
with:
repository: 'larc-logs-transparentes/config'
path: 'config'

- name: Run Docker containers
run: |
cd config
docker network rm -f logst
docker network create logst
docker run --rm -d -p 27017:27017 -v ./hom/mongo.init.js:/docker-entrypoint-initdb.d/mongo.init.js -e MONGO_INITDB_ROOT_USERNAME=root -e MONGO_INITDB_ROOT_PASSWORD=1234 --name mongo-logst --hostname mongo-logst --network logst mongo:6.0.14
docker run --rm -d -p 9090:9090 --network logst --name bu-service -e MONGO_URL="mongodb://buuser:bupassword@mongo-logst/bu_service" -e TL_MANAGER_URL="http://tlmanager:8000" -e TREE_NAME_PREFIX="eleicao_" -e TREE_DEFAULT_COMMITMENT_SIZE=8 --hostname bu-service ghcr.io/larc-logs-transparentes/bu-service:${{env.IMAGE_TAG}}
docker run --rm -d -p 8080:8080 --network logst --name back-pub -v ./hom/backend.public.config.json:/app/src/config.json --hostname back-pub ghcr.io/larc-logs-transparentes/back-pub:${{env.IMAGE_TAG}}
docker run --rm -d -p 8000:8000 --network logst --name tlmanager -e URL="mongodb://tluser:tlpassword@mongo-logst:27017/tlmanager" --hostname tlmanager ghcr.io/larc-logs-transparentes/tlmanager:${{env.IMAGE_TAG}}
- name: Await system start ...
run: sleep 10

- name: Run tests
run: |
cd config/hom/tests
docker build . --file Dockerfile --tag ghcr.io/larc-logs-transparentes/tests:${{env.IMAGE_TAG}}
docker run --rm --name logst-test --network host ghcr.io/larc-logs-transparentes/tests:${{env.IMAGE_TAG}} pytest
- name: Stop containers
run: docker container stop tlmanager back-pub bu-service mongo-logst

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Generate other images for BU Service
run: |
cd logs-transparentes/backend/bu_service
docker buildx build \
--tag ghcr.io/larc-logs-transparentes/bu-service:${{env.IMAGE_TAG}} \
--platform linux/amd64,linux/arm64 \
--output "type=image,push=false" .
- name: Generate other images for Backend Public
run: |
cd logs-transparentes/backend/public
docker buildx build \
--tag ghcr.io/larc-logs-transparentes/back-pub:${{env.IMAGE_TAG}} \
--platform linux/amd64,linux/arm64 \
--output "type=image,push=false" .
- name: Generate other images for Frontend
run: |
cd logs-transparentes/frontend_new
docker buildx build \
--tag ghcr.io/larc-logs-transparentes/frontend:${{env.IMAGE_TAG}} \
--platform linux/amd64,linux/arm64 \
--output "type=image,push=false" .
- name: Generate other images for TL Manager
run: |
cd logs-transparentes/tlmanager
docker buildx build \
--tag ghcr.io/larc-logs-transparentes/tlmanager:${{env.IMAGE_TAG}} \
--platform linux/amd64,linux/arm64 \
--output "type=image,push=false" .
- name: Generate other images for BU Utils
run: |
cd logs-transparentes/bu_utils
docker buildx build \
--tag ghcr.io/larc-logs-transparentes/bu-utils:${{env.IMAGE_TAG}} \
--platform linux/amd64,linux/arm64 \
--output "type=image,push=false" .
- name: Publish BU Service
run: |
cd logs-transparentes/backend/bu_service
docker buildx build \
--tag ghcr.io/larc-logs-transparentes/bu-service:${{env.IMAGE_TAG}} \
--tag ghcr.io/larc-logs-transparentes/bu-service:latest \
--platform linux/amd64,linux/arm64 \
--push .
- name: Publish Backend Public
run: |
cd logs-transparentes/backend/public
docker buildx build \
--tag ghcr.io/larc-logs-transparentes/back-pub:${{env.IMAGE_TAG}} \
--tag ghcr.io/larc-logs-transparentes/back-pub:latest \
--platform linux/amd64,linux/arm64 \
--push .
- name: Publish Frontend
run: |
cd logs-transparentes/frontend_new
docker buildx build \
--tag ghcr.io/larc-logs-transparentes/frontend:${{env.IMAGE_TAG}} \
--tag ghcr.io/larc-logs-transparentes/frontend:latest \
--platform linux/amd64,linux/arm64 \
--push .
- name: Publish TL Manager
run: |
cd logs-transparentes/tlmanager
docker buildx build \
--tag ghcr.io/larc-logs-transparentes/tlmanager:${{env.IMAGE_TAG}} \
--tag ghcr.io/larc-logs-transparentes/tlmanager:latest \
--platform linux/amd64,linux/arm64 \
--push .
- name: Publish BU Utils
run: |
cd logs-transparentes/bu_utils
docker buildx build \
--tag ghcr.io/larc-logs-transparentes/bu-utils:${{env.IMAGE_TAG}} \
--tag ghcr.io/larc-logs-transparentes/bu-utils:latest \
--platform linux/amd64,linux/arm64 \
--push .
- name: Tag Repository logs-transparentes
uses: actions/github-script@v6
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: 'logs-transparentes',
ref: 'refs/tags/${{env.IMAGE_TAG}}',
sha: context.sha
})
70 changes: 70 additions & 0 deletions .github/workflows/test-only.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Test Only

on:
push:
branches-ignore: [ "main", "versao-demo", "teste-buildx" ]

env:
IMAGE_TAG: gh-${{github.run_number}}


jobs:

build:

runs-on: ubuntu-latest

steps:
- name: Download logs-transparentes source
uses: actions/checkout@v4
with:
repository: 'larc-logs-transparentes/logs-transparentes'
path: 'logs-transparentes'

- name: Docker Image - BU Service
run: |
cd logs-transparentes/backend/bu_service
docker build . --file Dockerfile --tag ghcr.io/larc-logs-transparentes/bu-service:${{env.IMAGE_TAG}}
- name: Docker Image - Backend Public
run: |
cd logs-transparentes/backend/public
docker build . --file Dockerfile --tag ghcr.io/larc-logs-transparentes/back-pub:${{env.IMAGE_TAG}}
- name: Docker Image - Frontend
run: |
cd logs-transparentes/frontend_new
docker build . --file Dockerfile --tag ghcr.io/larc-logs-transparentes/frontend:${{env.IMAGE_TAG}}
- name: Docker Image - TL Manager
run: |
cd logs-transparentes/tlmanager
docker build . --file Dockerfile --tag ghcr.io/larc-logs-transparentes/tlmanager:${{env.IMAGE_TAG}}
- name: Download config source
uses: actions/checkout@v4
with:
repository: 'larc-logs-transparentes/config'
path: 'config'

- name: Run Docker containers
run: |
cd config
docker network rm -f logst
docker network create logst
docker run --rm -d -p 27017:27017 -v ./hom/mongo.init.js:/docker-entrypoint-initdb.d/mongo.init.js -e MONGO_INITDB_ROOT_USERNAME=root -e MONGO_INITDB_ROOT_PASSWORD=1234 --name mongo-logst --hostname mongo-logst --network logst mongo:6.0.14
docker run --rm -d -p 9090:9090 --network logst --name bu-service -e MONGO_URL="mongodb://buuser:bupassword@mongo-logst/bu_service" -e TL_MANAGER_URL="http://tlmanager:8000" -e TREE_NAME_PREFIX="eleicao_" -e TREE_DEFAULT_COMMITMENT_SIZE=8 --hostname bu-service ghcr.io/larc-logs-transparentes/bu-service:${{env.IMAGE_TAG}}
docker run --rm -d -p 8080:8080 --network logst --name back-pub -v ./hom/backend.public.config.json:/app/src/config.json --hostname back-pub ghcr.io/larc-logs-transparentes/back-pub:${{env.IMAGE_TAG}}
docker run --rm -d -p 8000:8000 --network logst --name tlmanager -e URL="mongodb://tluser:tlpassword@mongo-logst:27017/tlmanager" --hostname tlmanager ghcr.io/larc-logs-transparentes/tlmanager:${{env.IMAGE_TAG}}
- name: Await system start ...
run: sleep 10

- name: Run tests
run: |
cd config/hom/tests
docker build . --file Dockerfile --tag ghcr.io/larc-logs-transparentes/tests:${{env.IMAGE_TAG}}
docker run --rm --name logst-test --network host ghcr.io/larc-logs-transparentes/tests:${{env.IMAGE_TAG}} pytest
- name: Stop containers
run: docker container stop tlmanager back-pub bu-service mongo-logst
Loading