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

Layer1 deploy #10

wants to merge 5 commits into from

Conversation

VQTran123
Copy link
Collaborator

Added single-server deployment for mms5-layer1-service and added a post-merge githook that will copy contents of the application.conf.example into application.conf if the latter does not exist inside mms5-layer1-service.

Githook copies contents from mms5-layer1-service file application.conf.example into new file called application.conf
docs/post-merge Outdated
if os.path.exists(file_path):
# open both files
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.

docs/post-merge Outdated
if os.path.exists(file_path):
# open both files
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.

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.

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