forked from LiveCarta/LiveCartaWP
Merge pull request 'qa' (#3) from qa into demo
Reviewed-on: LiveCarta/LiveCartaWP#3
This commit is contained in:
25
.dockerignore
Normal file
25
.dockerignore
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
.gitattributes
|
||||||
|
.github/
|
||||||
|
.vscode/
|
||||||
|
.idea/
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
|
*.log
|
||||||
|
logs.conf
|
||||||
|
logs/
|
||||||
|
|
||||||
|
docker-compose.yml
|
||||||
|
compose.yml
|
||||||
|
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
wp-config-local.php
|
||||||
|
|
||||||
|
node_modules/
|
||||||
|
vendor/
|
||||||
|
|
||||||
|
**/.cache/
|
||||||
|
**/tmp/
|
||||||
|
**/temp/
|
||||||
15
Dockerfile
Normal file
15
Dockerfile
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
FROM composer:latest AS setup
|
||||||
|
WORKDIR /src
|
||||||
|
COPY . .
|
||||||
|
RUN composer install --no-dev --optimize-autoloader
|
||||||
|
|
||||||
|
FROM wordpress:6.1.1-php8.2 AS app
|
||||||
|
ARG ENV_NAME
|
||||||
|
|
||||||
|
USER www-data:www-data
|
||||||
|
WORKDIR /var/www/html
|
||||||
|
|
||||||
|
COPY --from=setup --chown=www-data:www-data /src/htdocs ./
|
||||||
|
COPY --from=setup --chown=www-data:www-data /src/environments/docker_container/ ./
|
||||||
|
COPY --from=setup --chown=www-data:www-data /src/environments/all/ ./
|
||||||
|
COPY --from=setup --chown=www-data:www-data /src/environments/${ENV_NAME}/robots.txt ./robots.txt
|
||||||
35
Jenkinsfile
vendored
Normal file
35
Jenkinsfile
vendored
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
@Library('utils') _
|
||||||
|
|
||||||
|
def mapBranchNameToWPEnv(branchName) {
|
||||||
|
def envMap = [
|
||||||
|
master: 'new_prod',
|
||||||
|
main: 'new_prod',
|
||||||
|
develop: 'dev',
|
||||||
|
qa: 'qa',
|
||||||
|
demo: 'demo'
|
||||||
|
]
|
||||||
|
return envMap.get(branchName, 'development')
|
||||||
|
}
|
||||||
|
|
||||||
|
pipeline {
|
||||||
|
agent any
|
||||||
|
|
||||||
|
options {
|
||||||
|
withFolderProperties()
|
||||||
|
}
|
||||||
|
|
||||||
|
environment {
|
||||||
|
// LC_IMG_TAG = "${utils.mapBranchToEnv(env.BRANCH_NAME)}"
|
||||||
|
LC_IMG_TAG = 'qa_test'
|
||||||
|
WP_ENV = "${mapBranchNameToWPEnv(env.BRANCH_NAME)}"
|
||||||
|
}
|
||||||
|
|
||||||
|
stages {
|
||||||
|
stage('Build') {
|
||||||
|
steps {
|
||||||
|
sh "docker build --build-arg ENV_NAME=${WP_ENV} -t ${env.PUSH_REGISTRY}/${env.LC_WP_IMG}:${LC_IMG_TAG} ."
|
||||||
|
sh "docker push ${env.PUSH_REGISTRY}/${env.LC_WP_IMG}:${LC_IMG_TAG}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project name="LawCarta wordpress project" default="build-without-tests">
|
|
||||||
|
|
||||||
<target name="build-without-tests"
|
|
||||||
depends="composer_install, replace, archive"
|
|
||||||
description="Build project and run all tests"/>
|
|
||||||
|
|
||||||
<target name="replace"
|
|
||||||
unless="replace.done"
|
|
||||||
description="Replace placeholders in config files" >
|
|
||||||
|
|
||||||
<replace dir="../environments" token="@lcAwsKey@" value="${lcAwsKey}"/>
|
|
||||||
<replace dir="../environments" token="@lcAwsSecretKey@" value="${lcAwsSecretKey}"/>
|
|
||||||
|
|
||||||
<replace dir="../environments" token="@lcWpMySqlHostDev@" value="${lcWpMySqlHostDev}"/>
|
|
||||||
<replace dir="../environments" token="@lcWpMySqlDbnameDev@" value="${lcWpMySqlDbnameDev}"/>
|
|
||||||
<replace dir="../environments" token="@lcWpMySqlUsernameDev@" value="${lcWpMySqlUsernameDev}"/>
|
|
||||||
<replace dir="../environments" token="@lcWpMySqlPasswordDev@" value="${lcWpMySqlPasswordDev}"/>
|
|
||||||
|
|
||||||
<replace dir="../environments" token="@lcWpMySqlHostQA@" value="${lcWpMySqlHostQA}"/>
|
|
||||||
<replace dir="../environments" token="@lcWpMySqlDbnameQA@" value="${lcWpMySqlDbnameQA}"/>
|
|
||||||
<replace dir="../environments" token="@lcWpMySqlUsernameQA@" value="${lcWpMySqlUsernameQA}"/>
|
|
||||||
<replace dir="../environments" token="@lcWpMySqlPasswordQA@" value="${lcWpMySqlPasswordQA}"/>
|
|
||||||
|
|
||||||
<replace dir="../environments" token="@lcWpMySqlHostDemo@" value="${lcWpMySqlHostDemo}"/>
|
|
||||||
<replace dir="../environments" token="@lcWpMySqlDbnameDemo@" value="${lcWpMySqlDbnameDemo}"/>
|
|
||||||
<replace dir="../environments" token="@lcWpMySqlUsernameDemo@" value="${lcWpMySqlUsernameDemo}"/>
|
|
||||||
<replace dir="../environments" token="@lcWpMySqlPasswordDemo@" value="${lcWpMySqlPasswordDemo}"/>
|
|
||||||
|
|
||||||
<replace dir="../environments" token="@lcWpMySqlHostStaging@" value="${lcWpMySqlHostStaging}"/>
|
|
||||||
<replace dir="../environments" token="@lcWpMySqlDbnameStaging@" value="${lcWpMySqlDbnameStaging}"/>
|
|
||||||
<replace dir="../environments" token="@lcWpMySqlUsernameStaging@" value="${lcWpMySqlUsernameStaging}"/>
|
|
||||||
<replace dir="../environments" token="@lcWpMySqlPasswordStaging@" value="${lcWpMySqlPasswordStaging}"/>
|
|
||||||
|
|
||||||
<replace dir="../environments" token="@lcWpMySqlHostProd@" value="${lcWpMySqlHostProd}"/>
|
|
||||||
<replace dir="../environments" token="@lcWpMySqlDbnameProd@" value="${lcWpMySqlDbnameProd}"/>
|
|
||||||
<replace dir="../environments" token="@lcWpMySqlUsernameProd@" value="${lcWpMySqlUsernameProd}"/>
|
|
||||||
<replace dir="../environments" token="@lcWpMySqlPasswordProd@" value="${lcWpMySqlPasswordProd}"/>
|
|
||||||
|
|
||||||
<property name="replace.done" value="true"/>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="composer_install">
|
|
||||||
<exec dir="${basedir}/.." executable="composer" failonerror="true">
|
|
||||||
<arg line="install" />
|
|
||||||
</exec>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="archive">
|
|
||||||
<tar compression="gzip" destfile="lc_wp.tar.gz" longfile="posix">
|
|
||||||
<tarfileset dir="${basedir}/..">
|
|
||||||
<include name="*/**" />
|
|
||||||
<exclude name="build/**" />
|
|
||||||
</tarfileset>
|
|
||||||
</tar>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
</project>
|
|
||||||
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
define( 'DB_NAME', '@lcWpMySqlDbnameDev@' );
|
|
||||||
define( 'DB_USER', '@lcWpMySqlUsernameDev@' );
|
|
||||||
define( 'DB_PASSWORD', '@lcWpMySqlPasswordDev@' );
|
|
||||||
define( 'DB_HOST', '@lcWpMySqlHostDev@' );
|
|
||||||
|
|
||||||
define('DOMAIN_CURRENT_SITE', 'dev.livecarta.com');
|
|
||||||
|
|
||||||
define('LAWCARTA_SUBDOMAIN', 'app-dev');
|
|
||||||
define('LAWCARTA_PORT', '');
|
|
||||||
|
|
||||||
define('LAWCARTA_WP_REST_API_REQUEST_URL', 'https://app-dev.livecarta.com/v1/event/request');
|
|
||||||
define('LAWCARTA_WP_REST_API_RESPONSE_URL', 'https://app-dev.livecarta.com/v1/event/response');
|
|
||||||
|
|
||||||
define('LAWCARTA_ENVIRONMENT_NAME', 'dev');
|
|
||||||
|
|
||||||
define('LC_ALLOW_COOKIE_POPUP', true);
|
|
||||||
define('LC_GTM', 'GTM-KXTRR4Q');
|
|
||||||
|
|
||||||
$_SERVER['HTTPS'] = 'On';
|
|
||||||
@@ -6,6 +6,8 @@ define( 'DB_PASSWORD', getenv('DB_PASSWORD') );
|
|||||||
define( 'DB_HOST', getenv('DB_HOST') );
|
define( 'DB_HOST', getenv('DB_HOST') );
|
||||||
|
|
||||||
define('DOMAIN_CURRENT_SITE', getenv('DOMAIN_CURRENT_SITE'));
|
define('DOMAIN_CURRENT_SITE', getenv('DOMAIN_CURRENT_SITE'));
|
||||||
|
define('WP_HOME', getenv('WP_HOME'));
|
||||||
|
define('WP_SITEURL', getenv('WP_SITEURL'));
|
||||||
|
|
||||||
define('LAWCARTA_SUBDOMAIN', getenv('SUBDOMAIN'));
|
define('LAWCARTA_SUBDOMAIN', getenv('SUBDOMAIN'));
|
||||||
define('LAWCARTA_PORT', '');
|
define('LAWCARTA_PORT', '');
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ define( 'DB_USER', '@lcWpMySqlUsernameQA@' );
|
|||||||
define( 'DB_PASSWORD', '@lcWpMySqlPasswordQA@' );
|
define( 'DB_PASSWORD', '@lcWpMySqlPasswordQA@' );
|
||||||
define( 'DB_HOST', '@lcWpMySqlHostQA@' );
|
define( 'DB_HOST', '@lcWpMySqlHostQA@' );
|
||||||
|
|
||||||
define('DOMAIN_CURRENT_SITE', 'qa.livecarta.com');
|
define('DOMAIN_CURRENT_SITE', 'qa116.livecarta.com');
|
||||||
|
|
||||||
define('LAWCARTA_SUBDOMAIN', 'app-qa');
|
define('LAWCARTA_SUBDOMAIN', 'app-qa116');
|
||||||
define('LAWCARTA_PORT', '');
|
define('LAWCARTA_PORT', '');
|
||||||
|
|
||||||
define('LAWCARTA_ENVIRONMENT_NAME', 'qa');
|
define('LAWCARTA_ENVIRONMENT_NAME', 'qa');
|
||||||
|
|||||||
Reference in New Issue
Block a user