Mass Deploy same code to Heroku individual accounts - django

I want to set a business model where I Mass deploy same code base(Python Django with Postgres) to my customers heroku accounts .
(I want customers to manage their own accounts and for me to stay only as software provider.However customers should get a SaaS experience without me actually having to take care of multitenant details.Also customers will be able to freeze at any time and get out of the upgrade process or to switch to custom code)
So customer will purchase my software and setup the heroku account . I will get credentials from customer and add it to my deployment process and the code will be deployed each time to all the accounts for bugs fixes and for new versions.
Do you think it is possible to achieve with Heroku?

Yes, it is possible and actually it is really easy to do IHMO.
The simplest method would be to just get credentials for each account and do git push. But a better way is to use Heroku api. You can first deploy new version to your own app which will give you a compiled slug that you can then deploy to other apps. The benefit is that you will only have to run build phase once.
Take a look at Heroku Platform API, mainly at slug and release sections. You can use slug info to get url for compiled slug, slug create to upload compiled slug into your client app and release create to deploy it.
Also look into Release phase, because you need a way to run migrations for each client when you deploy.

Related

Terraform UI for non technical CLI users?

I currently have a server build process that uses Terraform and deploys a server all from code.
I'm looking for a web UI with forms that I could either populate specific fields and or do API get commands against a VCenter or wherever the server is being built to populate the specific fields. The fields that get populated would be stored as the variables.tf file and when someone hits submit, it would run the actual Terraform command terraform apply to build the server based on the variables. My guess is the terraform binaries would have to live on there so it could run in the background.
It doesn't have to be some super fancy web page, just something that I could potentially make look cool for Director level folks.
Also, I don't want to use TF enterprise, yet. I've looked into a couple of open source projects (atlantis and terrahub) but none seem to be what I'm looking for.
I'm far from a web developer so any help would be awesome.
You can try with SLD
Stack-Lifecycle-Deployment
I think it has everything that you need
It is very intuitive, it has a web interface and a rest api to easily integrate it with the rest of the applications.

Automate DB Schema Migrations - CircleCI/Sequelize/GCP

I currently am working on an Application with a MySQL back-end hosted on GCP. Code is Node.js and we use CircleCI and Sequelize. Right now after deploying my scripts, if I had any schema changes, I would go in to the database and manually add those fields with sql scripts. We create migrations in our code and want to add those new field programmatically. I need to go in the container root and manually run the npx sequelize db:migrate. Is there a way to automate that?
For background info, I come from the database side not developer side, so please be gentle if my question seems to have an obvious answer.

How to get to know whather app has unistalled from Marketplace apps from Admin Panel

End user can install my application from Marketplace Apps. But When they uninstall from marketplace app, I didn't get uninstall information and my application starts to get user details from that domain using admin sdk ,It returns '403:Requested domain is not authorized' and then i understand End User has removed app from marketplace apps .So I wanted to capture this uninstallation information so that i can stop tasks related to that domain.
Another thing is If end user install app on particular org unit. I am unable to get that org unit name, path etc. So how can i get that installed org details ? So that it will be easy to get users from that org unit using admin sdk.
Not sure of a way that it will tell you, but a more long term solution might be to check on it yourself. You can use the Google Apps Marketplace api, https://developers.google.com/apps-marketplace/v2/reference/, to get information about domains using your app.
You can get customer license info which tells you if the application is licensed or not in the state field.
https://developers.google.com/apps-marketplace/v2/reference/customerLicense#resource
You could possibly check this once a day for your existing customers to check if they still have it installed, or if they have uninstalled it.

ecommerce django app on webfaction versus VPS/DS versus Cloud Servers like EC2

Firstly, some background - I have been mostly using VPS/DS and EC2 for the django apps I build for the past 3-4 years.
On webfaction, I have only been deploying "trivial" apps or "personal blog apps" using both django and wordpress.
My biggest hesitation about deploying anything serious (with large amount of sensitive personalised user data such as addresses and phone records or ecommerce related data or even accepting a Paypal related transaction) on webfaction is that it is a shared hosting environment.
I like webfaction a lot because they have made it really easy to deploy django apps without the need for me to spend some time doing system administration and installing my own packages (which I obviously need to do on a clean EC2 instance or a VPS/DS instance on linode for example).
The question is - is it very unsafe to use webfaction (since it is a shared hosting provider and I can actually list the other users' home directory by running "ls -la" after I ssh in) to run an ecommerce application or an application which has a lot of personalized, sensitive user data? I would appreciate specific technical examples which can help me better decide whether or not to run a "simple" (yes, I know the word simple is dangerously ambiguous/undefined) ecommerce app - which probably will use the paypal payment gateway on webfaction.
I can address the specific concerns you have listed:
While you may be able to see other user's files, it's because they haven't changed the permissions on their files. You can use standard linux file permissions to keep other users from reading or writing your files.
chmod 600 file
You will most likely be storing your information in a database hosted by webfaction. While it is a shared enironment, you do get your own database that is protected by a password and a username. In short, it has the same security in place that a database hosted on a VPS would have.
While you do have to take extra steps to ensure the other users on the system cannot gain access to your information, it is certainly possible to keep your site secure in webfaction's shared hosting environment.

Deploy as Jenkins User or Allow Jenkins To Run As Different User?

I'm just getting started with Jenkins CI, and had a question which I'm
struggling to find answers for in the docs or online. Wonder if
someone might be able to offer some advice?
I'm attempting to use it to automatically deploy my dev and stage
branches of my Django projects which are hosted on a Github
organisation repository (ie, private). At the moment I have a user
"django" who can access the Github repo via a Github deploy key. My
Jenkins user can't access the repo. What's the best practice way of
dealing with this - should I be creating an ssh deploy key for the
"jenkins" user, or should I be getting Jenkins to run as my "django"
user? I've seen mention if a HUDSON_USER in a newsgroup post, but I
can't find reference to this in the docs.
Many thanks!
Ludo.
I have not worked with Github and so this answer may not apply at all, but we do use Jenkins and we use both CVS & Subversion for source control.
In our system, we use different username/password combinations for all three (Jenkins, CVS, Subversion), and it has had no adverse effects yet (it has been a year since we deployed Hudson - currently building 50+ projects).
As long as you can get Jenkins to access the repo using your github deploy key, you shouldn't have to change Jenkins to run as django, or create a jenkins user key for github. Personally, I would keep them separate.
Did you try this?
Contact your OS admin team to grant to access to perform few operations on your version control using SUDO access.
OR
run the command using
sudo -H -u <username> command parameters..