Skip to content

Commit 98c99cc

Browse files
dotnet and go work and remove extra frontend yaml (#24)
* k8s vs vault secret option * k8s vs vault secret option * k8s vs vault secret option * k8s vs vault secret option * k8s vs vault secret option for js and python * k8s vs vault secret option * change atpaqadmin to admin * change atpaqadmin to admin * change atpaqadmin to admin * increase init delay seconds for order liveness probe * dotnet work * dotnet work * dotnet work * dotnet work * dotnet work * dotnet work * dotnet work * dotnet work * dotnet work * dotnet work * go work * delete extraneous frontend yaml * dotnet and go work
1 parent e28045d commit 98c99cc

28 files changed

+827
-46
lines changed

grabdish/admin-helidon/src/main/java/oracle/db/microservices/PropagationSetup.java

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ String createDBLinks(DataSource orderpdbDataSource, DataSource inventorypdbDataS
131131
createDBLink(connection, "ORDERPDB_CRED", "inventorytoorder", inventoryToOrderLinkName);
132132
}
133133
verifyDBLinks(orderpdbDataSource, inventorypdbDataSource);
134-
return "DBLinks created and verified successfully";
134+
return "DBLinks created. Verification:" + verifyDBLinks(orderpdbDataSource, inventorypdbDataSource);
135135
}
136136

