Cloud foundry push from URL - ibm-cloud

There is option to push the application from git URL or any URL
using the CF Client (I mean via code) ?
Here there is documentation how to push from path
http://cli.cloudfoundry.org/en-US/cf/push.html

Neither the cf CLI, nor the Java client, nor the Cloud Controller API currently accept a git URL (or any other URL) to download the application bits into Cloud Foundry.
The --path option on cf push only accepts paths on your local filesystem.
If we were to support this (the topic has come up once or twice), it may make most sense for the Cloud Controller to expose an API for it, so that it can be supported by all CF clients in the same way. With this approach, CF can also be smarter about updates: it can check the git sha to know whether new bits need to be downloaded.
An issue with the current APIs for the CLI is that the CLI would first need to download the app bits from the URL and then upload it to CF, which seems inefficient. It would not be any faster than git clone https://github.com/example/app && cf push myapp -p app (apart from saving you a handful of keystrokes).

As far as I am aware cf client does not support direct deployment via code relying on CI/CD systems for this.
Some helpful links for research and discuss it:
Project manager/lead for CF CLI project - Dies Köper
( https://www.cloudfoundry.org/projects/ -> CLI )
#cli on cloudfoundry.slack.com
Tracker on https://www.pivotaltracker.com/n/projects/892938

Related

Automate mirroring GitHub to GCP Source Repository?

We run Google Cloud Functions (python), which require to be deployed from Google Cloud Source Repository. Since all the code is stored on GitHub we resort to first mirroring GitHub into Source Repository. Although this only requires a few mouse clicks, it becomes a burden to repeat over 3+ projects (dev, staging, production) times 5+ repos (5+ apps).
I am looking to automate the mirroring config, preferably to add into the Terraform automation we already use, into a hands-off project configuration. Does the Google API support this mirroring automation? So far on my Google Cloud expedition everything was available in their API!
I fail to find Terraform examples though, and would appreciate a tip.
Come to think of it, if I can take Source Repository out of the equation, that would be just fine with me too. After all, I only use it as a pass-through / empty shell.
The Cloud Source Repository API includes a Repo resource that has a Mirror Config object where you could type in your Github's URL, webhook and credentials to automate this procedure. I would initially test it with the create method, but if you have an existing Cloud Source Repository I believe the patch method will also be worth exploring.
Additionally, there is an open Feature Request in order to connect a repository via the Cloud Build GitHub App that I recommend you to star and follow, as it could further ease your automation needs.

Not able to download Bluemix app source using bx cf download command

I am trying to download my app source developed on IBM Bluemix using bx cf download command, but I am simply getting a message saying Files downloaded: 0/
Here's the command I am giving
Here's my app listed
The command creates a folder named Bluemix in C:\Bluemix directory, but it's empty.
Info -
It is a Node JS based app using Watson Conversation API.
Can any one help me resolve the issue?
The cf download hasn't been viable since the architecture moved to Diego. If it's just a couple of files, you can take advantage of bx cf ssh and use cat like:
bx cf ssh "myApp" -c "/bin/cat /home/vcap/app/mongostorage.js" > mongostorage.js
But to get them all, the easiest way to achieve this is to go to your Bluemix dashboard and in your app, bottom right, add continuous delivery. That will give you a Git repo you can git clone from and look at online. This is best if you intend on doing any edits.
It is also possible to get them all using ssh. See How to copy files from Liberty on Bluemix to Windows?

Upload/Update XSP application to Bluemix through Cloud Foundry API

I'm using Cloud Foundry API to modify apps on IBM Bluemix.
I got oauth key and succeeded in calling simple REST requests, like v2/apps.
However, as I want to update XSP application I need to send a nsf file to bluemix.
I tried to use /v2/apps/:guid request, but according to documentation I can only send application parameters, but I cannot send whole application file.
Is there an endpoint to do that?
There is also an API to Upload the bits for an App, but if my understanding is correct what you are asking is basically to emulate a cf push via REST API. Please note that cf push is complex and is not something that is recommended recreating via API on Cloud Foundry. I don't know what your requirements are, but I'd suggest you to use cf push to do that. Anyway if you want more information on what are the steps it performs (from an high level perspective) you can take a look here. I suggest you also to see this Github Cloud Foundry issue where the user is trying to programmatically recreate the cf push.

Source control for server side scripts in Azure Mobile Service

I am using Azure Mobile Services as the backend for my mobile app. Despite my best efforts, my server side scripts are getting complex now. Is there a way I can keep the insert, update, read, delete scripts for the tables in my service, in source control and maybe have a way to deploy them from within Visual Studio?
Have you checked out the node Azure Command Line Tools? This will likely hold the solution to your problems. These tools allow you to neatly manage your mobile service from your dev machine. The newly added cli tools for Mobile Services also support downloading your scripts. Just run the following command in your Azure Powershell:
azure mobile script download <service_name> <script_name>
The script name syntax is as follows:
For tables: table/.{insert|read|update|delete}
Apple Push Notification: shared/apnsFeedback
Scheduler: scheduler/
Once you have your scripts downloaded and placed on your local filesystem, you could put them in source control with your client that consumes your mobile service, or just throw them in their own git repository. You can't, however, sync your source control repository with your mobile service. In order to upload any changes you've made to your scripts, you'd need to execute the following command in the Azure-CLI again:
azure mobile script upload <service_name> <script_name>
I'm not sure if you can upload multiple scripts at once though. You could probably use some of the Azure-CLI Automation scripts I saw Glenn Block post on github. This could allow you to somehow automate uploading the scripts as a part of your build workflow.
Edit:
I found a few more resources that might help you with this:
Getting started with the CLI and backing up your scripts
More CLI – changing your Mobile Services workflow
These are some great resources from Josh Twist. I'm sure they will push you in the right direction.
Since this question has been answered, a new feature has been added to Azure Mobile Services - integration with Git source control. Basically you can enable this feature in the dashboard of your mobile service, and it converts the storage in a Git repository which you can clone / pull and push updates to.
You can find more information in the tutorial at http://www.windowsazure.com/en-us/develop/mobile/tutorials/store-scripts-in-source-control/.

Is there a way to publish a website from github or cloud9IDE directly to a web-host?

Is there a way deploy a website directly from github or cloud9 ide? using ftp or other way, right now it doesn't matter what hosting, just so it'll be fully functional and accessible online.
(I know github has a web-hosting of a kind but it seems very limited)
What webframework/language are you using? If you use RoR or Sinatra or any other rake-based framework you can use heroku.com. If your using asp.net you can use appharbor.com, finally if your using php you can use phpfog.com.
What these hostingproviders have in common is that you deploy the website by pushing your code with git, while you won't be deploying directly from github you can just add one of the above mentioned hosts to your remote-list (in addition to github) and then push to that remote when you wish to deploy.
Another solution would be to add a post-receive-hook to github which then triggers whenever you push to github, in that post-recieve-hook you could tell the webhost to pull from the repo. This does however require you to have git installed on the webserver aswell as some kind of webinterface for the post-recieve-hook to post to.