How to deploy html5 boilerplate publish folder ( probably using git-ftp ) - web-deployment

I am still searching for a good development -> deployment workflow (mostly for smaller websites) using html5 boilerplate + build script, gitHub, and probably git-ftp.
The problem is I can’t figure out a cool way of how to deploy the publish folder of html5 boilerplate to my webserver (where I normally have no ssh access)
How do you do it?
What if the website uses a CMS like redaxo?

Just use git-ftp in the "publish" folder:
Make a git repository out of the "publish" folder
cd publish
git init
git add .
git commit -m "This is now a git repo"
Configure git-ftp in publish/.git/config, then use:
git ftp init

use the syncroot option of git-ftp to specify the directory to sync from as if it were the git project root path. In .git/config under [git-ftp] add
syncroot = publish/

Related

Serve RMarkdown outputs without version controlling them

We frequently use RMarkdown based packages to create websites with R (bookdown, blogdown, distill...) and use github-pages to serve the html files via the url username.github.io/repo.
In this approach, the ouput (i.e. html / css) files are also version controlled, and are frequently included in commits by mistake (git commit -a). This is annoying since these files clutter the commit and often lead to fictitious files conflicts.
Ideally, the outputfiles would not be version controlled at all, since the binary files (images) additionally bloat the repo. So I'm looking for a solution where:
Git ignores the output files completely but provides an alternative (but comparable1) method to gh-pages to serve them
Git ignores the output files temporally and committing / pushing them to gh-pages is done in a separate, explicit command
1: The method should be command line based and provide a nice URL to access the website
You could have .html, .css etc. ignored in the main and all other branches but the branch, for example, the gh-page branch, where your github-page is built from.
Git does not support different .ignore files in different branches so you would have to set up a bash script that replaces the ignore file each time you checkout a new branch. See here for how to do that: https://gist.github.com/wizioo/c89847c7894ede628071
Maybe not the elegant solution you were hoping for but it should work.
If you have a python installation on your computer, you can use GitHub Pages Import, a tool designed specifically for this purpose.
You need a python installation since it has to be installed with pip, but once it's installed it integrates beautifully with into an R / RMarkdown workflow.
Once it's installed (pip install ghp-import), you can run ghp-import docs (assuming docs is where your RMarkdown outputs are stored).
There are a bunch of practical options that you can use, including -p to additionally push the changes to your remote after the commit.
You need to tell Git to ignore the folder the book gets built into.
So, for example, by default bookdown puts all the built files in a folder called "_book"
Just add the following line to the .gitignore file in your project.
_book
Then you can work on your book and build it and push changes without worrying about the site being updated.
To update the site, you want to create a gh-pages branch that is only used for the hosted content. Do that with these commands from in your book folder:
git checkout --orphan gh-pages
git rm -rf .
# create a hidden file .nojekyll
touch .nojekyll
git add .nojekyll
git commit -m"Initial commit"
git push origin gh-pages
Make sure (once you put your book content in that branch) that GitHub is set to use that branch for hosting, rather than the folder you were using before.
Then, you can switch back to your main branch with the following command:
git checkout master
Next, you will clone your gh-pages branch into your main project:
git clone -b gh-pages https://github.com/yourprojecturl.git book-output
Then, when you have a version of the built book (in the _book folder) ready to use as your live site, use the following commands to copy the content into the book-output folder and push that to the gh-pages branch where the live site is:
cd book-output
git rm -rf *
cp -r ../_book/* ./
git add --all *
git commit -m"Update the book"
git push -q origin gh-pages
You can continue to use this last set of commands whenever you have a version in _book that you're ready to push live.

Unable to push Repo from "react-native-firebase-starter" template

I cloned this repo to start my own project
https://github.com/invertase/react-native-firebase-starter
I have made some modifications and got it setup for Firebase, however I cannot push or rename the Repository.
I ran npm run rename and renamed the directory. GitHub still seems to think I am trying to push the orginal repository as my own.
When I try to push I get:
Authentication failed. You may not have permission to access the repository or the repository may have been archived...
How can I keep this template/starter and push a copy of it as my own repository?
I have tried removing all of the inessential files from the Repo and pushing that way. I get the following error:
I expected to be able to use the starter as a starter to get a project up and running... Maybe I am missing something super obvious.
I don't see a .git folder within the root of the react-native-firebase-starter template, perhaps this is causing issues with pushing this template since git needs to know where to point to upstream.
Maybe you could try initializing the template to your personal git repository and seeing if this resolves your authentication issue:
Create a new repository on GitHub. To avoid errors, do not initialize the new repository with README, license, or gitignore files.
Initialize the local directory containing the template as a Git repository:
git init
Add the files in your new local repository. This stages them for the first commit:
git add .
Commit the files that you've staged in your local repository:
git commit -m "Initial commit"
At the top of your GitHub repository ,created in step 1, copy the remote repository URL.
Add the URL for the remote repository where your local repository will be pushed:
git remote add origin <remote_repository_url>
Push the changes in your local repository to your upstream repository contained in GitHub:
git push -u origin master
You should now be able to push this starter template into your own GitHub repository and use it as your own project.
As for the npm run rename command: this is a custom npm run script created by the author of this starter template and it simply runs the rename.js file contained within the .bin directory of the template's root directory. All this command does is recursively rename the files contained within this template project to the new name specified by your input, so I don't think this is causing the issue. I suspect once your project has been initialized properly with git the authentication issue will disappear as it will now point upstream to your personal repository.
Hopefully that helps!

Wordpress plugin path configuration

I am working on a local environment and I am pulling down a plugin that has its own git repository that is linked to the production server (also staging server). The only problem is that the plugin folder itself is in a folder like so:
repository-folder
real-plugin-folder
And my plugins directory looks like so:
plugins
plugin1
plugin2
plugin3
repository-folder
real-plugin-folder
plugin4
Is there a way to define a new path for this one particular plugin so that it will show up in my local environment and so I can edit it while keeping the plugin git repository structure in contact so I can push up to that repository? (some sort of path definition in wp-config.php?).
I think Git submodules might be the answer? But honestly I don't have time to tinker with it: https://git-scm.com/book/en/v2/Git-Tools-Submodules.
Why don't you just start your repo in "repository-folder" ? You don't need to follow the same parent folder in git.
I hope it helps you at least a clarification here
If you are on a Linux environment, setup a symlink for the plugin:
cd plugins
mkdir real-plugin-folder
ln -s respository-folder/real-plugin-folder/plugin.php real-plugin-folder/plugin.php

How can I clone / create a copy of my local meteor app?

How can I create a copy of my entire local meteor application? I was expecting a command like "meteor clone myapp" but couldn't find any documentation and simply copying the folder doesn't work.
You could use git to clone the whole thing.
If you aren't familiar with git see this reference. http://gitref.org/creating/
In windows, you can copy and paste the entire project directory and go into .meteor/local directory and delete everything in that directory except the db directory. Then start the meteor server on the new project directory, with everything deleted in the .meteor/local directory, meteor will rebuild the project without altering the logic of your application.

XCode 4.3.2 - How to change repositories

My project is currently stored on a remote SVN server. I need to move that project to a BitBucket git server. I've already added the repository to XCode but how do I move the project over?
Not entirely sure if this is the correct way to do it, but here's how I accomplished it:
You can either copy the project to a new location or update the existing project. I choose to make a copy. I also went ahead and moved the projects to the local path for the new repo.
In Xcode - Open the Project and go to File - Source Control - Hide Remote Status
The go to File - Source Control - Repositories and remove the SVN repo.
Close the project
Using Terminal, show all hidden files.
Using Finder, go to the project directory and remove all of the .svn files (include those bundled in the project file. (There has to be a better way to do this step)
I committed the cleaned project and files to the new repo.
Open the project in Xcode.
Xcode should have already picked up on the new repo and you should be ready to go.
RE: (There has to be a better way to do this step)
Open Terminal
Navigate to the root of your local working copy
At the terminal command prompt, enter: find . -type d -name '.svn' -print -exec rm -rf {} \;
Hit enter to delete all '.svn' folders in and below the working copy directory

Resources