I am creating aws codepipeline for windows WPF application for this I have already created custom docker image which has VS2017 build tools in it and this image will work as build environment to build all my .Net framework related applications. I have successfully created aws pipeline from UI i.e. aws console, but I am trying to create CDK stack for this same thing using typescript below is my code
import cdk = require('@aws-cdk/core');
import codecommit = require('@aws-cdk/aws-codecommit');
import codebuild = require('@aws-cdk/aws-codebuild');
import codepipeline = require('@aws-cdk/aws-codepipeline');
import codepipeline_actions = require('@aws-cdk/aws-codepipeline-actions');
import s3 = require('@aws-cdk/aws-s3');
import { Repository } from '@aws-cdk/aws-codecommit';
export class CdkClickOnceAppPipelineStack extends cdk.Stack {
constructor(scope: cdk.Construct, id: string, props?: cdk.StackProps) {
super(scope, id, props);
const code = codecommit.Repository.fromRepositoryName(this, 'WPFAppRepo','WPFClickOnceApp');
const cdkBuild = new codebuild.PipelineProject(this,'CdkBuild',{
description: 'AWS build project for .Net WPF click once application',
environment: {buildImage:codebuild.WindowsBuildImage.WIN_SERVER_CORE_2016_BASE}
});
}
}
In this code I can specify environment
as WIN_SERVER_CORE_2016_BASE
which is the base image provided by aws but I want to specify my custom docker image which I have ready in my aws ECR repository.
Can someone help me with this I could not find documentation for windows .Net framework stuff on internet.
you can do define an image like this:
const ecrRepo = awsEcr.Repository.fromRepositoryArn (this,[repo Id],'arn:aws:ecr:us-east-1:[account Id]:repository/RepoName');
const cdkBuild = new codebuild.PipelineProject(this,'CdkBuild',{
description: 'AWS build project for .Net WPF click once application',
environment: {buildImage:codebuild.WindowsBuildImage.fromEcrRepository(ecrRepo,'latest')}
});
its here: https://docs.aws.amazon.com/cdk/api/latest/docs/aws-codebuild-readme.html