Skip to content

Commit c6383fc

Browse files
Merge pull request #37 from TransactionProcessing/task/#36_linux_config
support linux deployments
2 parents 78bb3fa + 7ecb210 commit c6383fc

3 files changed

Lines changed: 92 additions & 32 deletions

File tree

.github/workflows/createrelease.yml

Lines changed: 69 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,34 @@ jobs:
7070
name: sharedconfig
7171
path: sharedconfig.zip
7272

73-
deploystaging:
74-
if: "!github.event.release.prerelease"
75-
runs-on: stagingserver
73+
parse-deploy-body:
74+
runs-on: ubuntu-latest
75+
outputs:
76+
deploy_linux: ${{ steps.set.outputs.deploy_linux }}
77+
deploy_windows: ${{ steps.set.outputs.deploy_windows }}
78+
steps:
79+
- name: Parse deployment targets from release body
80+
id: set
81+
run: |
82+
body="${{ github.event.release.body }}"
83+
targets=$(echo "$body" | grep -i '^deploy:' | cut -d':' -f2 | tr -d ' ' | tr '[:upper:]' '[:lower:]')
84+
85+
if [[ "$targets" == *"linux"* ]]; then
86+
echo "deploy_linux=true" >> $GITHUB_OUTPUT
87+
else
88+
echo "deploy_linux=false" >> $GITHUB_OUTPUT
89+
fi
90+
91+
if [[ "$targets" == *"windows"* ]]; then
92+
echo "deploy_windows=true" >> $GITHUB_OUTPUT
93+
else
94+
echo "deploy_windows=false" >> $GITHUB_OUTPUT
95+
fi
96+
97+
deploystaging_windows:
98+
needs: parse-deploy-body
99+
if: needs.parse-deploy-body.outputs.deploy_linux == 'true'
100+
runs-on: [stagingserver, windows]
76101
needs: buildconfigpackage
77102
environment: staging
78103
name: "Deploy to Staging"
@@ -87,10 +112,29 @@ jobs:
87112
run: |
88113
Expand-Archive -Path sharedconfig.zip -DestinationPath "C:\home\txnproc\config" -Force
89114
90-
deployproduction:
91-
if: "!github.event.release.prerelease"
92-
runs-on: productionserver
93-
needs: [buildconfigpackage, deploystaging]
115+
deploystaging_linux:
116+
needs: parse-deploy-body
117+
if: needs.parse-deploy-body.outputs.deploy_linux == 'true'
118+
runs-on: [stagingserver, linux]
119+
needs: buildconfigpackage
120+
environment: staging
121+
name: "Deploy to Staging"
122+
123+
steps:
124+
- name: Download the artifact
125+
uses: actions/download-artifact@v4.1.7
126+
with:
127+
name: sharedconfig
128+
129+
- name: deploy config
130+
run: |
131+
unzip sharedconfig.zip -d /home/txnproc/config
132+
133+
deployproduction_windows:
134+
needs: parse-deploy-body
135+
if: needs.parse-deploy-body.outputs.deploy_linux == 'true'
136+
runs-on: [productionserver, windows]
137+
needs: [buildconfigpackage, deploystaging_windows]
94138
environment: production
95139
name: "Deploy to Production"
96140

@@ -103,3 +147,21 @@ jobs:
103147
- name: deploy config
104148
run: |
105149
Expand-Archive -Path sharedconfig.zip -DestinationPath "C:\home\txnproc\config" -Force
150+
151+
deployproduction_linux:
152+
needs: parse-deploy-body
153+
if: needs.parse-deploy-body.outputs.deploy_linux == 'true'
154+
runs-on: [productionserver, linux]
155+
needs: [buildconfigpackage, deploystaging_linux]
156+
environment: production
157+
name: "Deploy to Production"
158+
159+
steps:
160+
- name: Download the artifact
161+
uses: actions/download-artifact@v4.1.7
162+
with:
163+
name: sharedconfig
164+
165+
- name: deploy config
166+
run: |
167+
unzip sharedconfig.zip -d /home/txnproc/config

