-
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.
- Loading branch information
1 parent
1ce608d
commit cef5174
Showing
24 changed files
with
429 additions
and
186 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
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 |
---|---|---|
|
@@ -4,6 +4,7 @@ on: | |
pull_request: | ||
branches: | ||
- main | ||
- develop | ||
|
||
jobs: | ||
build: | ||
|
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,76 @@ | ||
name: Upgrade Version and Deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
|
||
jobs: | ||
upgrade-version: | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
packages: write | ||
contents: write | ||
|
||
steps: | ||
- name: Docker Login | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PASSWORD }} | ||
|
||
- name: Check out the repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Java 21 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'oracle' | ||
java-version: '21.0.3' | ||
cache: 'maven' | ||
cache-dependency-path: 'server/pom.xml' | ||
|
||
- name: Retrieve next version | ||
id: next-version | ||
run: | | ||
echo "value=$(./get-next-version.sh)" >> $GITHUB_OUTPUT | ||
- name: Upgrade server version | ||
run: | | ||
./set-next-version.sh --pom server/pom.xml | ||
- name: Create Tag ${{ steps.next-version.outputs.value }} | ||
uses: rickstaa/action-create-tag@v1 | ||
id: "tag_create" | ||
with: | ||
tag: "v${{ steps.next-version.outputs.value }}" | ||
message: "️⬆️ Upgrade server version to ${{ steps.next-version.outputs.value }}" | ||
|
||
|
||
- name: Build Docker image ${{ steps.next-version.outputs.value }} | ||
env: | ||
NEXT_VERSION: ${{ steps.next-version.outputs.value }} | ||
run: | | ||
docker build -t heavy-mock-http-server:$NEXT_VERSION server | ||
- name: Push Docker image ${{ steps.next-version.outputs.value }} | ||
env: | ||
NEXT_VERSION: ${{ steps.next-version.outputs.value }} | ||
run: | | ||
docker tag "heavy-mock-http-server:$NEXT_VERSION" "heavynimbus/heavy-mock-http-server:$NEXT_VERSION" | ||
docker push "heavynimbus/heavy-mock-http-server:$NEXT_VERSION" | ||
- name: Set snapshot version | ||
run: | | ||
./set-next-version.sh --pom server/pom.xml --snapshot | ||
- name: Retrieve snapshot version | ||
id: snapshot-version | ||
run: | | ||
echo "value=$(echo $(./get-next-version.sh)-SNAPSHOT)" >> $GITHUB_OUTPUT | ||
- name: Commit and push snapshot version ${{ steps.snapshot-version.outputs.value }} | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
commit_message: "⬆️ Upgrade server version to ${{ steps.snapshot-version.outputs.value }}" |
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 @@ | ||
.env |
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,84 @@ | ||
# Declaration of endpoints | ||
endpoints: | ||
- name: No Delay Hello | ||
# If the request matches the following criteria, the response will be returned | ||
request: | ||
methods: | ||
- GET | ||
paths: | ||
- /hello/no-delay # This is a regular expression | ||
|
||
# The response to be returned | ||
response: | ||
status: OK | ||
headers: | ||
"Content-Type": | ||
- application/json | ||
body: | ||
content: | | ||
{ | ||
"message": "Hello, Heavy!" | ||
} | ||
- name: 200ms Delayed Hello | ||
# If the request matches the following criteria, the response will be returned | ||
request: | ||
methods: | ||
- GET | ||
paths: | ||
- /hello/200 # This is a regular expression | ||
|
||
# The response to be returned | ||
response: | ||
delay: 200 | ||
status: OK | ||
headers: | ||
"Content-Type": | ||
- application/json | ||
body: | ||
content: | | ||
{ | ||
"message": "Hello, Heavy!" | ||
} | ||
- name: 500ms Delayed Hello | ||
# If the request matches the following criteria, the response will be returned | ||
request: | ||
methods: | ||
- GET | ||
paths: | ||
- /hello/500 # This is a regular expression | ||
|
||
# The response to be returned | ||
response: | ||
delay: 500 | ||
status: OK | ||
headers: | ||
"Content-Type": | ||
- application/json | ||
body: | ||
content: | | ||
{ | ||
"message": "Hello, Heavy!" | ||
} | ||
- name: 1000ms Delayed Hello | ||
# If the request matches the following criteria, the response will be returned | ||
request: | ||
methods: | ||
- GET | ||
paths: | ||
- /hello/1000 # This is a regular expression | ||
|
||
# The response to be returned | ||
response: | ||
delay: 1000 | ||
status: OK | ||
headers: | ||
"Content-Type": | ||
- application/json | ||
body: | ||
content: | | ||
{ | ||
"message": "Hello, Heavy!" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Declaration of endpoints | ||
endpoints: | ||
# First endpoint | ||
- name: Get Hello | ||
# If the request matches the following criteria, the response will be returned | ||
request: | ||
methods: | ||
- GET | ||
paths: | ||
- /hello/heavy | ||
|
||
# The response to be returned | ||
response: | ||
status: OK | ||
headers: | ||
"Content-Type": | ||
- application/json | ||
body: | ||
content: | | ||
{ | ||
"message": "Hello, Heavy!" | ||
} | ||
- name: Get Hello | ||
# If the request matches the following criteria, the response will be returned | ||
request: | ||
methods: | ||
- GET | ||
paths: | ||
- /hello/.* # This is a regular expression | ||
|
||
# The response to be returned | ||
response: | ||
status: OK | ||
headers: | ||
"Content-Type": | ||
- application/json | ||
body: | ||
content: | | ||
{ | ||
"message": "Hello, World!" | ||
} | ||
- name: 404 Not Found | ||
# If the request matches the following criteria, the response will be returned | ||
request: | ||
methods: | ||
- GET | ||
paths: | ||
- /not-found | ||
|
||
# The response to be returned | ||
response: | ||
status: NOT_FOUND | ||
headers: | ||
"Content-Type": | ||
- application/json | ||
body: | ||
content: | | ||
{ | ||
"message": "Not Found" | ||
} |
File renamed without changes.
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,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
grep -rE 'version.next=[0-9]+\.[0-9]+\.[0-9]+' version.properties | cut -d '=' -f2 |
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.