Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
c211b81
Add buildspec_test.yaml
gbrylinski Apr 26, 2021
2be0304
Rename
gbrylinski Apr 26, 2021
56fc88d
Rename
gbrylinski Apr 26, 2021
eff7958
Update 2
gbrylinski Apr 26, 2021
fcb39b4
Update 3
gbrylinski Apr 26, 2021
1879f09
Update 4
gbrylinski Apr 26, 2021
09defe5
Update 5
gbrylinski Apr 27, 2021
1f11c3e
Update 6
gbrylinski Apr 27, 2021
be69b6e
Update 7
gbrylinski Apr 27, 2021
263eea7
Update 8
gbrylinski Apr 27, 2021
e991ade
Update 9
gbrylinski Apr 27, 2021
2da7320
Update 10
gbrylinski Apr 29, 2021
6d80c4f
Update 11
gbrylinski Apr 29, 2021
f345de8
Update 12
gbrylinski Apr 29, 2021
03ad523
Update 13
gbrylinski Apr 30, 2021
8ae8226
Update 14
gbrylinski Apr 30, 2021
cc263d0
Update 15
gbrylinski Apr 30, 2021
a60364e
Update 16
gbrylinski Apr 30, 2021
5a17b12
Update 17
gbrylinski Apr 30, 2021
ffe3e3c
Update 18
gbrylinski Apr 30, 2021
01b9d3f
Update 19
gbrylinski May 5, 2021
37ec5b7
Update 20
gbrylinski May 6, 2021
533bda3
Update 21
gbrylinski May 7, 2021
09cee18
Update 22
gbrylinski May 7, 2021
a8421a7
Update 23
gbrylinski May 7, 2021
eb1f384
Update 24
gbrylinski May 7, 2021
d9daf14
Update 25
gbrylinski May 7, 2021
db848e3
Update 26
gbrylinski May 7, 2021
75a546b
Update 27
gbrylinski May 7, 2021
f09f20b
Update 28
gbrylinski May 7, 2021
c886499
Update 30
gbrylinski May 7, 2021
e410e2f
Update 31
gbrylinski May 7, 2021
7c216d4
Update 32
gbrylinski May 11, 2021
a453a3b
Update 33
gbrylinski May 11, 2021
ce8b45b
Update 34
gbrylinski May 11, 2021
2393950
Update 35
gbrylinski May 11, 2021
d670282
Update 36
gbrylinski May 12, 2021
4517826
Update 37
gbrylinski May 12, 2021
88b92d0
Update 38
gbrylinski May 12, 2021
a81a77a
Update 39
gbrylinski May 12, 2021
4cbde11
Update 40
gbrylinski May 12, 2021
331d75d
Update 41
gbrylinski May 12, 2021
c0e82f9
Update 42
gbrylinski May 12, 2021
70c76aa
Update 43
gbrylinski May 12, 2021
236980e
Update 44
gbrylinski May 12, 2021
2559bdf
Update 45
gbrylinski May 12, 2021
641506d
Update 46
gbrylinski May 12, 2021
f9c611c
Update 47
gbrylinski May 15, 2021
bf0c527
Update 48
gbrylinski May 15, 2021
7923686
Update 49
gbrylinski May 15, 2021
d028094
Update 50
gbrylinski May 15, 2021
e4bcb19
Update 51
gbrylinski May 17, 2021
958e978
Update 52
gbrylinski May 17, 2021
2a0d5e8
Update 53
gbrylinski May 17, 2021
7d61414
Update 54
gbrylinski May 17, 2021
a4b8ac0
Update 55
gbrylinski May 17, 2021
851bdaa
Update 56
gbrylinski May 17, 2021
7488e63
Update 57
gbrylinski May 17, 2021
4650b23
Update 58
gbrylinski May 17, 2021
8c3c0b5
Update 59
gbrylinski May 17, 2021
13f016d
Update 60
gbrylinski May 17, 2021
cb0d124
Update 61
gbrylinski May 17, 2021
0fa3587
Update 62
gbrylinski May 17, 2021
471bc50
Update 63
gbrylinski May 17, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.idea
buildspecs
log/*
spec
test
.rspec
.rubocop
babel-config.js
docker-compose.yml
Dockerfile
Guardfile
postcss.config.js
Procfile
8 changes: 3 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
FROM ruby:2.7.2
RUN curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update -qq && apt-get install -y build-essential libpq-dev nodejs postgresql-client yarn
FROM public.ecr.aws/bitnami/ruby:2.7
RUN apt-get update && apt-get install -y build-essential libpq-dev nodejs npm postgresql-client yarn && npm install --global yarn
RUN mkdir /sample_rails_application
WORKDIR /sample_rails_application
COPY Gemfile /sample_rails_application/Gemfile
Expand All @@ -14,4 +12,4 @@ RUN yarn install --check-files
COPY . /sample_rails_application
EXPOSE 3000

#CMD ["rails", "server", "-b", "0.0.0.0"]
CMD ["rails", "server", "-b", "0.0.0.0"]
14 changes: 14 additions & 0 deletions buildspecs/production-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 0.2

phases:
install:
runtime-versions:
ruby: 2.7
commands:
- pwd
- echo "Deploying to PRODUCTION"
- cat docker-image-to-deploy.txt

build:
commands:
- echo "Tests stage!"
14 changes: 14 additions & 0 deletions buildspecs/sandbox-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 0.2

phases:
install:
runtime-versions:
ruby: 2.7
commands:
- pwd
- echo "Deploying to SANDBOX"
- cat docker-image-to-deploy.txt

build:
commands:
- echo "Tests stage!"
14 changes: 14 additions & 0 deletions buildspecs/staging-deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 0.2

phases:
install:
runtime-versions:
ruby: 2.7
commands:
- pwd
- echo "Deploying to STAGING"
- cat docker-image-to-deploy.txt

build:
commands:
- echo "Tests stage!"
31 changes: 31 additions & 0 deletions buildspecs/tests-and-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
version: 0.2

phases:
install:
runtime-versions:
ruby: 2.7
commands:
# - aws sts get-caller-identity
# - aws kms describe-key --key-id arn:aws:kms:eu-west-1:487483287434:key/ec84f810-ec41-45a0-ad9e-3575324d26c4
- curl -Lo /tmp/sops.deb https://github.com/mozilla/sops/releases/download/v3.7.1/sops_3.7.1_amd64.deb
- dpkg -i /tmp/sops.deb
- sops --decrypt deployment/secrets.staging.yaml
- aws eks update-kubeconfig --name grze --role-arn arn:aws:iam::487483287434:role/application-ci-cd-codepipeline-eks-access-role
- kubectl get ns -o wide

build:
commands:
- aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com

- docker build -t $ECR_REPOSITORY_URL:$CODEBUILD_RESOLVED_SOURCE_VERSION .
- docker tag $ECR_REPOSITORY_URL:$CODEBUILD_RESOLVED_SOURCE_VERSION $ECR_REPOSITORY_URL:latest

- docker push $ECR_REPOSITORY_URL:$CODEBUILD_RESOLVED_SOURCE_VERSION
- docker push $ECR_REPOSITORY_URL:latest

- echo "$ECR_REPOSITORY_URL:$CODEBUILD_RESOLVED_SOURCE_VERSION" > docker-image-to-deploy.txt

artifacts:
files:
- docker-image-to-deploy.txt
- buildspecs/**/*
11 changes: 11 additions & 0 deletions deployment/.sops.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
creation_rules:
- path_regex: secrets\.staging\.yaml$
kms: 'arn:aws:kms:eu-west-1:487483287434:key/ec84f810-ec41-45a0-ad9e-3575324d26c4'

