generated from nimblehq/git-template
-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (71 loc) · 2.62 KB
/
shared_deploy_exchange.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: Deploy to Anypoint Exchange
on:
workflow_call:
inputs:
maven_settings_path:
description: Maven settings file path
type: string
required: true
default: .maven/settings.xml
mule_runtime_version:
type: string
required: true
default: 4.4.0
timeout_minutes:
description: The maximum number of minutes to let a job run before GitHub automatically cancels it.
type: number
required: false
default: 15
java_version:
description: The Java version used to set up the Mulesoft environment.
type: number
required: false
secrets:
CONTD_APP_CLIENT_ID:
required: true
CONTD_APP_CLIENT_SECRET:
required: true
BUSINESS_GROUP_ID:
required: true
NEXUS_USERNAME:
required: false
NEXUS_PASSWORD:
required: false
jobs:
deploy:
name: Build and deploy
runs-on: ubuntu-latest
timeout-minutes: ${{ inputs.timeout_minutes }}
steps:
- name: Checkout
uses: actions/checkout@v4
# Remove when switching to the new Exchange - BUSINESS_GROUP_ID_GLOBAL_2 completely for all ENV (DEV, STAGING, PROD)
- name: Modify groupId in pom.xml
shell: bash
run: |
perl -0777 -pe 's/<groupId>[0-9a-fA-F\-]+<\/groupId>/<groupId>${{ secrets.BUSINESS_GROUP_ID }}<\/groupId>/' -i.bak pom.xml
cat pom.xml
- name: Set up Mulesoft environment
uses: nimblehq/mulesoft-actions/[email protected]
with:
java_version: ${{ inputs.java_version }}
- name: Build with Maven
uses: nimblehq/mulesoft-actions/[email protected]
id: build
with:
use_artifacts: false
connected_app_client_id: ${{ secrets.CONTD_APP_CLIENT_ID }}
connected_app_client_secret: ${{ secrets.CONTD_APP_CLIENT_SECRET }}
business_group_id: ${{ secrets.BUSINESS_GROUP_ID }}
nexus_username: ${{ secrets.NEXUS_USERNAME }}
nexus_password: ${{ secrets.NEXUS_PASSWORD }}
maven_settings_path: ${{ inputs.maven_settings_path }}
- name: Deploy to Anypoint Exchange
uses: nimblehq/mulesoft-actions/[email protected]
with:
connected_app_client_id: ${{ secrets.CONTD_APP_CLIENT_ID }}
connected_app_client_secret: ${{ secrets.CONTD_APP_CLIENT_SECRET }}
maven_settings_path: ${{ inputs.maven_settings_path }}
business_group_id: ${{ secrets.BUSINESS_GROUP_ID }}
mule_file_path: ${{ steps.build.outputs.mule_file_path }}
mule_runtime_version: ${{ inputs.mule_runtime_version }}