Skip to content
This repository has been archived by the owner on Jul 12, 2022. It is now read-only.

Commit

Permalink
AWS APPLY TERRAFORM Docker implementation (#280)
Browse files Browse the repository at this point in the history
* Changes in the repository URL input

Signed-off-by: eduardorcury <eduardoribeirocury@gmail.com>

* Update README.md

Signed-off-by: eduardorcury <eduardoribeirocury@gmail.com>

* Change on label for repository input

Signed-off-by: eduardorcury <eduardoribeirocury@gmail.com>

* Correcting premisses of README.md

Signed-off-by: eduardorcury <eduardoribeirocury@gmail.com>

* Creating Dockerfile

Signed-off-by: eduardorcury <eduardoribeirocury@gmail.com>

* Adding Docker implementation to Makefile/metadata.json

Signed-off-by: eduardorcury <eduardoribeirocury@gmail.com>

* Update README.md

Signed-off-by: eduardorcury <eduardoribeirocury@gmail.com>
  • Loading branch information
eduardorcury authored Oct 16, 2020
1 parent 46272c7 commit 31434c5
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 5 deletions.
16 changes: 16 additions & 0 deletions aws/apply/terraform/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM alpine:3.12
USER root

RUN wget https://releases.hashicorp.com/terraform/0.13.4/terraform_0.13.4_linux_amd64.zip
RUN unzip terraform_0.13.4_linux_amd64.zip
RUN mv terraform /usr/local/bin/

RUN mkdir /rit
COPY . /rit
RUN sed -i 's/\r//g' /rit/set_umask.sh
RUN sed -i 's/\r//g' /rit/run.sh
RUN chmod +x /rit/set_umask.sh

WORKDIR /app
ENTRYPOINT ["/rit/set_umask.sh"]
CMD ["/rit/run.sh"]
5 changes: 4 additions & 1 deletion aws/apply/terraform/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ BIN_FOLDER_WINDOWS=../$(BIN_FOLDER)/windows
BIN_WINDOWS=$(BIN_FOLDER_WINDOWS)/$(BIN_NAME).exe


build: go-build sh-unix bat-windows
build: go-build sh-unix bat-windows docker

go-build:
cd src; mkdir -p $(BIN_FOLDER_DARWIN) $(BIN_FOLDER_LINUX) $(BIN_FOLDER_WINDOWS)
Expand All @@ -40,5 +40,8 @@ bat-windows:
echo 'SET mypath=%~dp0' >> $(BAT)
echo 'start /B /WAIT %mypath:~0,-1%/windows/main.exe' >> $(BAT)

docker:
cp Dockerfile set_umask.sh $(BIN_FOLDER)

test:
$(GOTEST) -short `go list ./... | grep -v vendor/`
5 changes: 2 additions & 3 deletions aws/apply/terraform/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

## Premisses

- [Terraform installed](https://www.terraform.io/downloads.html)
- Set Github credentials
- Set AWS credentials

Expand All @@ -16,7 +15,7 @@ You can set credentials by running *rit set credential* and providing USERNAME,
rit aws apply terraform
```

*It is necessary to have [Golang installed](https://golang.org/doc/install) for this command to work*
*It is necessary to have [Golang](https://golang.org/doc/install) and [Terraform](https://www.terraform.io/downloads.html) installed for this command to work*

- Docker

Expand All @@ -34,7 +33,7 @@ rit aws apply terraform --docker
echo '{"repository":"https://github.com/eduardorcury/ritchie-demo", "terraform_path":"/terraform", "environment":"dev"}' | rit aws apply terraform --stdin
```

*It is necessary to have [Golang installed](https://golang.org/doc/install) for this command to work*
*It is necessary to have [Golang](https://golang.org/doc/install) and [Terraform](https://www.terraform.io/downloads.html) installed for this command to work*

- Stdin + Docker

Expand Down
3 changes: 2 additions & 1 deletion aws/apply/terraform/metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"execution": [
"local"
"local",
"docker"
],
"os": {
"deps": [],
Expand Down

0 comments on commit 31434c5

Please sign in to comment.