I've been uploading java app to AWS by extracting a war file from eclipse,
But now I've moved my code to github and,
I want to pull it from github onto my AWS server without generating a war file.
I've tried pulling it but it gives me an error. The requested resource is not available.
You can use Jenkins or other CI tool. Jenkins will fetch code from GitHub, compile it and push it to AWS. You only need to specify deploy script.
The CI enthusiast within me suggests to automate the entire thing, going as far as creating an AWS CodePipeline with 3 steps:
(I have three of these pipelines active and am very happy I created them.)
Listen to GitHub repository for changes.
Pull latest repo changes and push code to a Jenkins instance
To save money on the Jenkins instance running 24/7 you could even create AWS Lambda functions to automate the starting up and shutting down of the Jenkins server
Output Jenkins artifact (your war file) to AWS Elastic Beanstalk.
The AWS Documentation as with most services is pretty elaborate on this subject as is Jenkins'. You shouldn't have too much trouble setting this up and it'll save you a lot of time as the WAR file transfer between each step happens on the internal magically-high speed network of AWS.
It will cost some time to set up, especially if you're not that familiar with CI and this process but so very worth it to be familiar with these type of stacks.
Related
At my company, a shared upstream JAR is provided to us from a development team by way of storing in Artifactory. I am wanting to utilize Cloud Build to grab this JAR from artifactory, and containerize, upload image to Artifact Registry, and deploy it to GKE. I have proven out the last two steps: containerize, upload to Artifact Registry, and deploy to a GKE cluster however this only works when using the Cloud CLI locally in a directory where my JAR and Dockerfile already exist.
Everywhere in documentation I am only seeing references to connecting to GitHub/BitBucket repos where the source code as hosted, and then it creates the JAR.
Is it possible to utilize the functionality of Cloud Build to look for a new JAR in Artifactory, and build the container from there?
In principle, yes, this should be possible; "in principle" because I've not tried to do this.
However, Cloud Build is best considered to be a general-purpose, serial pipeline that allows you to apply functions (containers) to a set of inputs. Side-effects are ubiquitous, primarily through containers making calls to other services|APIs.
If I understand correctly, your mean JFrog Artifactory.
You will need credentials to access JFrog and some mechanism to pull from the repo. This should be straightforward to implement and deploy as a container (if someone hasn't provided this functionality already).
Update
Integrating Google Cloud Build with JFrog Artifactory. it's dated (2018) but appears to outline the workflow that you need.
There's also a jfrog builder in the gcloud-builders-community; a repo that includes a set of open-source (?) builders (containers) written by 3rd-party developers that work with Cloud Build.
So I'm really new to the Java webstack world, and had a question on the most efficient solution to my problem. Some background information first; I'm running Tomcat on a Lubuntu 14.04 server listening on Port 80, developing on a separate Windows computer in Spring Tool Suite (developing Spring applications obviously). Currently, whenever I want to test something, I...
1) Export the project as a WAR file from Spring Tool Suite
2) Undeploy the old WAR file from the server from the Tomcat manager webapp
3) Deploy the new WAR file that I just got from Spring Tool Suite (which takes ~15 seconds)
Is there any faster way to do this? Normally, I wouldn't be opposed to just developing on localhost. However, I'm going to be doing a group project, so we would all need access to the same SQL server, which would be the one hosted on the Lubuntu 14.04 server.
How can I solve this issue?
Most IDEs have the ability to deploy to server for both development and production purposes.
Those that don't have this ability inbuilt, ususally have a add-on that enables this.
You can also use build tools such as maven or gradle to undertake these actions.
Since you raised a good point of working with others it is important that all are across the deployment process and that the process is standardised to ensure no weird issues/bugs pop up.
A newbie to php development looking for help in deploying a php project in Apache server.
I am wonering how to put the php project that is in MVC structure into my Apache server. Say suppose it's a java project then i would export the whole project (with libs, source files etc) as a war file and then deploy the war in the server. My question is, in what format should the php project be put in so that it is up and active running on the server.
Help on this would be really useful to have my project up and running for users. Thanks !
Short answer: Nothing such as WARs in Java or other kinds of "packaging" is needed for PHP scripts. Your server has a special directory set as document root for the web server, you simply place your files inside it (or a subdirectory in it) and you're done.
There are however multiple ways how to bring your files into that directory.
I would use GIT. Make an account to GitHub and create a repository. Look up tutorials on how to commit your files into GIT.
Git Tutorial (GitHub)
Then go to your server and set up GIT folder there and connect to your repository.
Then you will be able to do GIT PULL and update your PHP code within seconds.
OR you can do the annoying style and manually upload files one by one via FTP server.
The first option would be to use a repository, such as GitHub or Assembla. I've used both, and I'd recommend Assembla - but it depends on preferences and requirements. A repository will allow you to commit files to it on a regular basis, and keep all of your work synced together in one location. You can then set up your server to sync with your repository.
If you don't wish to have a repository, then you can simply send all of the files that construct your PHP project to a .zip file. That .zip file can then be uploaded to Apache server, unzipped, and you'll be good to go (providing you have your server configured correctly to match the needs and requirements of the application). You should only need to .zip if you're using cPanel/Plesk, for example.
Alternatively, upload via FTP using a client such as Filezilla.
Silly question as I just started web dev. Consider that I've got the project build on Spring MVC Framework in the Netbeans (a web site). I would like to make it live.
What is the actual process of making it live considering the fact that I bought the domain and got the hosting? i.e. you upload project in the repository of hosting provider? (not sure if the question is correct, hence correct me if it's wrong)
Can I somehow connect the repository of hosting provider with my Netbeans to update my web site directly from it? (like it works f.e. with svn repository)
First of all, it's a java application that you want to host / publish, so you will need java hosting company.
You need domainname, you can buy one, or get free domainname (there's a few options, you can get free .tk domain, some hosts offer free domain with 1 year prepay as well).
Yes you can connect to your host's SVN with your Netbeans IDE. But deployment process depends on how you will set up your environment on host side. SVN is a place where you keep your source code, not a compiled java application. You can use your host's SVN server, but then still you need to compile java code and build war file which you can deploy under your java server. Some java hosting companies offer Apache Maven, which can helps in your case. Another solution is to build war locally, and upload ready app to your java host account (try to use SFTP or SCP, most of java hosting companies offer SSH access to your account, try to avoid FTP as it's pretty unsecure).
I am just beginning to learn Azure, so I expect this will seem an elementary question. Using Eclipse (and the Windows Azure Plugin with Java) I began by writing a basic JSP (html) file that simply displays some text in the browser.
Deployment of the first project went fine. It ran as intended in the storage and compute emulators, deployed fine into the new cloud service and storage account I added to Azure, works fine in staging and then production. I deployed the JDK and application server in the package.
I created a second project in Eclipse, same as the first, except that the project and application names are different. This package also includes the JDK and application server. Works fine in the emulator, but when I try to deploy to the existing Azure cloud service and storage account, it fails.
…
Uploading deployment package - 100% Completed
02/22/2013 12:29:45 - Creating deployment
02/22/2013 12:29:47 - Failed : HTTP error code : 409 Conflict
Is it not possible to deploy multiple projects to the same cloud service and storage account?
The first application is still running in the cloud.
thanks
ANSWER SUMMARY
Martin's answer resolved this issue for me. Although Eclipse did not display a message when I tried to publish to an existing cloud service, I was able to unpublish the existing cloud service and then publish to staging and then production as expected.
I do not think so, when you publish the second project to the same cloud service, Eclipse will ask you to unpublish your first one.
If you're publishing a newer version of the same service, then just click the Unpublish button on the toolbar (next to the Publish one) to remove your previous deployment first.
If you're intentionally publishing a whole different application that is supposed exist in addition to the one you already published, then you need to create a new service for it in the publish dialog, rather than selecting the same service again (which happens by default).
And if you're just adding another WAR to the same container installation (Tomcat and or what not), then do that in the Eclipse Azure project, and then republish - that is equivalent to publishing the same deployment in the same service (so you need to unpublish the previous one).