Is it possible to publish a git repository or a zip file to CloudControl directly by REST API? - cloudcontrol

I want to publish a maven project to CloudControl by REST API, not by command line tool, is it possible? That means, create a app by REST API, deploy source or binary code by REST API. Just like Heroku, I can build a url directly into app using REST API https://api.heroku.com/apps/myapp/builds. Thanks very much!

We currently don't provide a way to upload images directly. You'd first have to push to the Git remote which will build the image. All other steps like creating an app/deployment, deploying or adding add-ons are available via the REST-API. You can see examples of the API usage in the python library the command line client uses.

Related

how to automatically deploy to firebase on commit to main branch?

The Main part
I am trying to create a comfortable workflow for myself. I just want to know is there any way to automate deploys from GitHub Repo to Firebase hosting when I commit changes in the repo's main branch at my desktop and push origin to GitHub?
...possibly using "GitHub actions"...
Context and what I've tried
As on 15-Jan-2022 there are two ways I found of deploying website files to firebase hosting.
The de facto firebase cli way, where you use firebase deploy command to push files to firebase hosting.
The automated way using github actions, where the site is deployed automatically every time a pull request is created.
The first one is tedious, the second one is not my cup of cake. Especially because the workflow I want to setup is not too much git oriented, I don't use "pull requests" as far as I understand. I just commit changes directly in the main branch.
(That is so because, I am not a programmer, I just trying to create a blogging site using the Firebase hosting + GitHub repo)
I also referred https://medium.com/firebase-developers/the-comprehensive-guide-to-github-actions-and-firebase-hosting-818502d86c31
Use Deploy to live & preview channels via GitHub pull requests. It will work if you use pull requests to review changes or if you push commits directly to the primary branch.
I would recommend that you use pull requests though. It's a great flow to double check your changes and with the Firebase action it will deploy a temporary preview of the the changes so you can validate everything looks correct.

How to deploy different versions of a web in different url path in Firebase Hosting?

I want to automatize the deployment of a web on Firebase hosting on each pull request in git hub with Firebase CLI. I want to deploy the version of the web of a pull request in a specific URL path.
For example, if the name of the branch of a PR is backend/100, I want to upload the web on https://<project-name>.web.app/backend/100. Then if I go to https://<project-name>.web.app/backend/100 I can see the version of the backend/100 branch, or If i go to https://<project-name>.web.app/backend/180 I can see the version of the backend/180 branch.
There is a way to achieve this?
Firebase supports multiple pages per project. But it will look like whatever-name-you-choose.web.app (not even necessarily the same project name), say project-name-branch-name.web.app.
In terms of doing routing, "backend/100", you'd have to develop a work-around..

How to get list of installed features in Karaf using REST API?

I know using command line it can be get by running feature:list -i but is there any API/JSON available to fetch this?
You can use jolokia and hawtio to retrieve that information. Quite easily. I believe you can easily add the hawtio repo from the native karaf repos in features (repo-add hawtio). Then you need to install jolokio, hawtio, and the karaf web console. From the karaf webconsole alone you can see a full list of features, but I find the hawtio interface to be a god send.
A REST API can be installed without the need for Hawtio, which uses jolokia for accessing the bundle list under the hood.
The jolokia project provides web applications called agents serving a REST API. For quick experiments you can deploy the war jolokia-war-unsecured into the hot deploy folder of a running karaf instance. This installs a A REST web service at e.g. http://localhost/jolokia-war-unsecured/ which does not require any authentications.

How to delete site via CLI

Is there a way to delete an app via Firebase CLI?
Our CI creates a temporary Firebase app for a feature branch (based on the CI build number), and then runs tests on it. At the end it needs to delete the app. I'm not entirely sure how this is done. firebase disable:hosting just disables hosting and does not delete the app. This is similar to how we would have used Heroku review apps or Heroku forked apps. A similar CI workflow can also be achieved on Google App engine via versions.
Any pointers would be much appreciated.
The correct command is firebase hosting:disable, which make your site offline. You can not remove your project, instead you can overwrite it by creating a new one with firebase init.
More info here https://firebase.google.com/docs/cli/.
There is currently no public API to delete a Firebase backend.
The recommended practice is to use the same database for testing and (if needed) put each run in its own node under the root. So instead of creating/deleting a new database, you're just create/deleting a node in a single database.
Using the command firebase use <alias> --unaliasand then delete the project from the console https://console.firebase.google.com/
Check before the list of commands with the command -h

How do I download the javascript library for mapstraction v2?

I am setting up a map on a drupal website using the mapstraction module. I am planning to use the 6.x-2.x-dev development branch of mapstraction because I need some of its additional functionality.
In the instructions for installing the module, it says to download the mapstraction v2 library from mapstraction.com Navigating through their site, I found this page:
code.google.com/p/mapstraction/source/checkout which tells you:
Command-line access
Use this command to anonymously check out the latest project source code:
'# Non-members may check out a read-only working copy anonymously over HTTP.
svn checkout http://mapstraction.googlecode.com/svn/trunk/ mapstraction-read-only
I don't understand what command-line access is? I've tried pasting mapstraction.googlecode.com/svn/trunk/ into my browser, and I get a whole directory listing. Do I download each of these files? How do I know what is actually the mapstraction v2 library? Am I going about accessing the javascript library in the wrong way?
They moved to git hub.
You can now just download the zip file from here without a client installed
https://github.com/mapstraction/mxn/downloads
What you need is a Subversion Client. The Apache project maintains a list where you should be able to find a client for your operating system. Once you have a client, you will have to perform the "Checkout" function on the url provided by Google Code. Once you have the directory downloaded by the SVN client, you can look at the examples for proper usage and file inclusion.

Resources