I use git-ftp and bitbucket pipelines for my Wordpress project CI/CD. I make the wp-content git repo. I use Webpack to bundle the files and I also add dist folder to gitignore. Here is my setup:
wp-content/bitbucket-pipelines:
image: node:12.13.1
pipelines:
branches:
develop:
- step:
name: Deploy to staging
deployment: staging
script:
- cd themes/my-theme
- npm install
- npm run build
- apt-get update
- apt-get -qq install git-ftp
- git ftp push --syncroot themes/my-theme/ --user $FTP_username --passwd $FTP_password $HOST/wp-content/themes/my-theme/
The pipeline works just fine. However, it does not upload the dist folder to the host. I think that's because I add dist to my gitignore. How can I add the .git-ftp-include. Should I create the file and upload it to the host (under my-theme) or should I add it to my local and upload it to bitbucket
.git-ftp-include
themes/my-theme/dist/
.gitignore (under wp-content)
# ignore specific themes
themes/twenty*/
themes/my-theme/css/style.css
uploads
plugins
languages
cache
ai1wm-backups
dist
node_modules/
.idea/
.DS_Store
.log
Related
I have tried to make a theme, pre-packed from underscore.me, then I have gone the theme root folder. Then command: composer install then I have found 1 folder (vendor) and composer.lock file. Then I can check my project with composer lint:wpcs this command. Now, feel that this vendor & composer.lock file is unnecessary for me.
How can I uninstall them with command line without sudo rm -rf 'bla bla' this command.
Thank you
So I have a react with SSR project that I am trying to create a CI/CD pipeline. My project needs to deploy the following artifacts:
dist folder created by Webpack
appspec.yml file needed by Code Deploy
script folder for scripts that are references in appspec.yml
When I tried to get the files one by one using this buildspec.yml:
version: 0.2
phases:
install:
runtime-versions:
nodejs: 10
commands:
- npm install
build:
commands:
- npm run build
artifacts:
files:
- 'dist/*'
- 'appspec.yml'
- 'deploy-scripts'
I got dist with only part of it's content and the appspec.yml and the deploy scripts folder.
Then I tried a different approach:
version: 0.2
phases:
install:
runtime-versions:
nodejs: 10
commands:
- npm install
build:
commands:
- npm run build
artifacts:
files:
- '**/*'
base-directory: "dist"
discard-paths: yes
The dist folder has the scripts and the appspec file inside it. Now it does deploy, but I lose the folder structure of dist which is necessary for my deploy scripts.
I need to get all the contents of dist in their folder structure. As well as the scripts and the appspec.yml file. The scripts and the appspec.yml can't be inside dist, but dist needs to have all of it's content.
Can anyone help with this?
The solution was to use the first buildspec file and adding "**/*" to the dist directory.
So in the dist line it ends up being this: "dist/**/*".
So if we apply this to the general context, anytime you want to get a directory to be sent along with single files in the build phase, you can add it like this:
"[directory_name]/**/*"
And that will get you both the directory and everything inside it in a recursive way.
After setting up WordPress site on OpenShift, I tried to upload new plugin from my local repo, according this manual, but nothing was uploaded to OpenShift.
Step I've done:
# cloning WordPress app from OpenShift
rhc git-clone -a wpdev
# Going to plugins folder on local machine
cd ~/openshift/wpdev/.openshift/plugins
# cloning my plugin from GitHub to openshift plugins folder
git clone https://github.com/samuelsh/youtube-channel-player.git
# standart add/commit/push
git add plugins
git commit -m "youtube-channel-player deploy to openshift"
git push
After checking my wpdev app on openshift, looks like my plugin isn't uploaded.
What could go wrong here?
Thanks
Well, appeared it was git submodule issues.
Trying explicitly add new files to repo resulted following error:
git add .openshift/plugins/youtube-channel-player/*
fatal: Pathspec '.openshift/plugins/youtube-channel-player/admin' is in submodule '.openshift/plugins/youtube-channel-player'
Removing the directory from git and adding it again worked for me:
git rm --cached directory
git add directory
I have a:
- VPS with LAMP stack
- local symfony2 project (git)
- bitbucket repository
What do I need to do to properly setup my project in the production evironment?
Folder structure/permissions?
Can I simply clone the repository in the public folder? (I don't think so)
P.s. I've already read the deployment guide on the symfony2 website, but I didn't find it very useful
Here are my deployment steps:
git clone project
go to project directory
php composer.phar install (and if composer is not in the project
directory curl -sS https://getcomposer.org/installer | php)
app/console doctrine:database:create
app/console schema:update --force
app/console assets:install web --symlink
chmod 777 -R app/cache app/logs web/media/cache (I often use liip
imagine, it resizes photo in web/media/cache)
point the virtual host of apache to the web directory of my project.
And you are done.
you might want to enable mode rewrite in apach (a2enmod rewrite) I think this covers everything.
I am wordpress developer and want to use git in wordpress. I also want version control in my wordpress so that everything in the projects gets updated frequently.and also how to install wordpress as git submodule?
thanks,
suku
Just add wordpress as a submodule from the root directory of your project like this:
git submodule add git://github.com/WordPress/WordPress.git ./your/submodule/directory
Make sure that the directory doesn't exists before executing the above command.
I like to keep my root project directory nice and clean, and I use Wordpress Skeleton in a directory called "app," while Wordpress sits in a directory called "wp," therefore I execute the command below from the root project directory.
git submodule add git://github.com/WordPress/WordPress.git ./app/wp/
This makes it really easy to update wordpress and keep everything under version control. To update to 3.8.1 do the following:
cd wp
git fetch && git fetch --tags
git checkout 3.8.1
cd ./
git add wp
git commit -m “Updated to WP 3.8.1”
git push
I wrote an unfinished article about it over here: http://www.kj-prince.com/wordpress-development-deployment/
Hope this helps.