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

feat(quickstart): Simplify docker generate and compare script #3434

Merged

Conversation

EnricoMi
Copy link
Contributor

There is docker/monitoring/docker-compose.monitoring.yml but docker/quickstart/docker-compose.quickstart.monitoring.yml. If both filenames follow the same naming scheme, i.e. docker-compose.monitoring.quickstart.yml, then some code duplication in docker/quickstart/generate_and_compare.sh could be reduced:

for flavour in "" "-without-neo4j" ".monitoring"
do
  if cmp docker-compose$flavour.quickstart.yml temp$flavour.quickstart.yml; then
    printf 'docker-compose$flavour.quickstart.yml is up to date.'
  else
    printf 'docker-compose$flavour.quickstart.yml is out of date.'
     exit 1
  fi
done

There might more quickstart scripts being added in the future, e.g. for #3261 (see https://github.com/EnricoMi/datahub/pull/6/files#diff-135ef7fb531c210baeeab0b42a4e2589366367ea773e52c524140844eb583b8b) which would benefit from this.

@EnricoMi EnricoMi changed the title Branch docker generate and compare feat(quickstart): Simplify docker generate and compare script Oct 22, 2021
@EnricoMi EnricoMi marked this pull request as ready for review October 22, 2021 10:14
MONITORING_COMPOSE="-f quickstart/docker-compose.quickstart.monitoring.yml"
MONITORING_COMPOSE="-f quickstart/docker-compose.monitoring.quickstart.yml"
Copy link
Contributor

Choose a reason for hiding this comment

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

out of curiosity, what was the motivation behind this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To be able to include the '.monitor' flavour in the for loop to avoid a separate if cmp code block for that file. And it better aligns with the naming in docker/monitoring.

In https://github.com/EnricoMi/datahub/pull/6/files#diff-135ef7fb531c210baeeab0b42a4e2589366367ea773e52c524140844eb583b8b I am adding more quickstart files and #3286 might also want a quickstart flavour one day.

printf 'docker-compose.quickstart.yml is out of date.'
python generate_docker_quickstart.py ../monitoring/docker-compose.monitoring.yml temp.monitoring.quickstart.yml

for flavour in "" "-without-neo4j" ".monitoring"
Copy link
Contributor

Choose a reason for hiding this comment

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

let's make this a constant declared at the top of the file

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good idea, done

@EnricoMi EnricoMi force-pushed the branch-docker-generate-and-compare branch from b9a1f1e to b5eb5a2 Compare October 26, 2021 16:41
@github-actions
Copy link

Unit Test Results

  39 files  ±0    39 suites  ±0   19m 5s ⏱️ + 1m 9s
314 tests ±0  314 ✔️ ±0    0 💤 ±0  0 ±0 
963 runs  ±0  941 ✔️ ±0  22 💤 ±0  0 ±0 

Results for commit b5eb5a2. ± Comparison against base commit 561c04b.

@EnricoMi
Copy link
Contributor Author

@gabe-lyons is this good to go?

@shirshanka
Copy link
Contributor

@EnricoMi : sorry for the radio silence on this one, we'll shepherd this in this week.

Copy link
Contributor

@dexter-mh-lee dexter-mh-lee left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@shirshanka shirshanka left a comment

Choose a reason for hiding this comment

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

LGTM

@shirshanka shirshanka merged commit 66328ee into datahub-project:master Nov 30, 2021
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.

4 participants