- Golang
- Database (MYSQL)
- Github Action
- SonarQube Cloud
- Docker && Docker-compose
- Azure container Registory
- trivy
- Azure Storage Account
- Helm
- Azure Kubernetes
- Slack-Notification
This is a simple project which has Golang with connection of database as Mysql. And here we are use a GET and POST method.
-
First we are check wether the project is working in localhost:8080/database so we us docker-compose to verify.
-
Push to the github.
-
We use Github action as CICD pipline for this project.
-
Build Golang code
-
And make sure setup your Mysql-server. And create username as root and password as password
-
Now Scan the Code for Quality checking and bugs So we use SonarQube cloud and write a propertitits file and connect to the github action.
-
Create a Dockerfile and mension the steps and we are used Alpine image.
-
Create a Azure Container Registory and connect to the Github action.
-
Build the image & Push to the ACK.
-
We are Deploying our porject image in Azure Kubernetes.
-
And we are using artifactory as Azure Storage Account for store our build file library .
-
If the Pipline is success of failed we need to intimate so we use Stack-Notification.
wget https://raw.githubusercontent.com/THARUN13055/quick_install_linux/main/pacman.py
wget https://raw.githubusercontent.com/THARUN13055/quick_install_linux/main/pacman.py
python3 pacman.py list
python3 pacman.py install <listed>
wget https://raw.githubusercontent.com/THARUN13055/quick_install_linux/main/pacman.py
python3 pacman.py list
python3 pacman.py install docker
-
create azure container registory.
-
In access key there is login server.
-
docker login username: password:
-
After login build our image with login server name.
docker build -t <login server>/imagename:latest .
-
Create azure App Registory in Azure Directory.
-
In Azure App Registory create Secrets.
-
Copy all the tokens like Subscription ID, Tenant ID, client_secret ID,client ID .
-
Create secret in github action and past.
-
if your azure login is not work go to azure app registory This are the steps use and create azure credientials.
-
app registory > certificats&secrets > add credientials (organization: tharun13055) (reponame: go_project_2) > select branch and name main.
-
Create Azure kuberentes service Resource name as kuberentes.
-
Cluster name as golang.
- this is the sample command for changing the version in helm chart because if we create new container we need to push it so we need to change it.
sed -i "s|image: tharun13055/library:.*|image: tharun13055/library:1|" ./golang_chart/values.yaml
- This is for helm chart
sed -i "s|image: tharun13055/library:.*|image: tharun13055/library:{{ github.run_number }}|" ./golang_chart/values.yaml