Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions .terraform/plugin_path
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
"/usr/local/lib/custom-terraform-plugins"
]
22 changes: 15 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,30 @@ tf-bucket:
echo Create terraform state bucket \"$(BUCKET_NAME)\"...; \
aws s3api create-bucket --bucket $(BUCKET_NAME) --acl private --region eu-central-1 --create-bucket-configuration LocationConstraint=eu-central-1 &&\
aws s3api put-bucket-versioning --bucket $(BUCKET_NAME) --versioning-configuration Status=Enabled &&\
aws s3api put-public-access-block --bucket $(BUCKET_NAME) --public-access-block-configuration BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true; \
aws s3api put-public-access-block --bucket $(BUCKET_NAME) --public-access-block-configuration BlockPublicAcls=true,IgnorePublicAcls=true,BlockPublicPolicy=true,RestrictPublicBuckets=true &&\
echo Creating and uploading initial terraform state file...; \
cd ./terraform &&\
terraform init &&\
terraform state push "./.terraform/terraform.tfstate";\
echo Initial terraform state file uploaded successfully.; \
fi

tf-init: tf-bucket
cd ./terraform && \
terraform init -input=false -plugin-dir=/usr/local/lib/custom-terraform-plugins
terraform init
terraform providers mirror /usr/local/lib/custom-terraform-plugins && \
terraform init -plugin-dir=/usr/local/lib/custom-terraform-plugins -input=false

plan: tf-init build-lambda asset_hash
$(eval PLAN=$(shell mktemp))

cd ./terraform && \
terraform plan -input=false \
-var 'signature_secret="$(SIGNATURE_SECRET)"' \
-var 'build_version="$(BUILD_VERSION)"' \
-var 'appname="$(APP_NAME)"' \
-var 'domainsuffix="$(DOMAIN_SUFFIX)"' \
-var 'asset_hash="$(ASSET_HASH)"' \
-var 'signature_secret=$(SIGNATURE_SECRET)' \
-var 'build_version=$(BUILD_VERSION)' \
-var 'appname=$(APP_NAME)' \
-var 'domainsuffix=$(DOMAIN_SUFFIX)' \
-var 'asset_hash=$(ASSET_HASH)' \
-out=$(PLAN)

