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

Layer1 deploy #10

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 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
16 changes: 16 additions & 0 deletions docs/post-merge
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env python3

import sys
import os.path

file_path = "mms5-layer1-service/src/main/resources/application.conf"
if not os.path.exists(file_path):
# open application.conf.example file
app_example = "mms5-layer1-service/src/main/resources/application.conf.example"
with open(file_path,'r') as firstfile, open(file_path,'w') as secondfile:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is meant to be opening the application.conf.example file?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I'll edit the comment to reflect that.

Copy link
Contributor

Choose a reason for hiding this comment

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

application.conf.example should be copied to application.conf, not the other way around. Also, it should only write to the file if it does not exist. I'd suggest using 'x' file flag in the call to open with a try catch.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It looks like the application.conf is a hidden file and actually does exist within that directory. The issue was that it was empty and so that would produce the original error. Because of this, the 'w' flag would be more appropriate as the 'x' flag will cause a "FileAlreadyExists" error. I have added the changes.

# read content from first file
for line in firstfile:
# append content to second file
secondfile.write(line)


2 changes: 1 addition & 1 deletion mms5-layer1-service