commit 849da8c1356759908c1f5c1b405985f57e8471f9 Author: root Date: Fri Apr 17 10:36:53 2020 -0400 First import diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c814681 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +ARG VERSION="latest" +FROM "jcabillot/phpapache:${VERSION}" +LABEL maintainer="Julien Cabillot " + +COPY "root" "/var/www/html" diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..25ae9e9 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,38 @@ +pipeline { + environment { + registry = 'https://registry.hub.docker.com' + registryCredential = 'dockerhub_jcabillot' + dockerImage = 'jcabillot/tracks' + } + + agent any + + triggers { + cron('@midnight') + } + + stages { + stage('Clone repository') { + steps{ + checkout scm + } + } + + stage('Build image') { + steps{ + sh 'docker build --force-rm=true --no-cache=true --pull -t ${dockerImage} .' + } + } + + stage('Deploy Image') { + steps{ + script { + withCredentials([usernamePassword(credentialsId: 'dockerhub_jcabillot', usernameVariable: 'DOCKER_USER', passwordVariable: 'DOCKER_PASS')]) { + sh 'docker login --username ${DOCKER_USER} --password ${DOCKER_PASS}' + sh 'docker push ${dockerImage}' + } + } + } + } + } +} diff --git a/root/index.php b/root/index.php new file mode 100644 index 0000000..85da7ad --- /dev/null +++ b/root/index.php @@ -0,0 +1,24 @@ +