forked from LiveCarta/LiveCartaWP
Added Dockerfile and jenkins pipeline
This commit is contained in:
15
Dockerfile
Normal file
15
Dockerfile
Normal file
@@ -0,0 +1,15 @@
|
||||
# Base image
|
||||
FROM composer:2.6.4 AS base
|
||||
|
||||
COPY . /src
|
||||
WORKDIR /src
|
||||
RUN composer install --no-dev --optimize-autoloader
|
||||
|
||||
FROM wordpress:6.1.1-php8.2 AS livecarta_wp
|
||||
ARG ENV_NAME
|
||||
COPY --from=base /src/htdocs /var/www/html
|
||||
COPY --from=base /src/environments/docker_container/ /var/www/html/
|
||||
COPY --from=base /src/environments/all/ /var/www/html/
|
||||
COPY --from=base /src/environments/${ENV_NAME}/robots.txt /var/www/html/robots.txt
|
||||
|
||||
RUN chown -R www-data:www-data /var/www/html/
|
||||
50
Jenkinsfile
vendored
Normal file
50
Jenkinsfile
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
pipeline {
|
||||
agent any
|
||||
|
||||
parameters {
|
||||
choice(
|
||||
name: 'ENVIRONMENT',
|
||||
choices: ['dev', 'qa', 'new_prod', 'demo'],
|
||||
description: 'Environment Name for the application (e.g., dev, production etc.)'
|
||||
)
|
||||
}
|
||||
|
||||
stages {
|
||||
stage('Build Base QA Docker Image') {
|
||||
when {
|
||||
branch 'qa'
|
||||
}
|
||||
steps {
|
||||
sh "docker build --build-arg ENV_NAME=${params.ENVIRONMENT} -t 10.50.10.93:5000/livecarta_wp:qa ."
|
||||
sh 'docker push 10.50.10.93:5000/livecarta_base:qa_test'
|
||||
}
|
||||
}
|
||||
stage('Build Base DEV Docker Image') {
|
||||
when {
|
||||
branch 'develop'
|
||||
}
|
||||
steps {
|
||||
sh "docker build --build-arg ENV_NAME=${params.ENVIRONMENT} -t 10.50.10.93:5000/livecarta_base:dev ."
|
||||
sh 'docker push 10.50.10.93:5000/livecarta_base:dev'
|
||||
}
|
||||
}
|
||||
stage('Build Base PROD Docker Image') {
|
||||
when {
|
||||
branch 'master'
|
||||
}
|
||||
steps {
|
||||
sh "docker build --build-arg ENV_NAME=${params.ENVIRONMENT} -t 10.50.10.93:5000/livecarta_base:prod ."
|
||||
sh 'docker push 10.50.10.93:5000/livecarta_base:prod'
|
||||
}
|
||||
}
|
||||
stage('Build Base WL Docker Image') {
|
||||
when {
|
||||
branch 'wl'
|
||||
}
|
||||
steps {
|
||||
sh "docker build --build-arg ENV_NAME=${params.ENVIRONMENT} -t 10.50.10.93:5000/livecarta_base:wl ."
|
||||
sh 'docker push 10.50.10.93:5000/livecarta_base:wl'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user