OpenShift OctoPress Auto install Script is an Advanced Script to Run OctoPress on Free OpenShift PaaS Practically Without Any Knowing Ruby or Git. Practically, I have not thought it will become so much easy! Running OpenShift OctoPress Auto install Script on the localhost does everything. It is more easy than installing WordPress by a newbie. If you use it once, you’ll never type commands again. I could made it more automated, that will have problem with forward and backward compatibility with the rhc client. Plus for Free Tier of RedHat OpenShift, you might not have an empty cartridge. If you uncomment the lines, it will becomes 100% automated.
OpenShift OctoPress Auto install Script : Prerequisite
OS X or any GNU/Linux or any unixoid OS. You will need an RedHat OpenShift Account with an empty cartridge. Most important is having the rhc client installed. It will not work without rhc client.
You should not have an octopress named OpenShift gear, an octopress named directory on the place you’ll run the script.
---
OpenShift OctoPress Auto install Script : Steps
I have the GitHub Repo of OpenShift OctoPress Auto install Script here. You can wget the shiftocto.sh
script, chmod it to execute it.
Open two Terminal Windows (do not use iTerm2 on OS X, use Terminal). On one Terminal Window, run this command :
1 | rhc app create octopress ruby–1.9 |
It will give you output like this :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | âžœ ~ rhc app create octopress ruby–1.9 Password: ******** Application Options —————————– Domain: abhishekghosh Cartridges: ruby–1.9 Gear Size: default Scaling: no Creating application ‘octopress’ ... done Waiting for your DNS name to be available ... done Cloning into ‘octopress’... Warning: Permanently added the RSA host key for IP address ‘54.237.153.56’ to the list of known hosts. Your application ‘octopress’ is now available. URL: http://octopress–abhishekghosh.rhcloud.com/ SSH to: 54d7eb615973cae124000140@octopress–abhishekghosh.rhcloud.com Git remote: ssh://54d7eb615973cae124000140@octopress–abhishekghosh.rhcloud.com/~/git/octopress.git/ Cloned to: /Users/abhishekghosh/octopress |
Copy only the Git remote URL. In our case, it is :
1 | ssh://54d7eb615973cae124000140@octopress–abhishekghosh.rhcloud.com/~/git/octopress.git/ |
On the other Terminal Window run :
1 2 3 4 5 | cd ~ sudo su wget https://raw.githubusercontent.com/Abhishek–Ghosh/OpenShift–OctoPress–Auto–install–Script/master/shiftocto.sh chmod +x shiftocto.sh sh shiftocto.sh |
It will ask :
Humm. This Script Will Install OctoPress on OpenShift. Hit Y or N
Hit the y key on keyboard. There is an instruction, it will give you :
Read the instruction? Y will proceed, N will Quit
Everything actually said on the previous steps, still read it. Hit the y key on keyboard. It will ask :
Copy Paste the git URL from the Git remote URL from OpenShift Panel for octopress App which looks like:
1 | ssh://548e1873e0b8cddccf000094@octopress–username.rhcloud.com/~/git/octopress.git/ |
Paste the Git remote url from the other Terminal Windows (rhc client’s output). Hit the Return / Enter key after pasting it. Your work is to watch if any password prompt or yes/no prompt appears. It will prepare both the local computer and remote computer (OpenShift) ready with studded gems.
A Hello World post will be created. You’ll point your browser to the URL from the other Terminal Window, which will look like http://octopress-abhishekghosh.rhcloud.com/
, you’ll see that everything is ready. I do not know what is your name, so default name is Your Name
.
Screenshot showing automated work by OpenShift OctoPress Auto install Script.
OpenShift OctoPress Auto install Script : Configuration and New Post
The structure of octopress generated from our script need looks like this :
1 2 3 4 5 6 | octopress git:(master) ✗ ls CHANGELOG.markdown Rakefile config.ru source Gemfile _config.yml plugins Gemfile.lock _deployment public README.markdown config.rb sass |
It is complicated but entire pushing the entire octopress directory to Openshift is not needed, we need to push the output only.
Editing that _config.yml
will work fine and when you will post for the first time manually :
1 2 3 4 5 6 7 8 | rake new_post[‘Your World’] rake generate rm –rf _deployment/public/* cp –R public/* _deployment/public/ cd _deployment git add . git commit –am ‘Your blog post’ git push openshift master —force |
It will work fine. Obviously, you’ll not do rm -rf _deployment/public/*
every time. This OctoPress have a huge documentation, you will not have problem.
1 2 3 4 5 6 7 | rake new_post[‘Your Another World’] rake generate cp –R public/* _deployment/public/ cd _deployment git add . git commit –am ‘Your another blog post’ git push openshift master —force |
Also, the backup is remaining in your directory of localhost. You are pushing the _deployment
only. The default post which we can see is :
1 | ./octopress/_deployment/public/blog/2015/02/09/hello–world |
OpenShift OctoPress Auto install Script : Which Repo Has Benn Used
Default repo. The full script is this, the found the Gemfile somewhere in GitHub, you may need your own thing. If you look at the main steps, you’ll understand the philosophy, this the bare script, only notice, which is copied, moved etc. :
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | #!/bin/bash –e # echo “Copy Paste the git URL from the Git remote URL from OpenShift Panel for octopress App which looks like:” echo “ssh://548e1873e0b8cddccf000094@octopress-username.rhcloud.com/~/git/octopress.git/” read key RUBY_VERSION=1.9.3–p448 sudo rm –rf octopress git clone git://github.com/imathis/octopress.git octopress && cd octopress sudo gem install bundler rbenv rehash bundle install rake install cd .. mkdir _deployment && cd _deployment cp ../octopress/config.ru . cp ../octopress/Gemfile . bundle install mkdir public/ git init . git remote add openshift $key git add . git commit –am ‘initial deploy’ cd .. mv _deployment octopress cd octopress git add _deployment/ rake new_post[‘Hello World’] rake generate rm –rf _deployment/public/* cp –R public/* _deployment/public/ cd _deployment git add . git commit –am ‘New blog post’ git push openshift master —force |
Your local computer will work for generating the static files. You need not to push the whole thing to change your name and details. If the main files are changed, it will become a new Press, not OctoPress.
Tagged With openshift install script , rhcloud auto pinger