137137
private void createDBLink(Connection connection, String credName, String createlink, String linkname) throws SQLException {
@@ -168,35 +168,51 @@ private void createDBLink(Connection connection, String credName, String createl
168168
System.out.println(" CREATE_DATABASE_LINK " + linkname + " successful,");
169169
}
170170

171-
String verifyDBLinks(DataSource orderpdbDataSource, DataSource inventorypdbDataSource) throws SQLException {
171+
String verifyDBLinks(DataSource orderpdbDataSource, DataSource inventorypdbDataSource) {
172+
try (Connection inventoryconnection = inventorypdbDataSource.getConnection(inventoryuser, inventorypw)) {
173+
System.out.println("Create templinktest table on inventorydb...");
174+
inventoryconnection.createStatement().execute("create table templinktabledoninventorydb (id varchar(32))");
175+
System.out.println("Create templinktest table on inventorydb success");
176+
} catch (SQLException ex) {
177+
ex.printStackTrace();
178+
}
179+
try (Connection orderconnection = orderpdbDataSource.getConnection(orderuser, orderpw)) {
180+
System.out.println("Create templinktest table on orderdb...");
181+
orderconnection.createStatement().execute("create table templinktableonorderdb (id varchar(32))");
182+
System.out.println("Create templinktest table on orderdb success");
183+
} catch (SQLException ex) {
184+
ex.printStackTrace();
185+
}
186+
172187
String returnString = "";
173188
returnString += "orderuser select on inventorypdb using link...";
174189
try (Connection orderconnection = orderpdbDataSource.getConnection(orderuser, orderpw)) {
175-
System.out.println("verifyDBLinks orderconnection:" + orderconnection);
176-
orderconnection.createStatement().execute("create table templinktest (id varchar(32))");
177-
System.out.println("verifyDBLinks temp table created on order");
190+
System.out.println("verifyDBLinks orderconnection to inventorydb:" + orderToInventoryLinkName);
191+
// orderconnection.createStatement().execute("create table templinktest (id varchar(32))");
192+
// System.out.println("verifyDBLinks temp table created on order");
178193
// verify orderuser select on inventorypdb using link...
179-
orderconnection.createStatement().execute("select count(*) from inventoryuser.templinktest@" + orderToInventoryLinkName);
194+
orderconnection.createStatement().execute("select count(*) from inventoryuser.templinktabledoninventorydb@" + orderToInventoryLinkName);
180195
System.out.println("verifyDBLinks select on inventoryuser.templinktest");
181-
orderconnection.createStatement().execute("drop table templinktest");
196+
// orderconnection.createStatement().execute("drop table templinktest");
182197
returnString += "success";
183198
} catch (SQLException ex) {
184199
returnString += ex;
185200
}
186201
returnString += "inventoryuser select on orderpdb using link...";
187202
try (Connection inventoryconnection = inventorypdbDataSource.getConnection(inventoryuser, inventorypw)) {
188-
System.out.println("verifyDBLinks inventoryconnection:" + inventoryconnection);
189-
inventoryconnection.createStatement().execute("create table templinktest (id varchar(32))");
190-
System.out.println("verifyDBLinks temp table created on inventory");
203+
System.out.println("verifyDBLinks inventoryconnection to orderdb:" + inventoryToOrderLinkName);
204+
// inventoryconnection.createStatement().execute("create table templinktest (id varchar(32))");
205+
// System.out.println("verifyDBLinks temp table created on inventory");
191206
// verify inventoryuser select on orderpdb using link ...
192-
inventoryconnection.createStatement().execute("select count(*) from orderuser.templinktest@" + inventoryToOrderLinkName);
193-
System.out.println("verifyDBLinks select on orderuser.templinktest");
194-
inventoryconnection.createStatement().execute("drop table templinktest");
207+
inventoryconnection.createStatement().execute("select count(*) from orderuser.templinktableonorderdb@" + inventoryToOrderLinkName);
208+
System.out.println("verifyDBLinks select on orderuser.templinktableonorderdb");
209+
// inventoryconnection.createStatement().execute("drop table templinktest");
195210
returnString += "success";
196211
} catch (SQLException ex) {
197212
returnString += ex;
198213
}
199214
return returnString;
215+
//todo drop templinktabledoninventorydb and templinktableonorderdb to cleanup
200216
}
201217

202218
public String setupTablesQueuesAndPropagation(DataSource orderpdbDataSource, DataSource inventorypdbDataSource,
@@ -245,10 +261,10 @@ private String setupTablesQueuesAndPropagation(
245261
String linkName, boolean isTest) {
246262
String returnString = "sourcepdbDataSource = [" + sourcepdbDataSource + "], " +
247263
"targetpdbDataSource = [" + targetpdbDataSource + "], " +
248-
"sourcename = [" + sourcename + "], sourcepw = [" + sourcepw + "], " +
264+
"sourcename = [" + sourcename + "], " +
249265
"sourcequeuename = [" + sourcequeuename + "], " +
250266
"sourcequeuetable = [" + sourcequeuetable + "], targetuser = [" + targetuser + "], " +
251-
"targetpw = [" + targetpw + "], linkName = [" + linkName + "] isTest = " + isTest;
267+
"linkName = [" + linkName + "] isTest = " + isTest;
252268
System.out.println(returnString);
253269
try {
254270
TopicConnectionFactory tcfact = AQjmsFactory.getTopicConnectionFactory(sourcepdbDataSource);

grabdish/build.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ cd inventory-helidon-se
6464
./build.sh
6565
cd ../
6666

67+
echo ________________________________________
68+
echo building and pushing inventory-dotnet...
69+
echo ________________________________________
70+
cd inventory-dotnet
71+
./build.sh
72+
cd ../
73+
6774
echo ________________________________________
6875
echo ...finished
6976
echo ________________________________________

grabdish/frontend-helidon/frontend-helidon-deployment-2021-04-01_13:20:41.yaml

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Dockerfile
2+
[b|B]in
3+
[O|o]bj
4+
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
5+
using System.Text;
6+
using System.Data.OracleClient;
7+
using System.Data;
8+
9+
using System.Threading.Tasks;
10+
using Microsoft.AspNetCore.Mvc;
11+
using Microsoft.Extensions.Logging;
12+
using Newtonsoft.Json;
13+
using Oracle.ManagedDataAccess.Client;
14+
15+
namespace inventory_dotnet.Controllers
16+
{
17+
[ApiController]
18+
[Route("[controller]")]
19+
public class InventoryController : ControllerBase
20+
{
21+
22+
private readonly ILogger<InventoryController> _logger;
23+
24+
public InventoryController(ILogger<InventoryController> logger)
25+
{
26+
_logger = logger;
27+
}
28+
29+
[HttpGet]
30+
public String Get()
31+
{
32+
return "test";
33+
}
34+
35+
}
36+
}

grabdish/inventory-dotnet/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM mcr.microsoft.com/dotnet/sdk:5.0.102-ca-patch-buster-slim-amd64 AS build
2+
# FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build
3+
# FROM mcr.microsoft.com/dotnet/sdk:5.0-focal AS build-env
4+
WORKDIR /src
5+
COPY inventory-dotnet.csproj .
6+
RUN dotnet restore
7+
COPY . .
8+
RUN dotnet publish -c release -o /app
9+
10+
FROM mcr.microsoft.com/dotnet/aspnet:5.0
11+
WORKDIR /app
12+
COPY --from=build /app .
13+
ENTRYPOINT ["dotnet", "inventory-dotnet.dll"]
14+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using System;
2+
3+
namespace inventory_dotnet
4+
{
5+
public class Inventory
6+
{
7+
public string orderid { get; set; }
8+
public string itemid { get; set; }
9+
public string inventorylocation { get; set; }
10+
public string suggestiveSale { get; set; }
11+
}
12+
}

grabdish/inventory-dotnet/Order.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System;
2+
3+
namespace inventory_dotnet
4+
{
5+
// {"orderid":"13","itemid":"sushi","deliverylocation":"780 PANORAMA DR,San Francisco,CA","status":"pending","inventoryLocation":"","suggestiveSale":""}
6+
public class Order
7+
{
8+
public string orderid { get; set; }
9+
public string itemid { get; set; }
10+
public string deliverylocation { get; set; }
11+
public string status { get; set; }
12+
public string inventoryLocation { get; set; }
13+
public string suggestiveSale { get; set; }
14+
}
15+
}

grabdish/inventory-dotnet/Program.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Threading.Tasks;
5+
using Microsoft.AspNetCore.Hosting;
6+
using Microsoft.Extensions.Configuration;
7+
using Microsoft.Extensions.Hosting;
8+
using Microsoft.Extensions.Logging;
9+
10+
namespace inventory_dotnet
11+
{
12+
public class Program
13+
{
14+
public static void Main(string[] args)
15+
{
16+
CreateHostBuilder(args).Build().Run();
17+
}
18+
19+
public static IHostBuilder CreateHostBuilder(string[] args) =>
20+
Host.CreateDefaultBuilder(args)
21+
.ConfigureWebHostDefaults(webBuilder =>
22+
{
23+
webBuilder.UseStartup<Startup>();
24+
});
25+
}
26+
}
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"$schema": "http://json.schemastore.org/launchsettings.json",
3+
"iisSettings": {
4+
"windowsAuthentication": false,
5+
"anonymousAuthentication": true,
6+
"iisExpress": {
7+
"applicationUrl": "http://localhost:31298",
8+
"sslPort": 44303
9+
}
10+
},
11+
"profiles": {
12+
"IIS Express": {
13+
"commandName": "IISExpress",
14+
"launchBrowser": true,
15+
"launchUrl": "swagger",
16+
"environmentVariables": {
17+
"ASPNETCORE_ENVIRONMENT": "Development"
18+
}
19+
},
20+
"inventory_dotnet": {
21+
"commandName": "Project",
22+
"dotnetRunMessages": "true",
23+
"launchBrowser": true,
24+
"launchUrl": "swagger",
25+
"applicationUrl": "http://localhost:5000",
26+
"environmentVariables": {
27+
"ASPNETCORE_ENVIRONMENT": "Development"
28+
}
29+
}
30+
}
31+
}

0 commit comments

Comments
 (0)