File tree Expand file tree Collapse file tree 3 files changed +68
-1
lines changed Expand file tree Collapse file tree 3 files changed +68
-1
lines changed Original file line number Diff line number Diff line change
1
+ pipeline {
2
+ environment {
3
+ DOCKER_REGISTRY_CREDENTIALS = ' docker-registry-credentials'
4
+ MONGO_USERNAME = ' ati'
5
+ MONGO_PASSWORD = ' ati1234'
6
+ }
7
+
8
+ stages {
9
+ stage(' Pull Docker Images' ) {
10
+ steps {
11
+ script {
12
+ docker. image(' postgres:latest' ). pull()
13
+ docker. image(' redis:latest' ). pull()
14
+ docker. image(' mongo:latest' ). pull()
15
+ docker. image(' mongo-express:latest' ). pull()
16
+ }
17
+ }
18
+ }
19
+ stage(' Run Containers' ) {
20
+ steps {
21
+ script {
22
+ docker. image(' postgres:latest' ). run(' -d --name postgres-container' )
23
+ docker. image(' redis:latest' ). run(' -d --name redis-container' )
24
+ docker. image(' mongo:latest' ). run(" -d --name mongodb-container -e MONGO_INITDB_ROOT_USERNAME=${ env.MONGO_USERNAME} -e MONGO_INITDB_ROOT_PASSWORD=${ env.MONGO_PASSWORD} " )
25
+ docker. image(' mongo-express:latest' ). run(" -d --name mongo-express-container -e ME_CONFIG_MONGODB_ADMINUSERNAME=${ env.MONGO_USERNAME} -e ME_CONFIG_MONGODB_ADMINPASSWORD=${ env.MONGO_PASSWORD} --link mongodb-container:mongo" )
26
+ }
27
+ }
28
+ }
29
+ }
30
+
31
+ post {
32
+ success {
33
+ echo ' Containers are running successfully'
34
+ }
35
+ }
36
+ }
37
+
Original file line number Diff line number Diff line change
1
+ pipeline {
2
+ agent {
3
+ docker {
4
+ image ' node:lts-buster-slim'
5
+ args ' -p 3000:3000'
6
+ }
7
+ }
8
+ environment {
9
+ CI = ' true'
10
+ }
11
+ stages {
12
+ stage(' Build' ) {
13
+ steps {
14
+ sh ' npm install'
15
+ }
16
+ }
17
+ stage(' Test' ) {
18
+ steps {
19
+ sh ' ./jenkins/scripts/test.sh'
20
+ }
21
+ }
22
+ stage(' Deliver' ) {
23
+ steps {
24
+ sh ' ./jenkins/scripts/deliver.sh'
25
+ input message : ' Finished using the web site? (Click "Proceed" to continue)'
26
+ sh ' ./jenkins/scripts/kill.sh'
27
+ }
28
+ }
29
+ }
30
+ }
Original file line number Diff line number Diff line change 8
8
"react-scripts" : " ^5.0.1"
9
9
},
10
10
"scripts" : {
11
- "start" : " react-scripts start" ,
11
+ "start" : " PORT=3004 react-scripts start" ,
12
12
"build" : " react-scripts build" ,
13
13
"test" : " react-scripts test --env=jsdom" ,
14
14
"eject" : " react-scripts eject"
You can’t perform that action at this time.
0 commit comments