-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: 무중단 배포 github action v1.36 #327
- Loading branch information
Showing
8 changed files
with
203 additions
and
204 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,60 @@ | ||
name: Blue Green Deployment | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
self_hosted_runner: | ||
description: 'self hosted runner label' | ||
required: true | ||
type: string | ||
artifact_name: | ||
description: 'uploaded artifact name' | ||
required: true | ||
type: string | ||
jar_name: | ||
description: 'uploaded jar name' | ||
required: true | ||
type: string | ||
profile: | ||
description: 'profile' | ||
required: true | ||
type: string | ||
app_path: | ||
description: 'app path' | ||
required: true | ||
type: string | ||
outputs: | ||
green_port: | ||
value: ${{ jobs.deploy-green.outputs.green_port }} | ||
blue_port: | ||
value: ${{ jobs.deploy-green.outputs.blue_port }} | ||
|
||
jobs: | ||
deploy-green: | ||
runs-on: ${{ inputs.self_hosted_runner }} | ||
outputs: | ||
green_port: ${{ steps.blue_green_port.outputs.green_port }} | ||
blue_port: ${{ steps.blue_green_port.outputs.blue_port }} | ||
steps: | ||
- name: Download artifact file | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ${{ inputs.artifact_name }} | ||
path: ${{ inputs.app_path }} | ||
|
||
- name: Change permission of shell script | ||
run: chmod +x ${{ inputs.app_path }}/*.sh | ||
|
||
- name: Get blue green port | ||
id: blue_green_port | ||
run: ${{ inputs.app_path }}/get_blue_green_port.sh | awk '{print $0}' >> $GITHUB_OUTPUT | ||
|
||
- name: Run green java application in ${{ inputs.self_hosted_runner }} | ||
run: sudo nohup java -Dspring.profiles.active=${{ inputs.profile }} -Dserver.port=${{ steps.blue_green_port.outputs.green_port }} -Duser.timezone=Asia/Seoul -jar ${{ inputs.app_path }}/${{ inputs.jar_name }} & | ||
|
||
health_check: | ||
needs: [ deploy-green ] | ||
runs-on: ${{ inputs.self_hosted_runner }} | ||
steps: | ||
- name: Health check green | ||
run: ${{ inputs.app_path }}/green_health_check.sh ${{ needs.deploy-green.outputs.green_port }} |
Oops, something went wrong.