-
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
0 parents
commit 05925bc
Showing
24 changed files
with
960 additions
and
0 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,42 @@ | ||
name: 'Deploy to Cloud Hub 1.0' | ||
|
||
inputs: | ||
username: | ||
required: true | ||
password: | ||
required: true | ||
targetEnvironment: | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Checkout this repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: | | ||
${{ runner.os }}-maven- | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: artifacts | ||
|
||
- name: Deploy the application | ||
run: | | ||
artifactName=$(ls *.jar | head -1) | ||
echo "Artifact Name: $artifactName" | ||
mvn deploy -DmuleDeploy -DskipMunitTests -PcloudHubDeployment\ | ||
-Dmule.artifact=$artifactName \ | ||
-Danypoint.username="$username" \ | ||
-Danypoint.password="$password" \ | ||
-Danypoint.environment="$targetEnvironment" | ||
shell: bash | ||
env: | ||
username: ${{ inputs.username }} | ||
password: ${{ inputs.password }} | ||
targetEnvironment: ${{ inputs.targetEnvironment }} |
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,51 @@ | ||
name: 'Deploy to Cloud Hub 2.0' | ||
|
||
inputs: | ||
username: | ||
required: true | ||
password: | ||
required: true | ||
targetEnvironment: | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Checkout this repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: | | ||
${{ runner.os }}-maven- | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: artifacts | ||
|
||
- name: Publish to Exchange | ||
run: | | ||
mvn deploy --settings .maven/settings.xml -DskipMunitTests \ | ||
-Danypoint.username="$username" \ | ||
-Danypoint.password="$password" \ | ||
shell: bash | ||
env: | ||
username: ${{ inputs.username }} | ||
password: ${{ inputs.password }} | ||
|
||
- name: Deploy the application | ||
run: | | ||
artifactName=$(ls *.jar | head -1) | ||
mvn deploy --settings .maven/settings.xml -DmuleDeploy -DskipMunitTests -Pcloudhub2Deployment\ | ||
-Dmule.artifact=$artifactName \ | ||
-Danypoint.username="$username" \ | ||
-Danypoint.password="$password" \ | ||
-Danypoint.environment="$targetEnvironment" | ||
shell: bash | ||
env: | ||
username: ${{ inputs.username }} | ||
password: ${{ inputs.password }} | ||
targetEnvironment: ${{ inputs.targetEnvironment }} |
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,24 @@ | ||
name: 'Set deployment type' | ||
|
||
inputs: | ||
targetEnvironment: | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Set deployment type | ||
run: | | ||
if [[ "$targetEnvironment" == "dev" || "$targetEnvironment" == "qa" ]]; then | ||
echo "deploymentType=cloudHubDeployment" >> $GITHUB_ENV | ||
elif [[ "$targetEnvironment" == "prod" ]]; then | ||
echo "deploymentType=cloudhub2Deployment" >> $GITHUB_ENV | ||
else | ||
echo "Skipping deployment" | ||
exit 0 | ||
fi | ||
shell: bash | ||
env: | ||
targetEnvironment: ${{ inputs.targetEnvironment }} |
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,139 @@ | ||
name: Build and Deploy to Anypoint Platform | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
environment: | ||
description: 'Environment to deploy to' | ||
type: choice | ||
required: true | ||
options: | ||
- dev | ||
- qa | ||
- prod | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- name: Checkout this repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Cache dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: | | ||
${{ runner.os }}-maven- | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'zulu' | ||
java-version: '11' | ||
|
||
- name: Create release | ||
if: ${{ github.event.inputs.environment == 'qa' }} | ||
run: | | ||
mvn versions:set -DremoveSnapshot versions:commit | ||
version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
git config --global user.name "github-actions[bot]" | ||
git add pom.xml | ||
git commit -m "Create release $version" | ||
git push https://x-access-token:$githubToken@github.com/${{ github.repository }}.git develop | ||
git tag $version | ||
git push https://x-access-token:$githubToken@github.com/${{ github.repository }}.git $version | ||
shell: bash | ||
env: | ||
githubToken: ${{ secrets.G_TOKEN }} | ||
|
||
- name: Build with Maven | ||
run: mvn -B package --file pom.xml -DskipMunitTests | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: artifacts | ||
path: target/*.jar | ||
|
||
deploy: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- name: Checkout this repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set deployment type | ||
uses: ./.github/actions/deployment-type-config | ||
with: | ||
targetEnvironment: ${{ github.event.inputs.environment }} | ||
|
||
- name: Deploy to CH1.0 | ||
if: env.deploymentType == 'cloudHubDeployment' | ||
uses: ./.github/actions/deploy-to-ch1-config | ||
with: | ||
username: ${{ secrets.ANYPOINT_PLATFORM_USERNAME }} | ||
password: ${{ secrets.ANYPOINT_PLATFORM_PASSWORD }} | ||
targetEnvironment: ${{ github.event.inputs.environment }} | ||
|
||
- name: Deploy to CH2.0 | ||
if: env.deploymentType == 'cloudhub2Deployment' | ||
uses: ./.github/actions/deploy-to-ch2-config | ||
with: | ||
username: ${{ secrets.ANYPOINT_PLATFORM_USERNAME }} | ||
password: ${{ secrets.ANYPOINT_PLATFORM_PASSWORD }} | ||
targetEnvironment: ${{ github.event.inputs.environment }} | ||
|
||
verify: | ||
needs: deploy | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- name: Checkout this repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Verify deployment | ||
run: | | ||
if [[ "$targetEnvironment" == "dev" ]]; then | ||
curl -f http://mule-github-actions-app-dev.us-e2.cloudhub.io/api/ping || exit 1 | ||
elif [[ "$targetEnvironment" == "qa" ]]; then | ||
curl -f http://mule-github-actions-app-qa.us-e2.cloudhub.io/api/ping || exit 1 | ||
elif [[ "$targetEnvironment" == "prod" ]]; then | ||
curl -f https://mule-github-actions-app-prod-qefjd6.5sc6y6-1.usa-e2.cloudhub.io/api/ping || exit 1 | ||
else | ||
echo "Skipping deployment verification" | ||
exit 0 | ||
fi | ||
shell: bash | ||
env: | ||
targetEnvironment: ${{ github.event.inputs.environment }} | ||
|
||
- name: Set next development cycle | ||
if: ${{ github.event.inputs.environment == 'prod' }} | ||
run: | | ||
mvn versions:set -DnextSnapshot versions:commit | ||
version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
git config --global user.name "github-actions[bot]" | ||
git checkout develop || git checkout -b develop | ||
git add pom.xml | ||
git commit -m "Increase version to $version for next development cycle" | ||
git push https://x-access-token:$githubToken@github.com/${{ github.repository }}.git develop | ||
shell: bash | ||
env: | ||
githubToken: ${{ secrets.G_TOKEN }} |
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,49 @@ | ||
.tooling-project | ||
|
||
# ------------------------------------------------------------------------------ # | ||
# Java defaults (https://github.com/github/gitignore/blob/master/Java.gitignore) # | ||
# ------------------------------------------------------------------------------ # | ||
*.class | ||
|
||
# Package Files # | ||
*.jar | ||
*.war | ||
*.ear | ||
|
||
# ------------------------------------------------------------------------------------------- # | ||
# Eclipse-specific (https://github.com/github/gitignore/blob/master/Global/Eclipse.gitignore) # | ||
# ------------------------------------------------------------------------------------------- # | ||
*.pydevproject | ||
.metadata | ||
bin/** | ||
tmp/** | ||
tmp/**/* | ||
*.tmp | ||
*.bak | ||
*.swp | ||
*~.nib | ||
local.properties | ||
.settings/ | ||
.loadpath | ||
.project | ||
.classpath | ||
|
||
# External tool builders | ||
.externalToolBuilders/ | ||
|
||
# Locally stored "Eclipse launch configurations" | ||
*.launch | ||
|
||
# CDT-specific | ||
.cproject | ||
|
||
# PDT-specific | ||
.buildpath | ||
|
||
# --------------- # | ||
# Studio-specific # | ||
# --------------- # | ||
target/ | ||
.mule/ | ||
.DS_Store | ||
velocity.log |
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,10 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<settings> | ||
<servers> | ||
<server> | ||
<id>Repository</id> | ||
<username>${anypoint.username}</username> | ||
<password>${anypoint.password}</password> | ||
</server> | ||
</servers> | ||
</settings> |
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,12 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "mule-xml-debugger", | ||
"request": "launch", | ||
"name": "Debug Mule Application", | ||
"mule.project": "${workspaceFolder}", | ||
"mule.runtime.args": "${config:mule.runtime.defaultArguments}" | ||
} | ||
] | ||
} |
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,21 @@ | ||
{ | ||
"files.exclude": { | ||
"**/.git": true, | ||
"**/.svn": true, | ||
"**/.hg": true, | ||
"**/CVS": true, | ||
"**/.DS_Store": true, | ||
"**/Thumbs.db": true, | ||
"**/.apivcs": true, | ||
"**/.gitignore": true, | ||
"**/.designer.json": true, | ||
"**/.exchange.xml": true, | ||
"**/.vscode": true, | ||
"**/.mvn": true, | ||
"**/.tmp": true, | ||
"**/.settings": true, | ||
"**/.exchange_modules_tmp": true, | ||
"target": true, | ||
".mule": true | ||
} | ||
} |
Oops, something went wrong.