Commit f6e0bda0 authored by kawsark's avatar kawsark

Updated readme to reference hashitalk repo and updated Dockerfile

parent 14b36d56
Pipeline #146438622 failed with stages
# Terraform Cloud API driven Run from GitLab CI/CD
**Note**: this repo uses a pre-created Vault Token to Authenticate GitLab Runners to HashiCorp Vault. For GitLab Runners to Authenticate themselves to Vault using an Authentication method, please see the following repository: [hashitalk-terraform-cloud-and-gitlab-demo](https://gitlab.com/gitlab-com/alliances/hashicorp/sandbox-projects/hashitalk-terraform-cloud-and-gitlab-demo).
This repo uses GitLab CI/CD and Terraform Cloud API driven Run to deploy a compute instance in Google Cloud Platform. A Run is created in Terraform Cloud (TFC) from GitLab CI/CD.
- For the CLI Driven Run example please see the [gl-terraform-gcp-compute-test](https://gitlab.com/kawsark/gl-terraform-gcp-compute-test) repo.
......@@ -22,15 +24,15 @@ This repo has two Walk through guides:
Please clone this repo to your GitLab account
### Create a GitLab Runner Docker image (Optional)
The Docker image used for the GitLab Runner in this demo has already made public in Dockerhub as [gitlab-ruby-curl](https://cloud.docker.com/repository/docker/kawsark/gitlab-ruby-curl). This container image is capable of performing an API driven run using `curl` and `jq`.
The Docker image used for the GitLab Runner in this demo has already made public in Dockerhub as [kawsark/gitlab-terraforml](https://cloud.docker.com/repository/docker/kawsark/gitlab-terraform). This container image is capable of performing an API driven run using `curl` and `jq`. It also contains an `amd64` Vault binary which is used as a CLI to interact with Vault. Note: this image does **not** contain the terraform binary.
You can optionally customize a GitLab Runner image using included example [Dockerfile](scripts/Dockerfile). Below are the steps to create a custom image and upload to a container registry.
```
cd scripts
# Customize Dockerfile as needed
docker build -t <your_docker_username>/gitlab-ruby-curl:0.0.1 .
docker build -t <your_docker_username>/gitlab-terraform:0.0.2 .
docker login
docker push <your_docker_username>/gitlab-ruby-curl:0.0.1
docker push <your_docker_username>/gitlab-terraform:0.0.2
```
### Register the GitLab Runner
......@@ -168,4 +170,4 @@ cd scripts
Please visit the Run URL provided by the script to ensure the destroy was completed.
## Testing terraform configuration locally
Please see [local.md](local.md) to test this terraform configuration locally without using TFC or GitLab.
\ No newline at end of file
Please see [local.md](local.md) to test this terraform configuration locally without using TFC or GitLab.
FROM ruby:2.1
# See: https://superuser.com/questions/1423486/issue-with-fetching-http-deb-debian-org-debian-dists-jessie-updates-inrelease
RUN printf "deb http://archive.debian.org/debian/ jessie main\ndeb-src http://archive.debian.org/debian/ jessie main\ndeb http://security.debian.org jessie/updates main\ndeb-src http://security.debian.org jessie/updates main" > /etc/apt/sources.list
RUN apt-get update && apt-get install -y curl jq
\ No newline at end of file
RUN apt-get update -y
RUN apt-get install -y curl jq
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment