From 87e93609a5535755fb40e05996ff997657aac6d2 Mon Sep 17 00:00:00 2001 From: Alexandre Garand Date: Fri, 5 Jul 2019 12:15:04 +0200 Subject: add automatic push of github pages add target in the makefile and the script used by it to get the website update .travis.yml to push the website on ghpages branch --- .travis.yml | 13 +++++++++++-- GNUmakefile | 2 ++ scripts/launch-website.sh | 11 +++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) create mode 100755 scripts/launch-website.sh diff --git a/.travis.yml b/.travis.yml index a20fc58..cc6e6c7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,18 @@ script: - make vet - make website-test - make shellcheck +- make website-githubpages +deploy: + provider: pages + skip_cleanup: true + github_token: $GITHUB_TOKEN + target_branch: gh-pages + keep_history: true + local_dir: terraform-provider-website + on: + all_branches: true + matrix: fast_finish: true allow_failures: @@ -33,5 +44,3 @@ cache: env: matrix: - GO111MODULE=on - global: - - secure: rWjnWJgGEk2ncl6TXnpahUmriGSEaHGy+ZfmKKGpvrZxnlNY6sy63+qrnJNwaiV6uRG+kPfEChYD+dYfhjZRb3JWivo/ILCM9E0M9Ike6YAAsJKrcl0rUwFgqhBVXRdpBCSieYGiY8xNH/4Wu6i4bD9F1vSmpkvxYwae+7vGvyhEhyGMqWU92Svlus//K0Y27Qvlcw+Mx35nhdZsaeKN1Tb7uCHed9+vpCHud9NpSJLqxBjQl+1ibJ0Fqefyqbqy5dO0X3xE70eUMwM70ew+sgwzyq45VDBRPtVAN+8mtLOp2BVZE7SXFydfqnAm+1cbgzYBE5t+HlXwZzpRrtSwj+NRUt+7UtlrdfhMRmUVW76qWyMbF8CY6i06a73XWMYffKg3Ux2h0AHimvPJl8y+luMYmrl0RdgyLDcR0t9La0PNhOrKsauzkNX7KGPZwjTWv3+2RrsXDdT0Pi3JL15myyEuxiSAdDLIyiFB0sz9mCzYiu02SKKyURfo3bhMUrrBRbF47CpLTiCJrNBI36rk/cO4QJXyd9axEhy7vXiQObvaWZKbBqMTsL9EOZijJt5I1UxjwbCGM/GyYSrDK/+7d7PF0bvjo+8ps/o2WIW5B63IZiadzIt6nUOlEpFoOUsn0x4mufzIzMd+CSXdTxdXqRIXHxf5pKAUQZ8u7uRwERY= diff --git a/GNUmakefile b/GNUmakefile index 7750632..fe6e28c 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -46,6 +46,8 @@ test-compile: fi go test -c $(TEST) $(TESTARGS) +website-githubpages: + bash scripts/launch-website.sh website: ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO))) echo "$(WEBSITE_REPO) not found in your GOPATH (necessary for layouts and assets), get-ting..." diff --git a/scripts/launch-website.sh b/scripts/launch-website.sh new file mode 100755 index 0000000..f146e75 --- /dev/null +++ b/scripts/launch-website.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +(sleep 10; +wget --recursive --no-parent --domains localhost --page-requisites --html-extension --convert-links --no-clobber http://localhost:4567/docs/providers/mailgun/; + +rm -rf terraform-provider-website; +mv localhost:4567/ terraform-provider-website; + +docker stop "$(docker ps -q)") & + +make website -- cgit v1.2.3 From 6347cbbdc731236eeaccd772fd952dbf62862220 Mon Sep 17 00:00:00 2001 From: Paul Bonaud Date: Mon, 8 Jul 2019 11:16:10 +0200 Subject: ci: re-generate github token from tech@fretlink.com service account --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index cc6e6c7..c43c63a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,7 +24,7 @@ script: deploy: provider: pages skip_cleanup: true - github_token: $GITHUB_TOKEN + github_token: "$GITHUB_TOKEN" target_branch: gh-pages keep_history: true local_dir: terraform-provider-website @@ -44,3 +44,5 @@ cache: env: matrix: - GO111MODULE=on + global: + secure: 2ophiVBTzEGwgWWeUBxeddU9QL+llyDNS1rT1fzKg4jwWOJumzd2bQL00UoYabpDTUUEASFJwJKxoBKCRKiOYHQl5RiH8f3K5ZftSnqR8MDT8NABL9pEPq6+M+kADs2hMMDGvV9qWNnwapcon7s09NiqLlZG88dRcW2kHeDlLBfSCZq9ghH/30XstYxD0zY2BGvFCBngKsnvMPZjGYUxTTX6IVuzgyv0BEN43dzY3gCY9tbsCUwAXaHxR1+/rE1Lq1I9H9RtsjUjrhqKAJ3DlaoIezUQqbmKoo3TkIC4YhF1Z0n+m5BmYaoGD5YHZJl8Susj0PGtQtbfRIUksIOhDPnNXzeycojwku7ErvahFT2rZ3SGkYuQpeN0+tqmPRTuZPHSxqw0XETUC3vu5AfpVIzAIa5hT2C9tBUHcNJYHeJb0teJ4mmY1J6rkh1l40bW2bE+tS9V9dvsVmfs6JthQBRo/zPDQqEUXHvb9FD6m1KbuxlZGDnnst0YFsrBDRu0bRJdXBLFnBo6oyAkrk2XzGzNas8NzCKuAIcxT/J7D9vyKiKTs+Fy3dRUohBiZqkZ5u8kQ0ncGqeIUnvMuc6GJBkNMaPhX2XjdQi9QUN2dCHimb1D5ox/7XwOYqc7nW3kbQxfRs/Us1ftrFvhpm/HKeD7QriUCkxwGdrrhfMTRdM= -- cgit v1.2.3 From 1e4cb933c500f8135161e3d7fabeb0acf93bec12 Mon Sep 17 00:00:00 2001 From: Alexandre Garand Date: Mon, 8 Jul 2019 11:30:44 +0200 Subject: add index.html to ghpages created index.html update the script to add it in the website directory --- GNUmakefile | 2 +- index.html | 1 + scripts/launch-website.sh | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 index.html diff --git a/GNUmakefile b/GNUmakefile index fe6e28c..e31a939 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -62,5 +62,5 @@ ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO))) endif @$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider-test PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME) -.PHONY: build test testacc vet fmt fmtcheck errcheck test-compile website website-test +.PHONY: build test testacc vet fmt fmtcheck errcheck test-compile website website-test website-githubpages diff --git a/index.html b/index.html new file mode 100644 index 0000000..550c3e9 --- /dev/null +++ b/index.html @@ -0,0 +1 @@ + diff --git a/scripts/launch-website.sh b/scripts/launch-website.sh index f146e75..a636565 100755 --- a/scripts/launch-website.sh +++ b/scripts/launch-website.sh @@ -5,6 +5,7 @@ wget --recursive --no-parent --domains localhost --page-requisites --html-extens rm -rf terraform-provider-website; mv localhost:4567/ terraform-provider-website; +mv index.html terraform-provider-website/index.html docker stop "$(docker ps -q)") & -- cgit v1.2.3 From fc1c929695342e03fa7f3261114137328365005d Mon Sep 17 00:00:00 2001 From: Alexandre Garand Date: Mon, 8 Jul 2019 11:52:51 +0200 Subject: update Readme --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 1bd1668..e0ad112 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,10 @@ Terraform Provider Mailgun +Website for the doc +--------------------- +https://fretlink.github.io/terraform-provider-mailgun/docs/providers/mailgun/index.html + Requirements ------------ -- cgit v1.2.3 From 7cbb92efb5e84de877976830ee04798c1cc808b8 Mon Sep 17 00:00:00 2001 From: Alexandre Garand Date: Mon, 8 Jul 2019 15:46:38 +0200 Subject: add newline and commentary for clarity --- GNUmakefile | 1 + scripts/launch-website.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/GNUmakefile b/GNUmakefile index e31a939..c88972d 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -48,6 +48,7 @@ test-compile: website-githubpages: bash scripts/launch-website.sh + website: ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO))) echo "$(WEBSITE_REPO) not found in your GOPATH (necessary for layouts and assets), get-ting..." diff --git a/scripts/launch-website.sh b/scripts/launch-website.sh index a636565..ec9e92c 100755 --- a/scripts/launch-website.sh +++ b/scripts/launch-website.sh @@ -1,5 +1,6 @@ #!/usr/bin/env bash +#the sleep and the subquery & are here to ensure that wget is called after make website have done its work so that the website is gotten correctly (sleep 10; wget --recursive --no-parent --domains localhost --page-requisites --html-extension --convert-links --no-clobber http://localhost:4567/docs/providers/mailgun/; -- cgit v1.2.3 From 326af631a8ff605fd340704cf613778323320c96 Mon Sep 17 00:00:00 2001 From: alexandreFre <51956137+alexandreFre@users.noreply.github.com> Date: Mon, 8 Jul 2019 16:20:48 +0200 Subject: fix comment Co-Authored-By: paulrbr-fl <43074087+paulrbr-fl@users.noreply.github.com> --- scripts/launch-website.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/launch-website.sh b/scripts/launch-website.sh index ec9e92c..dda894d 100755 --- a/scripts/launch-website.sh +++ b/scripts/launch-website.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -#the sleep and the subquery & are here to ensure that wget is called after make website have done its work so that the website is gotten correctly +# sleep and the sub-command are there to make sure wget is called *after* `make website` has started. This ensures the website to be fetched correctly. (sleep 10; wget --recursive --no-parent --domains localhost --page-requisites --html-extension --convert-links --no-clobber http://localhost:4567/docs/providers/mailgun/; -- cgit v1.2.3 From 553ab86c68fc857262ffe9fe23e6679864ba7c16 Mon Sep 17 00:00:00 2001 From: Alexandre Garand Date: Mon, 8 Jul 2019 17:03:33 +0200 Subject: travis deploy only on master --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c43c63a..f6ca131 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,7 +29,7 @@ deploy: keep_history: true local_dir: terraform-provider-website on: - all_branches: true + branch: master matrix: fast_finish: true -- cgit v1.2.3