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

Use text replacement to modify dockerfile once/day for windows #424

Merged
merged 2 commits into from
Apr 9, 2020

Conversation

brawner
Copy link
Contributor

@brawner brawner commented Apr 9, 2020

The previous approach of using a dockerfile ARG would not actually invalidate caches once-per-day as a --build-arg is apparently not part of the context.

This implements a solution similar to sed which is used with the linux dockerfile.

@brawner brawner self-assigned this Apr 9, 2020
@@ -84,7 +83,7 @@ RUN mkdir C:\ws
WORKDIR C:\ci

# Invalidate once a day to cause online installers to check for updates
RUN echo %TODAYS_DATE%
RUN echo "@todays_date"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Becomes:

RUN echo "Thursday, April 9, 2020"

@brawner brawner merged commit cf82112 into master Apr 9, 2020
@delete-merged-branch delete-merged-branch bot deleted the windows_invalidate_dockerfile branch April 9, 2020 18:20
@@ -357,10 +357,13 @@ echo "# BEGIN SECTION: Build DockerFile"
set CONTAINER_NAME=ros2_windows_ci_msvc%CI_VISUAL_STUDIO_VERSION%
set DOCKERFILE=windows_docker_resources\Dockerfile.msvc%CI_VISUAL_STUDIO_VERSION%

rem "Change dockerfile once per day to invalidate docker caches"
powershell "(Get-Content ${Env:DOCKERFILE}).replace('@todays_date', $(Get-Date).ToLongDateString()) | Set-Content ${Env:DOCKERFILE}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forgot that this would need to be escaped in order for empty to render the @-sign through: #426

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants