Skip to content

Instantly share code, notes, and snippets.

View topera's full-sized avatar
😎
Minimalism is Power!

Rafael Topera topera

😎
Minimalism is Power!
  • Brazil
View GitHub Profile
@topera
topera / .profile
Last active June 5, 2018 01:13
How to specify AWS keys and default region to use in aws cli
export AWS_ACCESS_KEY_ID="AAAAAAAAAABBBBBBCCCC"
export AWS_SECRET_ACCESS_KEY="AAAAAAAABBBBBBBBBCCCCCCCDDDDDDDEEE"
export AWS_DEFAULT_REGION="us-east-1"
@topera
topera / build.gradle
Last active June 5, 2018 01:19
Gradle task to prepare a springboot app to be deployed as a Docker in Elastic Beanstalk
task createPackageToAWS(type: Exec) {
doFirst {
executable "sh"; args "-c", "jar cf build/app-docker.jar Dockerfile build/libs/app.jar"
}
}
@topera
topera / pip.sh
Created June 5, 2018 01:29
Installation of pip on my Ubuntu Mate 16.04
# [python3][pip]
apt install python3-pip
sudo vi /usr/bin/pip3
# change from
from pip import main
# to
from pip._internal import main
# after this pip3 and pip are poiting to pip3!
@topera
topera / aws-cli.sh
Last active June 5, 2018 03:43
Install aws cli
pip install awscli --upgrade --user
# add on PATH: ~/.local/bin
complete -C aws_completer aws
# then run it in your .git folder
aws configure
@topera
topera / main.gradle
Created June 7, 2018 01:09
How to create a custom root source folder in Gradle
sourceSets {
myCustomSourceFolder {
// Create the structure myCustomSourceFolder/java/your-package
// Ref https://docs.gradle.org/current/userguide/organizing_gradle_projects.html
}
}
@topera
topera / config.yml
Created June 7, 2018 01:14
Example of file automatically generated by eb tool of AWS, created automatically on .elasticbeanstalk folder
branch-defaults:
dev:
environment: PROD
master:
environment: PROD
deploy:
artifact: build/fobit-docker.jar
environment-defaults:
PROD:
branch: master
@topera
topera / fobit-aws.gradle
Created June 9, 2018 01:29
Gradle task to deploy to AWS Elastic Beanstalk using the aws cli command line tool
task deployEb(type: AWS, group: group) {
description 'Deploys application in AWS Elastic Beanstalk'
doFirst {
run "aws configure set default.region $awsRegionName"
run "aws s3 cp $buildDir/$jarLocal s3://$awsBucketName/$awsJar"
run "aws elasticbeanstalk create-application-version --application-name=$awsAppName --version-label=$buildNumber --source-bundle S3Bucket=$awsBucketName,S3Key=$awsJar"
run "aws elasticbeanstalk update-environment --environment-name=$awsEnvName --version-label=$buildNumber"
}
}
@topera
topera / problem-with-sonar-and-gradle.md
Created June 10, 2018 16:24
Sonarqube fix for gradle
  • PROBLEM

We run ./gradlew sonarqube

And get the error:

Execution failed for task ':sonarqube'.

You're only authorized to execute a local (preview) SonarQube analysis without pushing the results to the SonarQube server. Please contact your SonarQube administrator.

Tested with Gradle 4.8 and plugin org.sonarqube 2.6.2.

@topera
topera / fix-for-travis.md
Created June 10, 2018 16:43
How to Fix and error in Travis-CI when running Sonar analysis
  • Error Execution failed for task ':sonarqube'.

Unable to load component class org.sonar.scanner.scan.ProjectLock

Tested with Gradle 4.8 and plugin org.sonarqube 2.5

  • Solution I upgraded the sonarqube plugin to version 2.6.2 and now its working.
@topera
topera / .travis.yml
Created June 24, 2018 00:00
How to run sass in travis(add this to your travis.yml file)
before_install:
- gem install sass --version "=3.5.6"