Patric 1 سال پیش
والد
کامیت
66cb1a0c67
2فایلهای تغییر یافته به همراه20 افزوده شده و 3 حذف شده
  1. 5 0
      Dockerfile
  2. 15 3
      Jenkinsfile

+ 5 - 0
Dockerfile

@@ -3,9 +3,14 @@ ARG DEBIAN_FRONTEND=noninteractive
 
 USER root
 
+WORKDIR /app
+COPY . /app
+
 RUN apt update
 RUN apt upgrade -y
 RUN apt install php php-mbstring php-xml php-pdo php-mysql php-xdebug -y
 RUN apt install curl -y
 RUN cd /tmp
 RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
+CMD php artisan serve --host=0.0.0.0 --port=8181
+EXPOSE 8181

+ 15 - 3
Jenkinsfile

@@ -1,9 +1,21 @@
 pipeline {
-    agent any
+    agent {
+         dockerContainer { 
+                    image 'ubuntu:22.04'
+                }
+    }
+
     stages {
-        stage('Hello') {
+        stage('Clone') {
+            steps {
+                 git branch: 'main',
+                        //credentialsId: '9174b603-02b6-46bd-970d-64569bab977a',
+                        url: 'https://github.com/buddy-works/laravel-first-steps.git'
+            }
+        }
+        stage('Build') {
             steps {
-                echo 'Hello World'
+                sh 'docker build . -t dockerfile'
             }
         }
     }