theochem / cgrid

C++ version of horton (2.x) grid functionality
GNU General Public License v3.0
4 stars 1 forks source link

Idea for facilitating maintaining travis scripts #12

Closed tovrstra closed 6 years ago

tovrstra commented 7 years ago

@matt-chan We could use .travis.yml as its own template file, reducing the number of files to keep an eye on. The main downside is that it requires a file structure as follows:

- "Some header yaml part that contains variables and other things that tend to change between projects"
# EVERYTHON BELOW THIS LINE MAY BE OVERWRITTEN BY THIEF!!!
# stolen from: url    <--- optional line
- "Template yaml"

We can write a python thief script that takes one argument: a URL pointing to the file to steal, e.g. https://raw.githubusercontent.com/theochem/cellcutoff/master/.travis.yml or a stolen file to be updated .travis.yml We may even add a safety check that a file to steal should not be stolen from somewhere else, just to maintain sanity.

In either case, the file to steal and the one to replace (if present) must contain the above structure. If not, the thief script should stop without making changes and print an appropriate error message.

  1. URL:
    1. If the file does not exist locally, steal it entirely and add the # stole from: url line.
    2. If the file does exist, replace everything below the separator line. Also add or update the # stolen from: url line.
  2. File (must exist): look up the # stolen from: url line and update from the url on that line, as in case 1.ii. Only works if # stolen from is present.

In any case, even with the current templating method, it would be good to make the .travis.yml completely self-contained.

tovrstra commented 7 years ago

We should extend this idea, such that also scripts used from .travis.yml are copied over. I'll draft something soon.

matt-chan commented 6 years ago

I think this is more or less done now? We technically don't have template.py residing in its own repo though. We're still using the copy that's in theochem/qcgrids

tovrstra commented 6 years ago

That's fine for now. Having a separate repo for the template script just seems overkill. I'll close.