Commit e8258211 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Necessary infrastructure changes for offline upload in production.

parent ab71919f
Pipeline #37276 failed with stages
in 1 minute and 54 seconds
......@@ -62,7 +62,9 @@ COPY --from=build /install/.dependencies/nomad-meta-info /app/.dependencies/noma
COPY --from=build /install/docs/.build /app/docs/.build
RUN useradd -ms /bin/bash nomad
RUN mkdir -p /app/.volumes/fs
RUN chown -R nomad /app
USER nomad
RUN mkdir -p /app/.volumes/fs
RUN mkdir -p /nomad
VOLUME /app/.volumes/fs
VOLUME /nomad
......@@ -42,10 +42,14 @@ services:
api:
links:
- elk
volumes:
- /nomad:/nomad
worker:
links:
- elk
volumes:
- /nomad:/nomad
proxy:
ports:
......
......@@ -41,6 +41,11 @@ auth = HTTPBasicAuth()
api = Api(app)
@app.before_first_request
def setup():
infrastructure.setup()
@auth.verify_password
def verify_password(username_or_token, password):
# first try to authenticate by token
......@@ -749,5 +754,4 @@ api.add_resource(RepoCalcRes, '%s/repo/<string:upload_hash>/<string:calc_hash>'
if __name__ == '__main__':
infrastructure.setup()
app.run(debug=True, port=8000)
......@@ -66,7 +66,7 @@ def upload_file(file_path, name=None, offline=False):
if not offline:
upload_cmd = upload['upload_command']
upload_cmd = upload_cmd.replace('your_file', file_path)
upload_cmd = upload_cmd.replace('local_file', file_path)
subprocess.call(shlex.split(upload_cmd))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment