GitHub Actions - how to connect to an external MySql database - mysql

I'm building an application in Python and using GitHub Actions to automate the testing 'on push'. However, I now want to connect my app to an existing MySql database.
From searching the Marketplace, Google and YouTube, I can see the following options:
use the MySql supplied with the GitHub Actions' Ubuntu virtual environment
setup a new MySql dB inside the GitHub Actions VM.
Setup MySql inside a Docker container and connect to it from another Docker container containing my app.
What I can't see is how to connect out of the GitHub Actions VM to an existing database on my network. Is it possible and should I expect to see a pre-built action to do this in the Marketplace.
Sorry for such an obtuse question: old, out-of-date programmer new to both CI/CD and containerisation. Thank you.

Related

Connect Heroku Add-on MySQL Database to DigitalOcean droplet for Spring Boot

Have anyone deployed Spring Boot app to DigitalOcean droplet?
I have previously created app on Heroku.com, where I also ordered MySQL Database and deployed my Web API. Due to performance issues, I want to transfer my Spring Boot app to DigitalOcean, but there is a problem: I still want to use DB I ordered on Heroku. I have all the required credentials, but can't find a way to connect my droplet. In Heroku, there is very simple way to do that, all I need to do is to change config variable DATABASE_URL, but here I cannot find the same. I hope you understand my problem and provide simple solution.
Thank You in advance!
What you need is called Environment Variables, here is the docs from DO.
Specify app-level variables on the Environment screen when creating an app. For existing apps, go to the Apps section of the DigitalOcean Control Panel. Click your app, then click the Settings tab. Next to the App-Level Environment Variables heading, click the Edit link.
https://docs.digitalocean.com/products/app-platform/how-to/use-environment-variables/

How to host my web app on heroku with MySQL database?

As far as I know, while deploying your web application on Heroku (from github) you need to provide a requirement.txt file so that every library which is used can be installed. But you cannot install MySQL like that. I've used python and streamlit to create a web application. I used MySQL to store data. I don't want the local machine's data to be exported but want to store the data when it is deployed as web app and someone fill in the details (it's basically a Student DBMS).
How can I deploy such a web application that uses MySQL on heroku ?
I've read some docs and look around and found that PostgreSQL is more suitable but I want to use MySQL because this is school project.
Heroku has a add-ons called ClearDB for Mysql
https://devcenter.heroku.com/articles/cleardb

Rebuild openshift cartridge without deleting app

I have production golang app running on openshift using this cartridge (https://github.com/smarterclayton/openshift-go-cart) with a mysql database. The cartridge has had some updates which I would like to pull into my app.
Is it possible to reploy the base cartridge into my gears without deleting the whole application?
If your repository contains .openshift/markers/hot_deploy, when you perform a git push OpenShift will not rebuild the application and perform a hot deployment instead.
See the Hot Deploying Applications section of the user guide, as well as this blog post (which somehow contains more specific details about where the marker file goes)

How to feed sonar without direct database access

I'd like to create a build chain for open source projects I'm working on. I'm currently using github, travis and coveralls. This is working fine but I'd like to add some kind of static code analyze.
I was thinking about hosting SonarQube on openshift, but problem is that openshift does not allow remote connection to database.
I have come to following solutions, but none of them seems to be easy to achieve:
Any REST API for sonar that could be used instead of raw db access
Any alternative for sonar that could be hosted on openshift
Migrate from travis to jenkins hosted on openshift and use this
Any other (free) alternative to openshift which would allow raw db access
Any other option
1 would be an ideal solution but I've searched all sonar plugins I could find and haven't found any :/
Am I missing something? There is no easy way to host sonar without exposing db access?
It looks like at least one person has gotten SonarQube running on OpenShift using the DIY cartridge:
http://majecek.wordpress.com/2013/12/06/how-to-run-sonarqube-4-0-on-openshift/
I was able to get SonarQube to start following those instructions.
EDIT: databases in OpenShift applications are only exposed publicly in scaled applications. You will want to create your sonar app with the -s option if you need to populate your database from outside OpenShift.

How to deploy war file tomcat running on amazon ec2 instance

I have install tomcat 6.0 and mysql 5.5 on amazon linux instance.
now i want to deploy war file on that tomcate & .sql file on mysql running on amazon instance .I am new for amazon services.Plz give details about procedure.
Plz help me for that .Thanks in advance.
The simple way is use scp or rsync to upload file and restart Tomcat.
However if you have many servers or WARs, even more complicated situation, consider other ways:
use jenkins to deploy
write your deploy script leveraged by python-fabric
You should design your own deploy process to overcome the difficulties you met.
In my case is every ec2 instances are spot instance, they are created by scripts or autoscaling.
We should keep the every new spot instance update to date, using the latest software and JARs to run web crawler.
Our design is very simple. Just a script to download files from S3 and unzip it:
ec2 spot instance completed booting
run the software-update script
run the software script getting from the updater
In your case, there are some key point you not figure out:
How many ec2 instance should update ?
A ec2 instance how to know it need to update.
(many other points)
What is the best way to deploy your WARs ? It depends on your situation.