- path_regex: secrets\.sandbox\.yaml$
kms: 'arn:aws:kms:eu-west-1:487483287434:key/ec84f810-ec41-45a0-ad9e-3575324d26c4'

- path_regex: secrets\.production\.yaml$
kms: 'arn:aws:kms:eu-west-1:487483287434:key/ec84f810-ec41-45a0-ad9e-3575324d26c4'

- kms: 'arn:aws:kms:eu-west-1:487483287434:key/ec84f810-ec41-45a0-ad9e-3575324d26c4'
16 changes: 16 additions & 0 deletions deployment/secrets.staging.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
password: ENC[AES256_GCM,data:Xdi1H8Qe,iv:ZRkub93Rh2kulszzQFh54ogQCiPIqOUlZe/OW3eKLkE=,tag:0EMPwhZrSX39Nu4A85aQAg==,type:str]
sops:
kms:
- arn: arn:aws:kms:eu-west-1:487483287434:key/ec84f810-ec41-45a0-ad9e-3575324d26c4
created_at: "2021-05-12T22:04:38Z"
enc: AQICAHhngOGWGoxl7TkcaQOZ44amCOQCrm1j0kB2JqvANx5FcAGPDmVCWa/TsXwLDzycUr8FAAAAfjB8BgkqhkiG9w0BBwagbzBtAgEAMGgGCSqGSIb3DQEHATAeBglghkgBZQMEAS4wEQQMYMn8Cyx2GkngIo2vAgEQgDsryPTXf2KKrEoYRbJv+Vdm2weyONfiz1pYjxERZjOvkMnV2zJ7QWyJ90vqqDyh/4BEKo8x4MM+TADeXQ==
aws_profile: ""
gcp_kms: []
azure_kv: []
hc_vault: []
age: []
lastmodified: "2021-05-12T22:04:49Z"
mac: ENC[AES256_GCM,data:ecsZVQobyx5qsRQt/fjlRFu7z44NolNhV1ss7ISXe3sPpWLq3bjxlRb0JytrZVvdHJ4EKff9L8NoRg+BSV/k9f6qigrCE15CSfa3VyLDhWpM9gmFb4bTal/tR5F2cgrsgJYvoOw5wza3rJbomIRtAjOG6s5OcCP6LbFaPTkPAnI=,iv:XSFtinrl81RspcCNTxQRnNhROoBS5zlSCODdLA3wP/o=,tag:IYlPWNDzhOyYsE/i7jLxKw==,type:str]
pgp: []
unencrypted_suffix: _unencrypted
version: 3.7.1