Skip to content

Instantly share code, notes, and snippets.

View sayadi's full-sized avatar

Mohamed Al Sayadi sayadi

View GitHub Profile
version: 2
general:
branches:
only:
- dev
- staging
- prod
jobs:
build:
docker:
@sayadi
sayadi / bash.sh
Last active August 1, 2019 09:13
How to SSH to an AWS EC2 Instance Running Linux from a CircleCI Build
# 1- Install AWS CLI
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
unzip awscli-bundle.zip
./awscli-bundle/install -b ~/bin/aws
# 2- Get the public IP of the current CircleCI runner
PUBLIC_IP=$(curl ipinfo.io/ip)
# 3- Get AWS Region
# TODO Don't forget to replcae with your own Region
spring.profiles.include=@spring.profile.from.maven@
<profiles>
<profile>
<id>default</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<spring.profile.from.maven/>
</properties>
<dependencies>
prop1=This is a shared value across all profiles for prop1.
prop2=Non-production-specific value for prop2.
spring.profiles.include=non-prod
prop3=Development-specific value for prop3.
spring.profiles.include=non-prod
prop3=Staging-specific value for prop3.
prop2=Production-specific value for prop2.
prop3=Production-specific value for prop3.
@RestController
@RequestMapping("/properties")
public class PropertyController {
private final Environment environment;
@Autowired
public PropertyController(
Environment environment) {