Can CodeDeploy be used with a stand alone Git server? - aws-code-deploy

Does anyone know if it's possible to make CodeDeploy work with a generic Git server rather than GitHub or S3?

CodeDeploy does not support generic Git servers. The GitHub URL is hardcoded into the agent. (See https://github.com/aws/aws-codedeploy-agent/blob/master/lib/instance_agent/codedeploy_plugin/command_executor.rb#L216) Of course, the agent is open source, so it would be fairly easy to change this.

Related

How to push small local changes to remote server with Git and Wordpress?

I'm new into Git and I'm working with Wordpress themes.
I was always using FTP client to push every small change into my remote server... I mean sometimes it was just one line of code to check the change of CSS. It was easy and nice but there will be always problem with reverting changes and since I'm learning Git, I want to change it.
I've found two ways to do it:
git-ftp
i've tried to connect my local respository with GitHub and my intention was to automatic pull changes into my remote server from GitHub (it's not working yet, i need to configure it better)
BUT, do I have to commit every single small change? Because I cant just save file and check changes with Browsersync on second monitor, I will have to commit so many times. Also which way will be better for me - maybe there are another, better ways?
I really want to improve my performance, but it looks like that's not easy or I'm doing something wrong? I know about existence things like WP-CLI, webpack, gulp but often I'm creating small websites and probably I will spend more time on configurating those things than create theme. Also I thought about working on localhost, but I really think that I'm complicating things and my job.
Really sorry if it's wrong section, but I'm new on stackoverflow - hey! I will be really thankful if you can help me, because I think that i need knowledge of someone experienced.
I'm not sur to be helpful but I'll try :
First, even for a small project, I always prefer to install a local environment for testing. It avoid risks on your remote server !
You can take a look here : https://make.wordpress.org/core/handbook/tutorials/installing-a-local-server/
Then, if you have an SSH access to your server, may be you can try to configure it to push directly from your local environment to your remote server. Here is a simple tutorial : https://gist.github.com/noelboss/3fe13927025b89757f8fb12e9066f2fa
It depends on what remote system or vps you are using.
It could be from GCP, AWS, DIGITAL OCEAN, or WP itself.
It looks like that you are using the wordpress hosting your website.
If so, you might use wp cli to login the server.
①As for the frequent testing and updating, it is a good idea to copy the remote project to your localhost. Run your web app using wampserver. And create a new repository in the github and connect it with your local folder.
Then you could use git to version control your codes, do pull and push, stash or whatever.
And after testing, you could upload the specific files or folder to the remote server via ftp or sftp periodically.
②Another way is to install the git bash or git software in your server side.
It depends on the OS you are using. If it is a win or linux.
$ add-apt-repository ppa:git-core/ppa
$ apt update; apt install git
and create new user, add it into the sudo group
create a repository in your server side and link it to the github remote repository.
I am not sure whether the second way would work.
I recommend you try the first method.
Hope this could help. Happy coding.

Prevent appspec from running scripts (disable hooks)

I'm new to codedeploy. I managed to make a deployment to an ec2 instance successfully (and using git to manage code so everything works beautifully now).
I want some other people besides myself working in the project to be able to deploy source code to the instance but not be able to run a script (especially because codedeploy seems to be running as root). Think of it as an admin/webmaster scenario.
In other words, appspec.yml has the "hooks" section under it and you can run any scripts as part of the deployment. I want to prevent this, the instance has all the software ready for the deployment so won't be needing this.
2 questions:
1) Does this make sense or am I grossly misunderstanding something/am I overkilling by using codedeploy altogether?
2) If it makes sense, how can I achieve this?
This doesn't seem to be something that CodeDeploy is able to do at this moment. But do you want to disable the auto deploy from Github to CodeDeploy? And if anyone else push a code change, it'll exist on Github. When you are ok with the changes, you can do a manually deployment from Github on CodeDeploy console.

Quick and easy version control for WordPress Themes?

