diff --git a/.env.sample b/.env.sample index 1c39502a5..c2eaf82bf 100644 --- a/.env.sample +++ b/.env.sample @@ -3,10 +3,12 @@ APP_DEBUG=true APP_KEY=SomeRandomString APP_URL=http://localhost -DB_HOST=127.0.0.1 +DB_HOST=172.31.26.14 DB_DATABASE=homestead DB_USERNAME=homestead DB_PASSWORD=sePret^i +DB_CONNECTION=mysql +DB_PORT=3306 CACHE_DRIVER=file SESSION_DRIVER=file diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000..be086ee4a --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,35 @@ +pipeline { + agent any + + stages { + + stage("Initial cleanup") { + steps { + dir("${WORKSPACE}") { + deleteDir() + } + } + } + + stage('Checkout SCM') { + steps { + git branch: 'main', url: 'https://github.com/Anefu/php-todo.git' + } + } + + stage('Build image') { + steps { + sh "docker build -t anefu/php-todo:${env.BRANCH_NAME}-${env.BUILD_NUMBER} ." + } + } + stage('Docker Push') { + when { expression { response.status == 200 } } + steps { + withCredentials([usernamePassword(credentialsId: 'dockerHub', passwordVariable: 'dockerHubPassword', usernameVariable: 'dockerHubUser')]) { + sh "docker login -u ${env.dockerHubUser} -p ${env.dockerHubPassword}" + sh "docker push anefu/php-todo:${env.BRANCH_NAME}-${env.BUILD_NUMBER}" + } + } + } + } +} diff --git a/sonar.properties b/sonar.properties deleted file mode 100644 index 38159e49d..000000000 --- a/sonar.properties +++ /dev/null @@ -1,7 +0,0 @@ -sonar.host.url=http://18.192.57.119:9000 -sonar.projectKey=php-todo -#----- Default source code encoding -sonar.sourceEncoding=UTF-8 -sonar.php.exclusions=**/vendor/** -sonar.php.coverage.reportPaths=build/logs/phploc.csv -sonar.php.tests.reportPath=reports/unitreport.xml \ No newline at end of file