We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 918ea49 commit 5dc4248Copy full SHA for 5dc4248
1 file changed
app/Jenkinsfile
@@ -2,7 +2,8 @@ pipeline {
2
agent any
3
4
environment {
5
- PROD_DIR = "/opt/docker/site/app"
+ PROD_DIR = "/opt/docker/site"
6
+ SITE_DIR = "/opt/docker/site/static-site"
7
IMAGE_TAG = "static-site:latest"
8
SERVICE_NAME = "static-site"
9
}
@@ -18,12 +19,18 @@ pipeline {
18
19
20
21
22
+ stage('Sync code into SITE_DIR') {
23
+ steps {
24
+ sh """
25
+ rsync -a --delete ./ ${SITE_DIR}/
26
+ """
27
+ }
28
29
+
30
stage('Build static-site:latest on host Docker') {
31
steps {
- // IMPORTANT:
- // The working directory here is the Jenkins workspace.
- // That workspace MUST contain your Dockerfile and all app code.
32
sh """
33
+ cd ${SITE_DIR}
34
docker build -t ${IMAGE_TAG} -f Dockerfile .
35
"""
36
0 commit comments