Last active
January 9, 2025 17:52
-
-
Save avoidik/8041e515a0de04fa3b539a0cbdb59239 to your computer and use it in GitHub Desktop.
Revisions
-
avoidik revised this gist
Sep 20, 2024 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -41,6 +41,7 @@ func main() { fmt.Println("Hello World!") } EOF $ go fmt main.go $ go run main.go ``` -
avoidik revised this gist
Sep 20, 2024 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,6 +23,7 @@ $ docker run --rm -i -t --name go-lang-test \ --platform linux/aarch64 \ -v /var/run/docker.sock:/var/run/docker.sock \ -v $(pwd):/build \ -w /build \ --network sonarqube \ public.ecr.aws/codebuild/amazonlinux2-aarch64-standard:3.0 bash ``` -
avoidik revised this gist
Sep 20, 2024 . 1 changed file with 52 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,61 @@ Run SonarQube ```terminal $ git clone https://github.com/SonarSource/docker-sonarqube $ cd docker-sonarqube $ docker build -t sonarqube:9.9.4.87374 --build-arg SONARQUBE_VERSION=9.9.4.87374 -f 9/community/Dockerfile 9/community/ $ docker network create sonarqube $ docker run --rm -i -t --name sonarqube -p 9000:9000 \ --security-opt seccomp=unconfined --security-opt apparmor=unconfined \ -e SONAR_SEARCH_JAVAADDITIONALOPTS='-Dbootstrap.system_call_filter=false' \ --network sonarqube \ sonarqube:9.9.4.87374 ``` Visit http://localhost:9000, change default password, create project and token. Prepare project environment ```terminal $ mkdir go-lang-test $ cd go-lang-test $ docker run --rm -i -t --name go-lang-test \ --platform linux/aarch64 \ -v /var/run/docker.sock:/var/run/docker.sock \ -v $(pwd):/build \ --network sonarqube \ public.ecr.aws/codebuild/amazonlinux2-aarch64-standard:3.0 bash ``` Prepare sample project ``` $ go mod init hello $ cat <<'EOF' | tee main.go package main import "fmt" func main() { fmt.Println("Hello World!") } EOF $ go run main.go ``` Run Sonarqube Scanner ```terminal $ curl -fsSLO https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.1.0.4477-linux-aarch64.zip $ unzip sonar-scanner-cli-6.1.0.4477-linux-aarch64.zip $ export PATH="$PATH:$(pwd)/sonar-scanner-6.1.0.4477-linux-aarch64/bin" $ SONAR_TOKEN='sqp_f575f529d44c4998a816ea82e5c9615275b3ba59' $ SONAR_URL='http://sonarqube:9000' $ sonar-scanner \ -Dsonar.projectBaseDir="$(pwd)" \ -Dsonar.projectKey='go-lang-test' \ -Dsonar.sources='.' \ -Dsonar.host.url="$SONAR_URL" \ -Dsonar.login="$SONAR_TOKEN" \ -Dsonar.verbose=true -X ``` -
avoidik revised this gist
Sep 20, 2024 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,5 +2,8 @@ $ git clone https://github.com/SonarSource/docker-sonarqube $ cd docker-sonarqube $ docker build -t sonarqube:9.9.4.87374 --build-arg SONARQUBE_VERSION=9.9.4.87374 -f 9/community/Dockerfile 9/community/ $ docker run --rm -i -t --name sonarqube -p 9000:9000 \ --security-opt seccomp=unconfined --security-opt apparmor=unconfined \ -e SONAR_SEARCH_JAVAADDITIONALOPTS='-Dbootstrap.system_call_filter=false' \ sonarqube:9.9.4.87374 ``` -
avoidik renamed this gist
Sep 20, 2024 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
avoidik created this gist
Sep 20, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ ```terminal $ git clone https://github.com/SonarSource/docker-sonarqube $ cd docker-sonarqube $ docker build -t sonarqube:9.9.4.87374 --build-arg SONARQUBE_VERSION=9.9.4.87374 -f 9/community/Dockerfile 9/community/ $ docker run --rm -i -t --name sonarqube -p 9000:9000 --security-opt seccomp=unconfined --security-opt apparmor=unconfined sonarqube:9.9.4.87374 ```