apply: plan
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,4 +294,3 @@ Thanks to the following projects for inspiration
* [Starting an Open Source Project](https://opensource.guide/starting-a-project/)
* [README template](https://gist.github.com/PurpleBooth/109311bb0361f32d87a2)
* [CONTRIBUTING template](https://github.com/nayafia/contributing-template/blob/master/CONTRIBUTING-template.md)

19 changes: 10 additions & 9 deletions buildcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ RUN apt-get update && \
# go
ENV GOPATH /go
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
ENV GOLANG_VERSION 1.13.4
ENV GOLANG_CHECKSUM 692d17071736f74be04a72a06dab9cac1cd759377bd85316e52b2227604c004c
ENV GOLANG_VERSION 1.18.3
ENV GOLANG_CHECKSUM 956f8507b302ab0bb747613695cdae10af99bbd39a90cae522b7c0302cc27245
RUN curl -fsSL https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linux-amd64.tar.gz -o golang.tar.gz && \
echo "${GOLANG_CHECKSUM} golang.tar.gz" | sha256sum -c - && \
tar -C /usr/local -xzf golang.tar.gz && \
Expand All @@ -19,11 +19,11 @@ RUN curl -fsSL https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linux-a
GOOS=windows GOARCH=amd64 go install -v std

# go-junit-report https://github.com/jstemmer/go-junit-report
RUN go get -u github.com/jstemmer/go-junit-report
RUN go install github.com/jstemmer/go-junit-report@latest

# terraform
ENV TERRAFORM_VERSION 0.11.13
ENV TERRAFORM_CHECKSUM 5925cd4d81e7d8f42a0054df2aafd66e2ab7408dbed2bd748f0022cfe592f8d2
ENV TERRAFORM_VERSION 1.2.3
ENV TERRAFORM_CHECKSUM 728b6fbcb288ad1b7b6590585410a98d3b7e05efe4601ef776c37e15e9a83a96
RUN curl -fsSL https://releases.hashicorp.com/terraform/${TERRAFORM_VERSION}/terraform_${TERRAFORM_VERSION}_linux_amd64.zip -o terraform.zip && \
echo "${TERRAFORM_CHECKSUM} terraform.zip" | sha256sum -c - && \
unzip terraform.zip -d /usr/local/bin && chmod +x /usr/local/bin/terraform ; rm terraform.zip
Expand All @@ -43,15 +43,15 @@ RUN curl -fsSL https://releases.hashicorp.com/terraform-provider-template/${TERR
unzip terraform_template_plugin.zip -d /usr/local/lib/custom-terraform-plugins ; rm terraform_template_plugin.zip

# terraform null provider plugin
ENV TERRAFORM_NULL_PLUGIN_VERSION 2.1.1
ENV TERRAFORM_NULL_PLUGIN_CHECKSUM 5b29f6a87f4dae4dc295a43f499182221333dbe474fcf724b8ea98fd38cfb3e6
ENV TERRAFORM_NULL_PLUGIN_VERSION 3.1.1
ENV TERRAFORM_NULL_PLUGIN_CHECKSUM 976bbaf268cb497400fd5b3c774d218f3933271864345f18deebe4dcbfcd6afa
RUN curl -fsSL https://releases.hashicorp.com/terraform-provider-null/${TERRAFORM_NULL_PLUGIN_VERSION}/terraform-provider-null_${TERRAFORM_NULL_PLUGIN_VERSION}_linux_amd64.zip -o terraform_null_plugin.zip && \
echo "${TERRAFORM_NULL_PLUGIN_CHECKSUM} terraform_null_plugin.zip" | sha256sum -c - && \
unzip terraform_null_plugin.zip -d /usr/local/lib/custom-terraform-plugins ; rm terraform_null_plugin.zip

# terraform aws provider plugin
ENV TERRAFORM_AWS_PLUGIN_VERSION 2.23.0
ENV TERRAFORM_AWS_PLUGIN_CHECKSUM 8076270dfd8d31edc8aa7092f68d3d97c03104b8e47f8e2399d8688b43476d5e
ENV TERRAFORM_AWS_PLUGIN_VERSION 4.19.0
ENV TERRAFORM_AWS_PLUGIN_CHECKSUM 9bb3919bd6d94fb22025540f0c1db5eceec8927bd71b8fbdcd295609c999065f
RUN curl -fsSL https://releases.hashicorp.com/terraform-provider-aws/${TERRAFORM_AWS_PLUGIN_VERSION}/terraform-provider-aws_${TERRAFORM_AWS_PLUGIN_VERSION}_linux_amd64.zip -o terraform_aws_plugin.zip && \
echo "${TERRAFORM_AWS_PLUGIN_CHECKSUM} terraform_aws_plugin.zip" | sha256sum -c - && \
unzip terraform_aws_plugin.zip -d /usr/local/lib/custom-terraform-plugins ; rm terraform_aws_plugin.zip
Expand All @@ -63,4 +63,5 @@ RUN curl https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip -o awscliv2.zi
rm awscliv2.zip && rm -rf ./aws

WORKDIR /build

ENTRYPOINT [ "/usr/bin/make" ]
3 changes: 2 additions & 1 deletion domain/plugins/conf/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ package conf
import (
"context"
"encoding/base64"
"github.com/d-velop/dvelop-sdk-go/log"
"os"

"github.com/d-velop/dvelop-sdk-go/log"
)

const AppName = "acme-apptemplatego"
Expand Down
2 changes: 1 addition & 1 deletion domain/plugins/gui/templates/templatefs_generate.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// +build ignore
//go:build exclude

// Command to generate an in memory version of the Templatefilesystem
// cf. https://github.com/shurcooL/vfsgen
Expand Down
27 changes: 17 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
module github.com/d-velop/dvelop-app-template-go

require (
github.com/d-velop/dvelop-sdk-go/contentnegotiation v0.0.0-20191113150508-0c1d447d5696
github.com/d-velop/dvelop-sdk-go/idp v0.0.0-20191113150508-0c1d447d5696
github.com/d-velop/dvelop-sdk-go/log v0.0.0-20191113150508-0c1d447d5696
github.com/d-velop/dvelop-sdk-go/requestid v0.0.0-20191113150508-0c1d447d5696
github.com/d-velop/dvelop-sdk-go/requestlog v0.0.0-20191113150508-0c1d447d5696
github.com/d-velop/dvelop-sdk-go/tenant v0.0.0-20191113150508-0c1d447d5696
github.com/justinas/alice v0.0.0-20171023064455-03f45bd4b7da
github.com/d-velop/dvelop-sdk-go/contentnegotiation v0.0.0-20220420084038-aa8114534460
github.com/d-velop/dvelop-sdk-go/idp v0.0.0-20220420084038-aa8114534460
github.com/d-velop/dvelop-sdk-go/lambda v0.0.0-20220420084038-aa8114534460
github.com/d-velop/dvelop-sdk-go/log v0.0.0-20220420084038-aa8114534460
github.com/d-velop/dvelop-sdk-go/requestid v0.0.0-20220420084038-aa8114534460
github.com/d-velop/dvelop-sdk-go/requestlog v0.0.0-20220420084038-aa8114534460
github.com/d-velop/dvelop-sdk-go/tenant v0.0.0-20220420084038-aa8114534460
github.com/justinas/alice v1.2.0
github.com/satori/go.uuid v1.2.1-0.20181028125025-b2ce2384e17b
github.com/shurcooL/httpfs v0.0.0-20171119174359-809beceb2371
github.com/shurcooL/vfsgen v0.0.0-20181020040650-a97a25d856ca // indirect
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749
github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546
)

go 1.13
require (
github.com/aws/aws-lambda-go v1.33.0 // indirect
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
golang.org/x/tools v0.1.11 // indirect
)

go 1.18
Loading