Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

export build start date variables #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Version 3.1.2

Docker Image: quay.io/lifechurch/k8s-deploy-helper:3.1.2

## New Features

* BUILD - Added build start date variables

# Version 3.1.1

Docker Image: quay.io/lifechurch/k8s-deploy-helper:3.1.1
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,12 @@ Variables you can set to control your worker stages are listed below, along with
${1}_SCALE_CPU : 60%
```

### Build Start Dates

* BUILD_START_DATE - yyyy/mm/dd eg. 2018/12/28
* BUILD_START_YEAR - yyyy eg. 2018
* BUILD_START_MONTH - month (01..12)
* BUILD_START_DAY - day of month (e.g., 01)

# Contributing

Expand Down
5 changes: 5 additions & 0 deletions src/common.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ set -eo pipefail
export CI_CONTAINER_NAME="ci_job_build_$CI_JOB_ID"
export CI_REGISTRY_TAG="$CI_COMMIT_SHA"

export BUILD_START_DATE=$(date +%Y/%m/%d)
export BUILD_START_YEAR=$(date +%Y)
export BUILD_START_MONTH=$(date +%m)
export BUILD_START_DAY=$(date +%d)

if [[ "$CI_JOB_STAGE" == "review" ]]; then
export STAGE="$CI_ENVIRONMENT_SLUG"
else
Expand Down