This repository has been archived by the owner on Feb 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup infrastructure for GitHub releases and adjust documentation and wording
- Loading branch information
1 parent
d7b9a4e
commit 85b41eb
Showing
19 changed files
with
182 additions
and
66 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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Build and Push Docker Image (DEV) | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }}-dev | ||
DEV_BRANCH: dev | ||
|
||
jobs: | ||
build_and_push: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ env.DEV_BRANCH }} | ||
|
||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
#with: | ||
# buildkitd-flags: --debug | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build Docker image | ||
uses: docker/[email protected] | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
file: ./config/Dockerfile | ||
build-args: | | ||
BTPSA_VERSION_GIT_ARG=${{ github.sha }} | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
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
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 |
---|---|---|
|
@@ -9,7 +9,7 @@ on: | |
types: [btp-metadata-update] | ||
|
||
env: | ||
TARGET_BRANCH: main | ||
TARGET_BRANCH: dev | ||
METADATA_SOURCE_OWNER: SAP-samples | ||
METADATA_SOURCE_REPO: btp-service-metadata | ||
METADATA_VERSION: v0 | ||
|
@@ -112,4 +112,4 @@ jobs: | |
git config user.email "[email protected]" | ||
git config user.name "[btpsa bot] docu generation" | ||
git diff --quiet && git diff --staged --quiet || git commit -m "[btpsa bot] Generate parameter documentation" | ||
git push | ||
git push origin ${{ env.TARGET_BRANCH }} |
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
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,27 +1,37 @@ | ||
#!/usr/bin/pwsh | ||
Param( | ||
[Parameter(Mandatory=$False)] | ||
[bool]$RunFromRegistry = $False | ||
[bool]$RunReleaseFromRegistry = $False, | ||
[bool]$RunDevFromRegistry = $False | ||
) | ||
|
||
Write-Host "Cleaning up containers and images (if existing)" -ForegroundColor green | ||
docker container stop "btp-setup-automator" | ||
docker container rm -f "btp-setup-automator" | ||
docker image rm -f "btp-setup-automator" | ||
|
||
if ( $RunFromRegistry -eq $False ) | ||
if ( $RunReleaseFromRegistry -eq $True ) | ||
{ | ||
Write-Host "Building the container image ..." -ForegroundColor green | ||
docker image build -t btp-setup-automator:latest -f "config/Dockerfile" . | ||
Write-Host "Pulling container image RELEASE from registry ..." -ForegroundColor green | ||
docker pull ghcr.io/sap-samples/btp-setup-automator:latest | ||
|
||
Write-Host "Starting the container as 'btp-setup-automator' - Access possible e.g. via VS Code" -ForegroundColor green | ||
docker container run -e BTPSA_VERSION_GIT="$(git describe --long --tags --always)" --rm -it -d --name "btp-setup-automator" "btp-setup-automator" | ||
docker container run --rm -it -d --name "btp-setup-automator" ghcr.io/sap-samples/btp-setup-automator:latest | ||
} | ||
|
||
elseif ($RunDevFromRegistry -eq $True) { | ||
Write-Host "Pulling container image DEV from registry ..." -ForegroundColor green | ||
docker pull ghcr.io/sap-samples/btp-setup-automator-dev:dev | ||
|
||
Write-Host "Starting the container as 'btp-setup-automator' - Access possible e.g. via VS Code" -ForegroundColor green | ||
docker container run --rm -it -d --name "btp-setup-automator" ghcr.io/sap-samples/btp-setup-automator-dev:dev | ||
} | ||
|
||
else | ||
{ | ||
Write-Host "Pulling container image from registry ..." -ForegroundColor green | ||
docker pull ghcr.io/sap-samples/btp-setup-automator:main | ||
Write-Host "Building the container image ..." -ForegroundColor green | ||
docker image build -t btp-setup-automator:latest -f "config/Dockerfile" . | ||
|
||
Write-Host "Starting the container as 'btp-setup-automator' - Access possible e.g. via VS Code" -ForegroundColor green | ||
docker container run --rm -it -d --name "btp-setup-automator" ghcr.io/sap-samples/btp-setup-automator:main | ||
docker container run -e BTPSA_VERSION_GIT="$(git describe --long --tags --always)" --rm -it -d --name "btp-setup-automator" "btp-setup-automator" | ||
} |
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
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.