File tree Expand file tree Collapse file tree 2 files changed +67
-18
lines changed Expand file tree Collapse file tree 2 files changed +67
-18
lines changed Original file line number Diff line number Diff line change @@ -107,24 +107,24 @@ class ContinuousDeploymentPipelineStack extends cdk.Stack {
107
107
const sourceStage = pipeline . addStage ( { stageName : "Source" } ) ;
108
108
sourceStage . addAction ( sourceAction ) ;
109
109
110
- // const runTests = env === "hahtuva";
111
- // if (runTests) {
112
- // const testStage = pipeline.addStage({ stageName: "Test" });
113
- // testStage.addAction(
114
- // new codepipeline_actions.CodeBuildAction({
115
- // actionName: "TestOrganisaatio",
116
- // input: sourceOutput,
117
- // project: makeTestProject(
118
- // this,
119
- // env,
120
- // tag,
121
- // "TestOrganisaatio",
122
- // ["scripts/ci/run-tests.sh"],
123
- // "corretto21"
124
- // ),
125
- // })
126
- // );
127
- // }
110
+ const runTests = env === "hahtuva" ;
111
+ if ( runTests ) {
112
+ const testStage = pipeline . addStage ( { stageName : "Test" } ) ;
113
+ testStage . addAction (
114
+ new codepipeline_actions . CodeBuildAction ( {
115
+ actionName : "TestOrganisaatio" ,
116
+ input : sourceOutput ,
117
+ project : makeTestProject (
118
+ this ,
119
+ env ,
120
+ tag ,
121
+ "TestOrganisaatio" ,
122
+ [ "scripts/ci/run-tests.sh" ] ,
123
+ "corretto21"
124
+ ) ,
125
+ } )
126
+ ) ;
127
+ }
128
128
129
129
const deployProject = new codebuild . PipelineProject (
130
130
this ,
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ set -o errexit -o nounset -o pipefail
3
+
4
+ repo=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && cd ../.. && pwd ) "
5
+ source " ${repo} /scripts/lib/common-functions.sh"
6
+
7
+ trap stop_database EXIT
8
+
9
+ function main {
10
+ init_nodejs
11
+ install_npm_dependencies
12
+ start_database
13
+ build_and_test_frontend
14
+ build_and_test_jar
15
+ }
16
+
17
+ function install_npm_dependencies {
18
+ for bom_dir in " ${repo} /playwright" \
19
+ " ${repo} /organisaatio-ui" \
20
+ " ${repo} /mock-api" ; do
21
+ cd ${bom_dir}
22
+ npm_ci_if_needed
23
+ done
24
+ }
25
+
26
+ function start_database {
27
+ cd $repo
28
+ docker compose up --detach
29
+ }
30
+
31
+ function stop_database {
32
+ cd $repo
33
+ docker compose down
34
+ }
35
+
36
+ function build_and_test_frontend {
37
+ cd $repo /organisaatio-ui
38
+ npm run lint
39
+ npm run prettier
40
+ CI=true npm run test
41
+ npm run build
42
+ }
43
+
44
+ function build_and_test_jar {
45
+ cd $repo
46
+ ./gradlew clean build
47
+ }
48
+
49
+ main " $@ "
You can’t perform that action at this time.
0 commit comments