From b4eec033917a73188e41f0d0170752b5430c02c0 Mon Sep 17 00:00:00 2001 From: shockrah Date: Mon, 19 Feb 2024 18:22:08 -0800 Subject: [PATCH] Blue green deployments and a better way of getting real files links into hugo --- .gitlab-ci.yml | 21 ++++++++++++++++ .../themes/temper/layouts/_default/list.html | 25 ++++++------------- 2 files changed, 29 insertions(+), 17 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index ed77e45..2c4c248 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,6 +3,7 @@ image: shockrah/website:latest stages: - build - deploy + - golive ############## ################## ############## @@ -44,3 +45,23 @@ deploy-to-s3: # Upload the content to the bucket itself - cd main-site/ && aws s3 cp public s3://temper.tv/ --recursive + + +############## ################## ############## +############## Refresh Container ############## +############## ################## ############## + +blue-green-deployment-nginx: + stage: golive + image: + name: amazon/aws-cli:2.2.25 + entrypoint: [""] + needs: + - deploy-to-s3 + vars: + service: athens-nginx-static-content + cluster: athens-alpha-cluster + before_script: + - bash ci/verify-aws-fields.sh + script: + - aws ecs update-service --cluster $cluster --service $service --force-new-deployment diff --git a/main-site/themes/temper/layouts/_default/list.html b/main-site/themes/temper/layouts/_default/list.html index ee456ef..041e4b4 100644 --- a/main-site/themes/temper/layouts/_default/list.html +++ b/main-site/themes/temper/layouts/_default/list.html @@ -12,31 +12,22 @@ {{ end }} {{ end }}

{{ .Content }}

+ {{ $colors := slice "cyan" "yellow" "pink"}} {{ if hasPrefix $path "files" }} - {{ $colors := slice "cyan" "yellow" "pink"}} - {{ $opts := len $colors }} - {{ range $i, $top := readDir "content/files/" }} - - {{ if eq $top.IsDir false }} {{ continue }} {{ end }} - - -
-
{{ $top.Name }}
- - {{ range $file := print "content/files/" $top.Name | readDir }} + {{ range $folder, $files := .Params.folders }} + {{ $opt := mod (len $folder) (len $colors) }} +
+
{{ $folder }}
+ {{ range $file := $files }} {{ end }}
{{ end }} {{ end }} - {{ $colors := slice "cyan" "yellow" "pink"}} - {{ $opts := len $colors }} {{ range $i, $page := .Pages.ByDate.Reverse }} - {{ $opt := mod $i $opts }} + {{ $opt := mod $i (len $colors) }}