config/appsettings.json

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@
88
},
99
"AllowedHosts": "*",
1010
"AppSettings": {
11-
"Authority": "https://192.168.1.167:5001",
11+
"Authority": "https://192.168.1.163:5001",
1212
"ClientId": "", // This will be overridden in each service/application
1313
"ClientSecret": "", // This will be overridden in each service/application
14-
"EstateManagementApi": "http://192.168.1.167:5000",
15-
"FileProcessorApi": "http://192.168.1.167:5009",
16-
"SecurityService": "https://192.168.1.167:5001",
17-
"MessagingServiceApi": "http://192.168.1.167:5006",
18-
"TransactionProcessorApi": "http://192.168.1.167:5002",
14+
"FileProcessorApi": "http://192.168.1.163:5009",
15+
"SecurityService": "https://192.168.1.163:5001",
16+
"MessagingServiceApi": "http://192.168.1.163:5006",
17+
"TransactionProcessorApi": "http://192.168.1.163:5002",
1918
"HandlerEventTypesToSilentlyHandle": {}, // This will be overridden in each service/application
2019
"UseConnectionStringConfig": false,
2120
"EventHandlerConfiguration": {}, // This will be overridden in each service/application
@@ -30,20 +29,20 @@
3029
"PDFGenerationBinariesPath": "home/txnproc/syncfusion/QtBinariesLinux"
3130
},
3231
"EventStoreSettings": {
33-
"ConnectionString": "esdb://admin:changeit@192.168.1.167:2113?tls=false&tlsVerifyCert=false",
32+
"ConnectionString": "esdb://admin:changeit@192.168.1.163:2113?tls=false&tlsVerifyCert=false",
3433
"UserName": "admin",
3534
"Password": "changeit"
3635
},
3736
"ConnectionStrings": {
38-
"ConnectionStringConfiguration": "server=192.168.1.167;user id=sa;password=Sc0tland;database=ConnectionStringConfiguration;Encrypt=false",
39-
"EstateReportingReadModel": "server=192.168.1.167;user id=sa;password=Sc0tland;database=EstateReportingReadModel;Encrypt=false",
40-
"HealthCheck": "server=192.168.1.167;database=master;user id=sa;password=Sc0tland;Encrypt=false"
37+
"ConnectionStringConfiguration": "server=192.168.1.163;user id=sa;password=Sc0tland;database=ConnectionStringConfiguration;Encrypt=false",
38+
"EstateReportingReadModel": "server=192.168.1.163;user id=sa;password=Sc0tland;database=EstateReportingReadModel;Encrypt=false",
39+
"HealthCheck": "server=192.168.1.163;database=master;user id=sa;password=Sc0tland;Encrypt=false"
4140
},
4241
"SecurityConfiguration": {
4342
"ApiName": "", // This will be overridden in each service/application
44-
"Authority": "https://192.168.1.167:5001"
43+
"Authority": "https://192.168.1.163:5001"
4544
},
4645
"ServiceAddresses": {
47-
"MessagingService": "http://192.168.1.167:5006"
46+
"MessagingService": "http://192.168.1.163:5006"
4847
}
4948
}

config/appsettings.staging.json

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,32 @@
88
},
99
"AllowedHosts": "*",
1010
"AppSettings": {
11-
"Authority": "https://192.168.1.167:5001",
11+
"Authority": "https://192.168.1.163:5001",
1212
"ClientId": "", // This will be overridden in each service/application
13-
"ClientSecret": "", // This will be overridden in each service/application
14-
"EstateManagementApi": "http://192.168.1.167:5000",
15-
"FileProcessorApi": "http://192.168.1.167:5009",
16-
"SecurityService": "https://192.168.1.167:5001",
17-
"MessagingServiceApi": "http://192.168.1.167:5006",
18-
"TransactionProcessorApi": "http://192.168.1.167:5002",
13+
"ClientSecret": "", // This will be overridden in each service/application
14+
"FileProcessorApi": "http://192.168.1.163:5009",
15+
"SecurityService": "https://192.168.1.163:5001",
16+
"MessagingServiceApi": "http://192.168.1.163:5006",
17+
"TransactionProcessorApi": "http://192.168.1.163:5002",
1918
"HandlerEventTypesToSilentlyHandle": {}, // This will be overridden in each service/application
2019
"UseConnectionStringConfig": false,
2120
"EventHandlerConfiguration": {} // This will be overridden in each service/application
2221
},
2322
"EventStoreSettings": {
24-
"ConnectionString": "esdb://admin:changeit@192.168.1.167:2113?tls=false&tlsVerifyCert=false",
23+
"ConnectionString": "esdb://admin:changeit@192.168.1.163:2113?tls=false&tlsVerifyCert=false",
2524
"UserName": "admin",
2625
"Password": "changeit"
2726
},
2827
"ConnectionStrings": {
29-
"ConnectionStringConfiguration": "server=192.168.1.167;user id=sa;password=Sc0tland;database=ConnectionStringConfiguration;Encrypt=false",
30-
"EstateReportingReadModel": "server=192.168.1.167;user id=sa;password=Sc0tland;database=EstateReportingReadModel;Encrypt=false",
31-
"HealthCheck": "server=192.168.1.167;database=master;user id=sa;password=Sc0tland;Encrypt=false"
28+
"ConnectionStringConfiguration": "server=192.168.1.163;user id=sa;password=Sc0tland;database=ConnectionStringConfiguration;Encrypt=false",
29+
"EstateReportingReadModel": "server=192.168.1.163;user id=sa;password=Sc0tland;database=EstateReportingReadModel;Encrypt=false",
30+
"HealthCheck": "server=192.168.1.163;database=master;user id=sa;password=Sc0tland;Encrypt=false"
3231
},
3332
"SecurityConfiguration": {
3433
"ApiName": "", // This will be overridden in each service/application
35-
"Authority": "https://192.168.1.167:5001"
34+
"Authority": "https://192.168.1.163:5001"
3635
},
3736
"ServiceAddresses": {
38-
"MessagingService": "http://192.168.1.167:5006"
37+
"MessagingService": "http://192.168.1.163:5006"
3938
}
4039
}

0 commit comments

Comments
 (0)