Skip to content

Commit

Permalink
added docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher Becker committed Jun 11, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 7c203a6 commit acbee3c
Showing 5 changed files with 31 additions and 20 deletions.
32 changes: 27 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -8,10 +8,8 @@ jobs:
pre-feature-pipeline:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install dependencies
@@ -30,6 +28,30 @@ jobs:
TRELLO_API_KEY: ${{ secrets.TRELLO_API_KEY }}
TRELLO_API_TOKEN: ${{ secrets.TRELLO_API_TOKEN }}

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: docker/setup-buildx-action@v2
- uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build Docker image
run: |
docker build -t ${{ github.event.repository.full_name }}:${{ github.event.head_commit.id }} .
# - name: Save Docker image to file
# run: |
# docker save ${{ github.event.repository.full_name }}:${{ github.event.head_commit.id }} -o docker-image-${{ github.event.head_commit.id }}.tar
# - name: Upload Docker image artifact
# uses: actions/upload-artifact@v3
# with:
# name: docker-image-${{ github.event.head_commit.id }}
# path: docker-image-${{ github.event.head_commit.id }}.tar
needs: pre-feature-pipeline

unittest:
runs-on: ubuntu-latest
steps:
@@ -51,4 +73,4 @@ jobs:
with:
name: pytest-results
path: results.xml
needs: pre-feature-pipeline
needs: build
10 changes: 1 addition & 9 deletions pipeline/GitCommit.py
Original file line number Diff line number Diff line change
@@ -11,9 +11,8 @@ class GitCommit:
'''
def __init__(self, branch_name, commit_hash, commit_message,
image_name, project_url, pipeline_id, pipeline_link_url,
commit_link_url, test_report_link_url, codequality_report_link_url):
commit_link_url, test_report_link_url):
self.branch_name = branch_name
print(branch_name)
self.commit_hash = commit_hash
self.commit_message = commit_message
self.image_name = image_name
@@ -22,7 +21,6 @@ def __init__(self, branch_name, commit_hash, commit_message,
self.pipeline_link_url = pipeline_link_url
self.commit_link_url = commit_link_url
self.test_report_link_url = test_report_link_url
self.codequality_report_link_url = codequality_report_link_url

@staticmethod
def check_source_system():
@@ -89,9 +87,3 @@ def get_test_report_link_url(self):
Gibt den Link zum Unit Test Report zurück.
'''
return self.test_report_link_url

def get_codequality_report_link_url(self):
'''
Gibt den Link zum Codequalitäts Report zurück.
'''
return self.codequality_report_link_url
5 changes: 2 additions & 3 deletions pipeline/GitHubCommit.py
Original file line number Diff line number Diff line change
@@ -21,9 +21,8 @@ def __init__(self):
github_project_url = os.environ.get('GH_PROJECT_URL')
github_pipeline_id = os.environ.get('GITHUB_RUN_ID')
github_pipeline_link_url = f'{github_project_url}/actions/runs/{github_pipeline_id}'
github_test_report_link_url = 'placeholder_string'
github_codequality_report_link_url = 'placeholder_string'
github_test_report_link_url = github_pipeline_link_url

super().__init__(github_branch_name, github_commit_hash, github_commit_message,
github_image_name, github_project_url, github_pipeline_id, github_pipeline_link_url,
github_commit_link_url, github_test_report_link_url, github_codequality_report_link_url)
github_commit_link_url, github_test_report_link_url)
3 changes: 1 addition & 2 deletions pipeline/GitLabCommit.py
Original file line number Diff line number Diff line change
@@ -28,8 +28,7 @@ def __init__(self):
gitlab_pipeline_link_url = f'{gitlab_project_url}/-/pipelines/{gitlab_pipeline_id}'
gitlab_commit_link_url = f'{gitlab_project_url}/-/commit/{gitlab_commit_hash}'
gitlab_test_report_link_url = f'{gitlab_pipeline_link_url}/test_report'
gitlab_codequality_report_link_url = f'{gitlab_pipeline_link_url}/codequality_report'

super().__init__(gitlab_branch_name, gitlab_commit_hash, gitlab_commit_message,
gitlab_image_name, gitlab_project_url, gitlab_pipeline_id, gitlab_pipeline_link_url,
gitlab_commit_link_url, gitlab_test_report_link_url, gitlab_codequality_report_link_url)
gitlab_commit_link_url, gitlab_test_report_link_url)
1 change: 0 additions & 1 deletion pipeline/TrelloTask.py
Original file line number Diff line number Diff line change
@@ -107,7 +107,6 @@ def intra_feature_branch_pipeline(self):
- Die Review muss [hier]({self.git_commit.get_pipeline_link_url()}) akzeptiert oder abgelehnt werden.
- Die Ergebnisse der CI Tests finden sich im Anhang dieses Tasks.
- Die Ergebnisse des Unit Tests findet sich [hier]({self.git_commit.get_test_report_link_url()})
- Die Ergebnisse des Code Qualität findet sich [hier]({self.git_commit.get_codequality_report_link_url()})
'''
self.__add_new_comment(card_comment_text)

0 comments on commit acbee3c

Please sign in to comment.