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

LF-2758 export server cicd #2483

Merged
merged 8 commits into from
Jun 2, 2023
Merged

Conversation

craigyu
Copy link
Contributor

@craigyu craigyu commented Mar 7, 2023

Description

This PR has 3 changes:

  1. Added a script_stop function. This will stop script after the first failure, and the job will show as failed. In the previous version, if for example, the git pull step fails, it will still run the rest of the script and we will see a green check mark thinking the job has been completed.
  2. Instead of restarting the service, it deletes the service then starts it again, in case there isn't any service to restart.
  3. Exposed our deployment script for easy management, since there is little reason to hide the script.

Jira link: LF-2758

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Passes test case
  • UI components visually reviewed on desktop view
  • UI components visually reviewed on mobile view
  • Other (please explain)
    • Tested with github action. See the output here.

Checklist:

  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • The precommit and linting ran successfully
  • I have added or updated language tags for text that's part of the UI
  • I have added "MISSING" for all new language tags to languages I don't speak
  • I have added the GNU General Public License to all new files

@craigyu
Copy link
Contributor Author

craigyu commented Mar 7, 2023

Some explanation of the script:
the git add -A . & git stash are there to prevent this error:
image

the export NVM_DIR=~/.nvm & source ~/.nvm/nvm.sh are there to prevent the nvm not found error, the solution was found here.

Copy link
Collaborator

@Duncan-Brain Duncan-Brain left a comment

Choose a reason for hiding this comment

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

@craigyu

Sorry it took so long to review but looks good to me!

Copy link
Collaborator

@kathyavini kathyavini left a comment

Choose a reason for hiding this comment

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

I misunderstood the PR comments and thought that the nvm and git stash lines were an addition from this PR, but I now am pretty sure that this is merely exposing them (and they are already in use in the GitHub Actions secret anyway).

May we merge this? Sorry @craigyu for leaving your PR in limbo for 3 months...

@iperdomo
Copy link
Collaborator

iperdomo commented Jun 2, 2023

I would suggest to move away from having shell scripts embedded in yaml files. Having an actual file (.sh) means that you can take advantage of your editor, syntax highlighting and linting (via ShellCheck)

@kathyavini
Copy link
Collaborator

@iperdomo I can open a new PR for that change if we want to merge this first initially (I think @craigyu is quite busy at his new job these days!)

@SayakaOno SayakaOno merged commit dde897f into integration Jun 2, 2023
@SayakaOno SayakaOno deleted the LF-2758-export-server-CICD branch June 2, 2023 20:15
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.

5 participants