I am deploy a cf image host 1.6.5 on Openshift using Git. Some of the directories do not have write permission when I running installer script.
The cf image host 1.6.1 installer script will generate a setting file in a directory called "inc".
I have done git push for the zip file of cf image host 1.6.5(says cf_image_1.6.5.zip) onto Openshift using git,and unziped this file to app-root/repo/php directory. The installer script can run okay. If I unzip file at local machine, git add and git commit and git push,the setting file can not be generated in the directory inc. If I manually change permission to 777, it is okay.
But I check the file using ls -la, both two methods' the owner is myself.
How do I deploy the process work when git push? Which user of the remote machine is deploying these scripts?
Try something along this (adjust permissions)
git update-index --chmod=+w -- $(git ls-files folder/with/wrong/permissions/*)
and add, commit and push.
Deploy should happen under your default openshift user. (See uder Webinterface->App: Userpart of the ssh-git url displayed there.
Related
I am new for using Github. I want upload my full site in new Repository in Github.com. But Github just can upload not more than 100file, and I'm download codeigniter-3 it's have 253file (original without my new file).
Can I upload my project in to Github?
This is likely a limitation of the drag and drop interface. I'd suggest to get familiar with the command line client instead. It's much more convenient than using the web interface and you'll need it anyway if you want to do serious work on that project from your dev machine.
First clone your project to a local directory:
$ git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY
Then from your project directory, add all the files:
$ git add .
$ git commit -m "initial commit"
$ git push origin master
Alternatively, consider using https://desktop.github.com/
Reference:
https://help.github.com/articles/cloning-a-repository/
https://help.github.com/articles/adding-a-file-to-a-repository-from-the-command-line/
GitHub upload file step by step follow.
Now first create account on github.
https://github.com/login
create repository in your GitHub account.
setup git directory on your project directory by GIT Clone.
after git clone setup .GIT directory on your project with config.
Example: ##Config git repository##
git clone https://github.com/username/repository
##upload project on GIT##
git add /your-folder
git commit -m 'your first commit'
git push -u origin master
after push successfully upload your project.
I lost my notepad with details how to deal with a GIT.
On my webserver I have the following things:
- htdocs/git/project/.git
and the project is under:
- htdocs/project/
The local copy is under:
- Applications/MAMP/htdocs/project
How can I create a GIT to push all local changes to the project on the server?
On your local machine (presuming Git is installed) simply navigate to the folder in Git Bash and initialise a repo:
git init
Then set the remote to be the same as on your webserver. First find where this is by logging onto your webserver at the path where the .git folder lives and type:
git remote -v
This produces a git#yougithost.com:namespace/scheme.git type link. Capture that and then back on your local machine go to the folder again and type:
git remote add origin git#yougithost.com:namespace/scheme.git
Now both folders can talk to the same project (again this presumes that you have the ability to authenticate yourself against the remote repo).
From here you simply complete your vchanges locally, commit them and push to origin:
git commit -am "Updated files"
git push -u origin master
Then on your remote box simply...:
git pull origin master
Whammo, you'll have a copy.
Hope that helps get you started..
I am trying to use Openshift for the first time to host a php site(PHP 5.4 cartridge) I am working on for a school project. I followed the directions here to push my existing repo to my gear, and can see that the code is on the gear by ssh-ing into the gear. What do I have to do now to host the website? I initially thought that I would just be able to see the index.php in my repo, but when I go to the provided url it is just a blank page. I think I may need to use the deploy action hook to cp the git repo somewhere, but not sure where. Any help would be appreciated.
With the PHP 5.4 cartridge the application root is the root of your application directory. Let me try and explain a bit further. If you create an application named "myphpapp" with the following command:
$> rhc app create myphpapp php-5.4
After the application is created, the git repository will be cloned to the directory you ran the create command. Change to that directory:
$> cd myphpapp
This is your application www root directory and is where you need to place files. For example, create a new test.php file like this:
$> echo "some php code" >> test.php
Add the file to your local git repository and then commit and push to your openshift server:
$> git add test.php
$> git commit -am "Adding a new file"
$> git push
When you run the git push command, the changes will be pushed to the remote git repository on the openshift server. Once the code is pushed, a hook on the server will see that a new file has been added to the repo and then deploy it to the www root on the openshift server. Once the deploy has finished, you can access the file by pointing to:
http://yourApp-yourDomain.rhcloud.com/test.php
Hope that helps.
--
gs
I did not read the documentation clearly enough. The root for the app is yourApp/php. So your repository has to have a php subdirectory inside of it, and that will be the app root. There is no need to copy your code from the repository to the root. As you have the correct structure, when you push your code the website will be live.
I installed apache2 server on my host. I want to copy the folder or files from on mounted drive to another mounted drive. I am using
system('sudo cp -rf /source/* /destination/')
in PHP to do this task. The problem is it doesn't executing from PHP but same command to the copying task from command line. There might be permission issue, but I am unable to figure out the reason. Have anybody done this, if yes please guide me.
I have a git project that I'm working on locally. It's a PHP project with a config file that stores MySQL database connection information. My local MySQL settings are different from the remote settings.
On my remote, I have a post-receive hook that will checkout the files to a folder on the server:
#!/bin/sh
GIT_WORK_TREE="../demo" git checkout -f
chmod +x hooks/post-receive
How can I tell this checkout not to include (overwrite the config file), since it will replace the remote config file with my local one? I've tried adding my local config file to the .gitignore, but that didn't seem to do it.
Any idea how to exclude the config file from the checkout?
The proper solution is not committing your config.php (or whatever its name is) at all but rather putting it in the .gitignore and committing config.php.example instead.
So, simply remove the config file from the repository, rename it on your remote machine, pull so you have the newest commit (which would remove the file) and then move it back.
You can try this
Running command:
git rm -r --cached .
This removes everything from the index, then just run:
git add .
Commit it:
git commit -m ".gitignore is now working"