Skip to content

Commit b8ccda7

Browse files
authored
Merge pull request #6 from brianhlin/SOFTWARE-5133.timestamp-tag-build-arg
Add timestamp tag build arg (SOFTWARE-5133)
2 parents 02257de + bbbb4e0 commit b8ccda7

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

action.yml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@ inputs:
2626
description: 'Name of image, including the organization (e.g. "opensciencegrid/image")'
2727
required: false
2828
default: ''
29+
timestamp_tag:
30+
description: >-
31+
Timestamped tag name (e.g.,
32+
"opensciencegrid/osgvo-docker-pilot3.6-release-YYYYMMDD-hhmm")
33+
used to pass the Dockerfile as $TIMESTAMP_TAG
34+
required: false
35+
default: ''
2936

3037
runs:
3138
using: "composite"
@@ -60,11 +67,17 @@ runs:
6067
REPO: ${{ inputs.repo }}
6168
OSG_SERIES: ${{ inputs.osg_series }}
6269
REGISTRY: ${{ inputs.registry_url}}
70+
TIMESTAMP_TAG: ${{ inputs.timestamp_tag }}
6371
shell: bash
6472
run: |
6573
docker_repo="$REGISTRY/${{ steps.generate-image-name.outputs.image }}"
6674
tag_list=()
67-
TIMESTAMP=$(date +%Y%m%d-%H%M)
75+
if [[ -n $TIMESTAMP_TAG ]]; then
76+
# grab the YYYYMMDD-hhmm timestamp
77+
TIMESTAMP=${TIMESTAMP_TAG: -13}
78+
else
79+
TIMESTAMP=$(date +%Y%m%d-%H%M)
80+
fi
6881
for image_tag in "$OSG_SERIES-$REPO" "$OSG_SERIES-$REPO-$TIMESTAMP"; do
6982
tag_list+=("$docker_repo":"$image_tag")
7083
if [[ $OSG_SERIES == '3.5' ]]; then
@@ -99,6 +112,7 @@ runs:
99112
build-args: |
100113
BASE_YUM_REPO=${{ inputs.repo }}
101114
BASE_OSG_SERIES=${{ inputs.osg_series }}
115+
TIMESTAMP_TAG=${{ inputs.timestamp_tag }}
102116
tags: "${{ steps.generate-tag-list.outputs.taglist }}"
103117
cache-from: type=local,src=/tmp/.buildx-cache
104118

0 commit comments

Comments
 (0)