Skip to content

Commit

Permalink
added workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
joelwembo committed Apr 23, 2024
1 parent df6467b commit 9ab9dc6
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 31 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/SonarQube-workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: "sonar_cloud_scan_github_actions"

on:
push:
branches: ['master' , 'main']
pull_request:
branches: ['master', 'main']

permissions:
contents: write


jobs:
DemoSonarCloudSCan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: SonarCloud Scan
uses: sonarsource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GIT_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
args: >
-Dsonar.organization=rekhugopal
-Dsonar.projectKey=SonarCloudCodeAnalyisis
-Dsonar.python.coverage.reportPaths=coverage.xml
10 changes: 5 additions & 5 deletions deployments/Jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ pipeline{
registry = ""
registryCredential = ""
projectPath = ""
AWS_ACCESS_KEY_ID = credentials('your_aws_access_key_id')
AWS_SECRET_ACCESS_KEY = credentials('your_aws_secret_access_key')
AWS_REGION = 'your_aws_region'
EC2_INSTANCE = 'your_ec2_instance_id'
SSH_KEY = credentials('your_ssh_key')
AWS_ACCESS_KEY_ID = credentials('AWS_ACCESS_KEY_ID')
AWS_SECRET_ACCESS_KEY = credentials('AWS_SECRET_ACCESS_KEY')
AWS_REGION = credentials('AWS_REGION')
EC2_INSTANCE = credentials('EC2_INSTANCE')
AWS_SSH_KEY = credentials('AWS_SSH_KEY')
}
stages {

Expand Down
7 changes: 1 addition & 6 deletions deployments/Jenkins/JenkinsfileTemplate
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,8 @@ pipeline{
sh 'docker-compose up -d'
}
}
stage('Execute Manuel Tests'){
steps {
sh 'echo "Migration Operation Completed , Please Check the logs status"'
}
}

stage('Deploy to AWS') {
stage('Deploy to AWS EC2') {
steps {
dir('deployments') {
sh "pwd"
Expand Down
40 changes: 20 additions & 20 deletions deployments/terraform/terraform-aws-ec2-tf/terraform/installer.sh
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
#!/bin/bash

# Java Installations
# sudo apt-get install openjdk-11-jdk -y
# sudo apt-get install zip -y
# echo 'JDK Installed successfully installer'
Java Installations
sudo apt-get install openjdk-11-jdk -y
sudo apt-get install zip -y
echo 'JDK Installed successfully installer'


# # Jenkins installations
# sudo apt update
# apt install make
# sudo apt-get install debian-keyring debian-archive-keyring --assume-yes
# sudo apt-key update
# sudo apt-get update
# sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5
# sudo apt update
# sudo apt install openjdk-11-jre-headless --assume-yes
# sudo java -version
# curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee /usr/share/keyrings/jenkins-keyring.asc > /dev/null
# echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] https://pkg.jenkins.io/debian-stable binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list > /dev/null
# sudo apt-get update
# sudo apt-get install jenkins --assume-yes
# # sudo service jenkins status
# echo 'Jenkins successfully installer : password '
# Jenkins installations
sudo apt update
apt install make
sudo apt-get install debian-keyring debian-archive-keyring --assume-yes
sudo apt-key update
sudo apt-get update
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5
sudo apt update
sudo apt install openjdk-11-jre-headless --assume-yes
sudo java -version
curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee /usr/share/keyrings/jenkins-keyring.asc > /dev/null
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] https://pkg.jenkins.io/debian-stable binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt-get update
sudo apt-get install jenkins --assume-yes
# sudo service jenkins status
echo 'Jenkins successfully installer'
# # Postgres Installation
# sudo apt update
# # enable repository to install postgresql
Expand Down

0 comments on commit 9ab9dc6

Please sign in to comment.