-
Notifications
You must be signed in to change notification settings - Fork 444
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
Sweep: add a /version endpoint to api.py that tells you which version of sweep we're running (✓ Sandbox Passed) #3156
base: main
Are you sure you want to change the base?
Sweep: add a /version endpoint to api.py that tells you which version of sweep we're running (✓ Sandbox Passed) #3156
Conversation
Rollback Files For Sweep
This is an automated message generated by Sweep AI. |
Apply Sweep Rules to your PR?
This is an automated message generated by Sweep AI. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Dockerfile
Outdated
@@ -61,6 +61,9 @@ COPY tests /app/tests | |||
ENV PYTHONPATH=. | |||
COPY bin/startup.sh /app/startup.sh | |||
COPY redis.conf /app/redis.conf | |||
|
|||
# Set the SWEEP_VERSION environment variable to the current date and time during image build | |||
ENV SWEEP_VERSION=$(date +%Y%m%d%H%M) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
buildx failed with: ERROR: failed to solve: Syntax error - can't find = in "+%Y%m%d%H%M)". Must be of the form: name=value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dockerfile
Outdated
|
||
# Set the SWEEP_VERSION environment variable to the current date and time during image build | ||
ARG SWEEP_VERSION | ||
ENV SWEEP_VERSION=${SWEEP_VERSION:-$(date +%Y%m%d%H%M)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 2.03kB done
#1 DONE 0.0s
Dockerfile:67
65 | # Set the SWEEP_VERSION environment variable to the current date and time during image build
66 | ARG SWEEP_VERSION
67 | >>> ENV SWEEP_VERSION=${SWEEP_VERSION:-$(date +%Y%m%d%H%M)}
68 | RUN chmod u+x /app/startup.sh
69 |
ERROR: failed to solve: Syntax error - can't find = in "+%Y%m%d%H%M)}". Must be of the form: name=value
Error: buildx failed with: ERROR: failed to solve: Syntax error - can't find = in "+%Y%m%d%H%M)}". Must be of the form: name=value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dockerfile
Outdated
|
||
# Set the SWEEP_VERSION environment variable to the current date and time during image build | ||
ARG SWEEP_VERSION | ||
ENV SWEEP_VERSION=${SWEEP_VERSION:-"$(date +%Y%m%d%H%M)"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to run this before saving it to an envvar otherwise it's treated as a literal
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dockerfile
Outdated
|
||
# Set the SWEEP_VERSION environment variable to the current date and time during image build | ||
ARG SWEEP_VERSION | ||
RUN export SWEEP_VERSION=${SWEEP_VERSION:-$(date +%Y%m%d%H%M)} && echo "SWEEP_VERSION=$SWEEP_VERSION" >> /etc/environment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs to be written to .env
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description
This pull request adds a /version endpoint to api.py that returns the current version of Sweep.
Summary
Dockerfile
to set the SWEEP_VERSION environment variable to the current date and time during image build/version
toapi.py
that returns the current version of Sweepversion.py
to handle getting the version from the environment variableFixes #3151.
🎉 Latest improvements to Sweep:
💡 To get Sweep to edit this pull request, you can: