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
private createPipelineRole(sharedAccountPrincipal: AccountPrincipal) { | |
const pipelineRole = new iam.Role(this, 'DHApiCodepipelineRole', { | |
roleName: `DHApiCodepipelineRole`, | |
assumedBy: new iam.CompositePrincipal( | |
new iam.ServicePrincipal('codepipeline.amazonaws.com'), | |
new iam.ServicePrincipal('codebuild.amazonaws.com'), | |
sharedAccountPrincipal | |
) | |
}); | |
pipelineRole.attachInlinePolicy(new iam.Policy(this, 'SharedAccountAssumeRolePolicy', { |
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
def sourceCodeBranch = params["SOURCE_BRANCH"] | |
def stage = params["DEPLOY_STAGE"] | |
def region = 'ap-southeast-2' | |
node { | |
stage('Checkout'){ | |
git credentialsId: 'Github-xx', | |
branch: sourceCodeBranch | |
url: 'https://github.com/projectx/repox.git' |
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
const update = require('immutability-helper'); | |
const items = [ | |
{key: 'IT-1', title: 'Dummy Item 1'}, | |
{key: 'IT-2', title: 'Dummy Item 2'}, | |
{key: 'IT-3', title: 'Dummy Item 3'}, | |
{key: 'IT-4', title: 'Dummy Item 4'}, | |
{key: 'IT-5', title: 'Dummy Item 5'}, | |
{key: 'IT-6', title: 'Dummy Item 6'} | |
]; |
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
const {List} = require('immutable'); | |
const items = [ | |
{key: 'IT-1', title: 'Dummy Item 1'}, | |
{key: 'IT-2', title: 'Dummy Item 2'}, | |
{key: 'IT-3', title: 'Dummy Item 3'}, | |
{key: 'IT-4', title: 'Dummy Item 4'}, | |
{key: 'IT-5', title: 'Dummy Item 5'}, | |
{key: 'IT-6', title: 'Dummy Item 6'} | |
]; |
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
CREATE TABLE admintools.vehicle_owners ( | |
id int4 NOT NULL DEFAULT nextval('admintools.vehicle_owners_id_seq'::regclass), | |
first_name varchar(40) NOT NULL, | |
last_name varchar(40) NOT NULL, | |
nic varchar(20) NOT NULL, | |
email varchar(100) NULL, | |
address jsonb NULL, | |
contact_numbers jsonb NOT NULL, | |
CONSTRAINT vehicle_owners_first_name_check CHECK((first_name)::text <> ''::text), | |
CONSTRAINT vehicle_owners_last_name_check CHECK((last_name)::text <> ''::text), |
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
public class VehicleOwnerService { | |
public static Observable<Integer> insert(VehicleOwner vehicleOwner) { | |
InsertStatement insert = new InsertStatement(vehicleOwner); | |
return databaseClient() | |
.getConnectionObservable() |
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
public class JdbcUtil { | |
private static JDBCClient jdbcClient; | |
public static void initialize(Vertx vertx) { | |
JsonObject config = vertx.getOrCreateContext().config(); | |
if(jdbcClient == null) { | |
final JsonObject jdbcConfig = new JsonObject() |
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
mainClassName = 'io.vertx.core.Launcher' | |
shadowJar { | |
classifier = 'fat' | |
manifest { | |
attributes( | |
'Main-Verticle': 'com.majan.admintools.api.AdminToolsVerticle' | |
) | |
} | |
mergeServiceFiles { |
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
public class VehicleOwnerRoute { | |
public static void initialize(Router router) { | |
router.route("/api/vehicleowners*").handler(BodyHandler.create()); | |
router.post("/api/vehicleowners").handler(VehicleOwnerRoute::create); | |
} | |
public static void create(RoutingContext routingContext) { |
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
public class AdminToolsVerticle extends AbstractVerticle { | |
@Override | |
public void start(Future<Void> fut) throws Exception { | |
Router router = Router.router(vertx); | |
JdbcUtil.initialize(vertx); | |
VehicleOwnerRoute.initialize(router); |
NewerOlder