From 9857b9645eb07f0c8ce8893438a041e70d262b4d Mon Sep 17 00:00:00 2001 From: shockrah Date: Tue, 14 Mar 2023 20:37:13 -0700 Subject: [PATCH] Deploy script fixed for resume files --- .gitlab-ci.yml | 27 +++++++++++++++++++++++++++ verify-aws-fields.sh | 16 ++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 verify-aws-fields.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 52877b1..3224db0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -19,3 +19,30 @@ pages: artifacts: paths: - public + + +build-resume.shockrah.xyz: + stage: build + only: + refs: + - master + script: + - hugo + artifacts: + paths: + - public + +deploy-resume.shockrah.xyz: + stage: deploy + image: + name: amazon/aws-cli:2.2..25 + entrypoint: [""] + only: + refs: + - master + needs: + - build-resume.shockrah.xyz + before_script: + - bash scripts/verify-aws-fields.sh + scripts: + - aws s3 cp public/ s3://resume.shockrah.xyz --recursive diff --git a/verify-aws-fields.sh b/verify-aws-fields.sh new file mode 100644 index 0000000..364eef8 --- /dev/null +++ b/verify-aws-fields.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +echo "Checking to make sure all required AWS env vars are present" + +[[ $AWS_DEFAULT_REGION != '' ]] +echo AWS_DEFAULT_REGION is set + +[[ $AWS_DEFAULT_REGION != '' ]] +echo AWS_ACCESS_KEY_ID is set + +[[ $AWS_DEFAULT_REGION != '' ]] +echo AWS_SECRET_ACCESS_KEY is set + +