File tree Expand file tree Collapse file tree 3 files changed +61
-0
lines changed
src/PostSharp.Engineering.BuildTools/Docker Expand file tree Collapse file tree 3 files changed +61
-0
lines changed Original file line number Diff line number Diff line change @@ -15,5 +15,7 @@ public enum ContainerComponentKind
1515 VsBuildTools ,
1616 Chocolatey ,
1717 NodeJs ,
18+ Python ,
19+ Gulp ,
1820 Epilogue
1921}
Original file line number Diff line number Diff line change 1+ // Copyright (c) SharpCrafters s.r.o. See the LICENSE.md file in the root directory of this repository root for details.
2+
3+ using System ;
4+ using System . Collections . Generic ;
5+ using System . IO ;
6+ using System . Linq ;
7+
8+ namespace PostSharp . Engineering . BuildTools . Docker ;
9+
10+ public class GulpComponent : ContainerComponent
11+ {
12+ public override string Name => "Install Gulp" ;
13+
14+ public override ContainerComponentKind Kind => ContainerComponentKind . Gulp ;
15+
16+ public override void WriteDockerfile ( TextWriter writer )
17+ {
18+ writer . WriteLine (
19+ """
20+ RUN npm install --global gulp-cli gulp
21+ """ ) ;
22+ }
23+
24+ public override void AddRequirements ( IReadOnlyList < ContainerComponent > components , Action < ContainerComponent > add )
25+ {
26+ base . AddRequirements ( components , add ) ;
27+
28+ if ( ! components . OfType < NodeJsComponent > ( ) . Any ( ) )
29+ {
30+ throw new InvalidOperationException ( $ "{ nameof ( NodeJsComponent ) } is required." ) ;
31+ }
32+ }
33+ }
Original file line number Diff line number Diff line change 1+ // Copyright (c) SharpCrafters s.r.o. See the LICENSE.md file in the root directory of this repository root for details.
2+
3+ using JetBrains . Annotations ;
4+ using System . IO ;
5+
6+ namespace PostSharp . Engineering . BuildTools . Docker ;
7+
8+ [ PublicAPI ]
9+ public class PythonComponent : ContainerComponent
10+ {
11+ private readonly string _version ;
12+
13+ public PythonComponent ( string version )
14+ {
15+ this . _version = version ;
16+ }
17+
18+ public override string Name => $ "Install Python { this . _version } ";
19+
20+ public override ContainerComponentKind Kind => ContainerComponentKind . Python ;
21+
22+ public override void WriteDockerfile ( TextWriter writer )
23+ {
24+ writer . WriteLine ( "RUN choco install -y python311" ) ;
25+ }
26+ }
You can’t perform that action at this time.
0 commit comments