I work alongside two other developers and we seriously need a method of version control implementing within our workflow. Currently we're centralising data using a Synology NAS (which is backing itself up to Google Drive) but the bulk of our development work is done on our local machines just to speed things up.
We've been running into issues lately where we have lost track of file versions when moving between local, centralised and live copies due to our set up. We have suggested, between ourselves, using Git but none of us are experienced with it and after spending today doing some research I feel as though it is not going to actually help. It feels quite clunky and as though it slows the process down. Maybe I'm just doing something wrong?
Anyway, if anybody could suggest a better way/optimal git config they have used or had experience with I would be greatly appreciative.
Thanks in advance,
Ethan.
If you don't want to use git, then I suggest to use SVN. You can find a free SVN repository here: https://riouxsvn.com/
Hope it works!
Preparation to use git to version control your WordPress theme:
1. Remote repo. This is the place where the versions to be managed and controlled. You can create a remote repo by git init --bared. Or you can use github, bitbuckte etc to host your remote repo.
2. Local repo. make changes the develop on it. You can use below commands to work with your remote repo:
git clone /path/to/remote/repo
git add filename #after you add/modify a file
git commit -m 'message' #commit your changes in local repo
git push #push your local changes to remote repo
More details about git, you can refer git book .

How to edit source code in local computer and server simultaneously

I am a new web developer. I am using XAMPP and Dreamweaver CS6. I want to edit and debug my source code on my local computer. Then I want to commit that edit to my web server (shared or vps). Right now I edit files on local computer and then I upload that file to server.
Can anyone suggest any other options.
Thank you in advance.
I suppose you could achieve this in many ways.
For example you can use deployment tools (like Jenkins) and then configure it to hook your commits. In order to do this you need first to install Git in your system (I'm not sure but maybe you can even find some Git plugins for Dreamweaver so that you could work with Git directly from Dreamweaver; if not don't worry there are plenty of Git clients that help to facilitate use of Git, SourceTree is one of them)
If you feel like you have difficulty in configuring Jenkins to hook your commits I'd suggest you to have a look at this answer.
I haven't used Dreamweaver in forever but you can upload on saving which you set in the Site Definition. Go to the Remote definition that you setup and click on the Advanced tab. You can set DW to automatically upload on save there. It's generally not best practice but it's an option.

How to develop using GIT on database driven website project?

I like to use a simple Git workflow for static web sites but I build Joomla and Wordpress sites a semi-regular basis too. However I am at a loss as to how to use Git with with database driven site development.
For a static site I would 'Push' to dev.websitename.com, then push to www.websitename.com once the dev site checks out. How would I mimic that process with database driven site like wordpress or joomla.
Thanks in advance for you insight!
You can definitely use Git with your website code, such as changes to your WordPress theme/plugin, exactly as you would if you are developing a static website.
However, you wouldn't use it for your database. Git provides version control for code, while WordPress and Joomla already manage content stored in the database. Plus, Git wouldn't understand a database, so it wouldn't have any advantage over a periodic backup, which you should already be doing. Take a look at running a dev copy of your site for how to download your database directly from your server.
By the way, if you use Git with WordPress/Joomla, you should add e.g. cache, logs, tmp to .gitignore. There are also lots of tutorials out there--try searching e.g. http://google.com/search?q=wordpress+git.
In addition Chris, you may want to embark on your Git workflow without the handy script approach (at least initially). The script approach and using Git hooks can sure seem sexy (well, because they are) and handy too, but initially why not go with a more manual cmd line approach, which will also help you familiarize yourself with Git.
Once you've got your repo setup (GitHub, Bitbucket, somewhere else) and you've pushed your latest to it and are ready to deploy to production or staging, just login to your host and from wherever you've initialized the git repo (site root, example: /site) just do a:
git pull origin master
This will fetch and merge your code. Good idea to test this on a dev/staging environment and if the merge goes well then do it in production.

Resources