This is an automated email from the ASF dual-hosted git repository.

lukaszlenart pushed a commit to branch results
in repository https://gitbox.apache.org/repos/asf/struts-site.git


The following commit(s) were added to refs/heads/results by this push:
     new 764d6bc3c Uses Dockerfile with dedicate UID
764d6bc3c is described below

commit 764d6bc3c2aa2ccb80886e1093fc89663962f4b9
Author: Lukasz Lenart <lukaszlen...@apache.org>
AuthorDate: Wed Oct 19 14:10:15 2022 +0200

    Uses Dockerfile with dedicate UID
---
 Dockerfile  | 11 +++++++++++
 Jenkinsfile | 15 ++-------------
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 000000000..58c20bb0b
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,11 @@
+FROM jekyll/builder:4.2.2
+
+USER 910
+
+ENV GEM_HOME="$WORKSPACE/.gems"
+ENV PATH="$GEM_HOME/bin:$PATH"
+ENV BUNDLE_USER_HOME="$WORKSPACE/.bundle"
+
+RUN bundle config set --local path $GEM_HOME
+RUN bundle install
+RUN bundle exec jekyll build
diff --git a/Jenkinsfile b/Jenkinsfile
index e87de3b18..3a0abbe69 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -13,22 +13,11 @@ pipeline {
   stages {
     stage('Build a staged website') {
       agent {
-        docker {
-          image 'jekyll/builder:4.2.2'
-          args "-v ${env.WORKSPACE}:/dest:rw,z"
-        }
+        dockerfile true
+        args "-v ${env.WORKSPACE}:/dest:rw,z"
       }
       steps {
         sh '''
-          export GEM_HOME="$WORKSPACE/.gems"
-          export PATH="$GEM_HOME/bin:$PATH"
-          export BUNDLE_USER_HOME="$WORKSPACE/.bundle"
-
-          bundle config set --local path $GEM_HOME
-          bundle install
-          bundle exec jekyll build
-          ls -l /dest
-          ls -l
           mv ./_site /dest
         '''
       }

Reply via email to