This repository has been archived by the owner on Apr 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TER-232: First version of a Dockerized build and test environment + f…
…ixing dependencies imports and code to allow working build (empty right now)
- Loading branch information
Showing
9 changed files
with
55 additions
and
21 deletions.
There are no files selected for viewing
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/terraform-* |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,3 +60,17 @@ resource "ghost_app" "wordpress" { | |
} | ||
} | ||
``` | ||
|
||
# Building and testing in a Dockerized environment # | ||
|
||
The dockerized environment can be invoked through docker-compose. It mounts an external volume named _root_user_ in which you can personalize the root session. | ||
|
||
Hint: in the _root_user_ volume, you can import your personal SSH keys and add a .gitconfig file with a content like this: | ||
``` | ||
[url "[email protected]:"] | ||
insteadOf = https://bitbucket.org/ | ||
``` | ||
To allow go to load git dependencies from private repositories using your SSH key. | ||
|
||
To use the environment, just run the command: | ||
`docker-compose run --rm [test|build]-env` in the root directory of this project. |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
go get . | ||
go build -o "${PWD##*/}" |
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
version: '2' | ||
|
||
services: | ||
build-env: | ||
image: golang | ||
volumes: | ||
- ./:/go/src/terraform-provider-ghost | ||
- root_user:/root | ||
working_dir: /go/src/terraform-provider-ghost | ||
entrypoint: ./build.sh | ||
|
||
test-env: | ||
image: golang | ||
volumes: | ||
- ./:/go/src/terraform-provider-ghost | ||
- root_user:/root | ||
working_dir: /go/src/terraform-provider-ghost | ||
entrypoint: ./test.sh | ||
|
||
volumes: | ||
root_user: | ||
external: true |
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
package ghost | ||
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
go get . | ||
go test |