Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true
charset = utf-8

[*.{yml,yaml}]
indent_size = 2
tab-width = 2
max_line_length = 160
indent_size = 2
54 changes: 26 additions & 28 deletions .github/workflows/build_config_server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,32 +33,30 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Build Image
run: ./build.ps1 -Name '${{ env.IMAGE_NAME }}' -Registry '${{ env.REGISTRY }}' -Tag '${{ env.TAG }}'
shell: pwsh
env:
TAG: ${{ github.event_name == 'pull_request' && format('-t {0}/{1}:pr-{2}', env.REGISTRY, env.IMAGE_NAME, github.event.number) || '' }}

- name: Login to container registry
uses: docker/login-action@v3
with:
registry: ${{ vars.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Push image
run: docker push --all-tags ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- uses: actions/github-script@v7
# - name: Build Image
# run: ./build.ps1 -Name '${{ env.IMAGE_NAME }}' -Registry '${{ env.REGISTRY }}' -Tag '${{ env.TAG }}'
# shell: pwsh
# env:
# TAG: ${{ github.event_name == 'pull_request' && format('-t {0}/{1}:pr-{2}', env.REGISTRY, env.IMAGE_NAME, github.event.number) || '' }}

# - name: Login to container registry
# uses: docker/login-action@v3
# with:
# registry: ${{ vars.DOCKER_REGISTRY }}
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }}

# - name: Push image
# run: docker push --all-tags ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Post PR comment with image info
if: ${{ github.event_name == 'pull_request' }}
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `To run the Spring Cloud Config Server image built for this pull request:
\`\`\`bash
docker run --rm -d --pull=always -p 8888:8888 --name config-pr steeltoe.azurecr.io/config-server:pr-${{ github.event.number }}
\`\`\``
})
run: |
gh pr comment $PR_NUMBER --edit-last --create-if-none --body "To run the Spring Cloud Config Server image built for this pull request:
\`\`\`bash
docker run --rm -d --pull=always -p 8888:8888 --name config-pr $REGISTRY/$IMAGE_NAME:pr-$PR_NUMBER
\`\`\`"
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.number }}
54 changes: 26 additions & 28 deletions .github/workflows/build_eureka_server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,32 +33,30 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Build Image
run: ./build.ps1 -Name '${{ env.IMAGE_NAME }}' -Registry '${{ env.REGISTRY }}' -Tag '${{ env.TAG }}'
shell: pwsh
env:
TAG: ${{ github.event_name == 'pull_request' && format('-t {0}/{1}:pr-{2}', env.REGISTRY, env.IMAGE_NAME, github.event.number) || '' }}

- name: Login to container registry
uses: docker/login-action@v3
with:
registry: ${{ vars.DOCKER_REGISTRY }}
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Push image
run: docker push --all-tags ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- uses: actions/github-script@v7
# - name: Build Image
# run: ./build.ps1 -Name '${{ env.IMAGE_NAME }}' -Registry '${{ env.REGISTRY }}' -Tag '${{ env.TAG }}'
# shell: pwsh
# env:
# TAG: ${{ github.event_name == 'pull_request' && format('-t {0}/{1}:pr-{2}', env.REGISTRY, env.IMAGE_NAME, github.event.number) || '' }}

# - name: Login to container registry
# uses: docker/login-action@v3
# with:
# registry: ${{ vars.DOCKER_REGISTRY }}
# username: ${{ secrets.DOCKER_USERNAME }}
# password: ${{ secrets.DOCKER_PASSWORD }}

# - name: Push image
# run: docker push --all-tags ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Post PR comment with image info
if: ${{ github.event_name == 'pull_request' }}
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `To run the Eureka server image built for this pull request:
\`\`\`bash
docker run --rm -d --pull=always -p 8761:8761 --name eureka-pr steeltoe.azurecr.io/eureka-server:pr-${{ github.event.number }}
\`\`\``
})
run: |
gh pr comment $PR_NUMBER --edit-last --create-if-none --body "To run the Eureka Server image built for this pull request:
\`\`\`bash
docker run --rm -d --pull=always -p 8761:8761 --name eureka-pr steeltoe.azurecr.io/eureka-server:pr-$PR_NUMBER
\`\`\`"
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ github.event.number }}