-
Notifications
You must be signed in to change notification settings - Fork 37
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 #216 from D10S0VSkY-OSS/feature/terragrunt
🔥feat: Add PoC terragrunt
- Loading branch information
Showing
19 changed files
with
231 additions
and
139 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 |
---|---|---|
@@ -1,40 +1,38 @@ | ||
name: SLD API backend Docker Image CI | ||
|
||
on: | ||
# Triggers the workflow on push events but only for the main branch | ||
push: | ||
branches: [ master ] | ||
# Allows you to run this workflow manually from the Actions tab | ||
release: | ||
types: [created] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
||
build: | ||
|
||
build-and-push: | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: docker login | ||
|
||
# Login to Docker Hub | ||
- name: Docker login | ||
env: | ||
DOCKER_USER: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
run: | | ||
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD | ||
run: docker login -u $DOCKER_USER -p $DOCKER_PASSWORD | ||
|
||
- name: Build the Docker image with tag | ||
# Build and push the Docker image with new tag for releases | ||
- name: Build and push Docker image with new tag | ||
if: github.event_name == 'release' | ||
working-directory: ./sld-api-backend | ||
run: docker build . --file Dockerfile --tag ${{ secrets.DOCKER_USERNAME }}/sld-api:3.2.0 | ||
|
||
- name: Docker Push with tag | ||
#if: github.event.pull_request.merged == true | ||
run: docker push ${{ secrets.DOCKER_USERNAME }}/sld-api:3.2.0 | ||
run: | | ||
TAG=$(echo $GITHUB_REF | sed 's/refs\/tags\///') | ||
docker build . --file Dockerfile --tag ${{ secrets.DOCKER_USERNAME }}/sld-api:$TAG | ||
docker push ${{ secrets.DOCKER_USERNAME }}/sld-api:$TAG | ||
- name: Build the Docker image | ||
# Build and push the Docker image with 'latest' tag for master branch | ||
- name: Build and push Docker image with latest tag | ||
if: github.ref == 'refs/heads/master' | ||
working-directory: ./sld-api-backend | ||
run: docker build . --file Dockerfile --tag ${{ secrets.DOCKER_USERNAME }}/sld-api:latest | ||
|
||
- name: Docker Push | ||
#if: github.event.pull_request.merged == true | ||
run: docker push ${{ secrets.DOCKER_USERNAME }}/sld-api:latest | ||
|
||
run: | | ||
docker build . --file Dockerfile --tag ${{ secrets.DOCKER_USERNAME }}/sld-api:latest | ||
docker push ${{ secrets.DOCKER_USERNAME }}/sld-api:latest |
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,39 +1,40 @@ | ||
name: SLD Dashboard Docker Image CI | ||
|
||
on: | ||
# Triggers the workflow on push events but only for the main branch | ||
push: | ||
branches: [ master ] | ||
# Allows you to run this workflow manually from the Actions tab | ||
release: | ||
types: [created] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
||
build: | ||
|
||
build-and-push: | ||
runs-on: ubuntu-22.04 | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: docker login | ||
|
||
# Login to Docker Hub | ||
- name: Docker login | ||
env: | ||
DOCKER_USER: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
run: | | ||
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD | ||
run: docker login -u $DOCKER_USER -p $DOCKER_PASSWORD | ||
|
||
- name: Build the Docker image with tags | ||
working-directory: ./sld-dashboard | ||
run: docker build . --file Dockerfile --tag ${{ secrets.DOCKER_USERNAME }}/sld-dashboard:3.2.0 | ||
|
||
- name: Docker Push with tags | ||
#if: github.event.pull_request.merged == true | ||
run: docker push ${{ secrets.DOCKER_USERNAME }}/sld-dashboard:3.2.0 | ||
- name: Build the Docker image | ||
# Build and push the Docker image with new tag for releases | ||
- name: Build and push Docker image with new tag | ||
if: github.event_name == 'release' | ||
working-directory: ./sld-dashboard | ||
run: docker build . --file Dockerfile --tag ${{ secrets.DOCKER_USERNAME }}/sld-dashboard:latest | ||
|
||
- name: Docker Push | ||
#if: github.event.pull_request.merged == true | ||
run: docker push ${{ secrets.DOCKER_USERNAME }}/sld-dashboard:latest | ||
run: | | ||
TAG=$(echo $GITHUB_REF | sed 's/refs\/tags\///') | ||
docker build . --file Dockerfile --tag ${{ secrets.DOCKER_USERNAME }}/sld-dashboard:$TAG | ||
docker push ${{ secrets.DOCKER_USERNAME }}/sld-dashboard:$TAG | ||
# Build and push the Docker image with 'latest' tag for master branch | ||
- name: Build and push Docker image with latest tag | ||
if: github.ref == 'refs/heads/master' | ||
working-directory: ./sld-dashboard | ||
run: | | ||
docker build . --file Dockerfile --tag ${{ secrets.DOCKER_USERNAME }}/sld-dashboard:latest | ||
docker push ${{ secrets.DOCKER_USERNAME }}/sld-dashboard:latest |
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
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,16 @@ | ||
from pydantic import BaseModel | ||
from typing import Optional, Dict | ||
|
||
|
||
class StructActionsBase(BaseModel): | ||
name: str | ||
stack_name: str | ||
branch: str | ||
environment: str | ||
squad: str | ||
iac_type: Optional[str] = "terraform" | ||
version: str | ||
secreto: Dict | ||
variables_file: Optional[str] | ||
project_path: Optional[str] | ||
task_id: str |
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,24 @@ | ||
from typing import Type | ||
from abc import ABC, abstractmethod | ||
from src.worker.domain.services.command import command | ||
from src.worker.domain.entities.actions import StructActionsBase | ||
|
||
|
||
class Actions(ABC): | ||
def __init__(self, params: StructActionsBase, command: Type[command] = command) -> None: | ||
self.name = params.name | ||
self.stack_name = params.stack_name | ||
self.branch = params.branch | ||
self.environment = params.environment | ||
self.squad = params.squad | ||
self.iac_type = params.iac_type | ||
self.version = params.version | ||
self.secreto = params.secreto | ||
self.variables_file = params.variables_file | ||
self.project_path = params.project_path | ||
self.task_id = params.task_id | ||
self.command = command | ||
|
||
@abstractmethod | ||
def execute_deployer_command(self, action: str) -> dict: | ||
pass |
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,6 +1,7 @@ | ||
from abc import ABC, abstractmethod | ||
from abc import ABC | ||
|
||
|
||
class IProviderArtifactRequirements(ABC): | ||
@staticmethod | ||
def artifact_download(name, stack_name, environment, squad, git_repo, branch, project_path): | ||
# logic to download artifact | ||
pass | ||
pass |
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
Oops, something went wrong.