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

Make git repository setup optional #864

Merged
merged 5 commits into from
May 23, 2022
Merged

Conversation

martinratinaud
Copy link
Member

As use can choose mongo OR git as a database system, there may be no need to create nor define repositories url.

Let's make it optional

@martinratinaud martinratinaud requested a review from Ndpnt May 19, 2022 05:08
This should happen when using mongo, as for the contrib instance
@martinratinaud
Copy link
Member Author

martinratinaud commented May 19, 2022

Tested on vagrant

  • add ota_branch: conditional_git_repo_ops_test in dev.yml
  • commented snapshots_repository in dev.yml
  • replace "type": "git", by "type": "mongo" in default.yml
  • deployed with ansible-playbook -i ops/inventories/dev.yml ops/site.yml
  • SSH to machine vagrant ssh
  • snapshots folder is not present

@MattiSG MattiSG changed the title Conditional git repo ops Make git repository setup optional May 19, 2022
@martinratinaud martinratinaud requested review from Ndpnt and removed request for Ndpnt May 19, 2022 06:53
snapshots_branch: master
versions_repository: git@github.com:OpenTermsArchive/contrib-versions.git
versions_branch: main
snapshots_repository: git@github.com:OpenTermsArchive/sandbox-snapshots.git
Copy link
Member

Choose a reason for hiding this comment

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

I wanted to do this for a long time, thank you! 👍

@Ndpnt
Copy link
Member

Ndpnt commented May 23, 2022

Tested locally. It works.
We just got this error:

2022-05-23 07:16:17 info                                                          Start Open Terms Archive

2022-05-23 07:16:17 info                                                          Examining 607 documents from 283 services for refiltering…
2022-05-23 07:16:21 error                                                         unhandledRejection: fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using

    git remote add <name> <url>

and then push using the remote name

    git push <name>


Error: fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using

    git remote add <name> <url>

and then push using the remote name

    git push <name>


    at Object.action (/home/vagrant/ota/node_modules/simple-git/src/lib/plugins/error-detection.plugin.js:30:33)
    at PluginStore.exec (/home/vagrant/ota/node_modules/simple-git/src/lib/plugins/plugin-store.js:21:33)
    at /home/vagrant/ota/node_modules/simple-git/src/lib/runners/git-executor-chain.js:95:45
    at new Promise (<anonymous>)
    at GitExecutorChain.handleTaskData (/home/vagrant/ota/node_modules/simple-git/src/lib/runners/git-executor-chain.js:93:16)
    at GitExecutorChain.<anonymous> (/home/vagrant/ota/node_modules/simple-git/src/lib/runners/git-executor-chain.js:77:46)
    at Generator.next (<anonymous>)
    at fulfilled (/home/vagrant/ota/node_modules/simple-git/src/lib/runners/git-executor-chain.js:5:58)

It's due to the fact that the engine try to push on a non existent remote. I will open an issue for this.

@martinratinaud martinratinaud merged commit 43cecbc into main May 23, 2022
@martinratinaud martinratinaud deleted the conditional_git_repo_ops branch May 23, 2022 10:39
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.

None yet

2 participants