-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
167 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
#!/usr/bin/env python | ||
from pathlib import Path | ||
|
||
import click | ||
from yaml import SafeLoader, load | ||
|
||
BUILD_CONFIG = load(Path("build.yml").read_text(), Loader=SafeLoader) | ||
|
||
|
||
def get_organization(): | ||
return BUILD_CONFIG["organization"] | ||
|
||
|
||
def get_version(): | ||
return BUILD_CONFIG["version"] | ||
|
||
|
||
def get_tags(): | ||
yield BUILD_CONFIG["version"] # The version of the stack. | ||
# The versions of dependencies: | ||
for name, version in BUILD_CONFIG["versions"].items(): | ||
yield f"{name}-{version}" | ||
|
||
|
||
def get_docker_build_args(): | ||
yield f"VERSION={BUILD_CONFIG['version']}" | ||
for name, version in BUILD_CONFIG["versions"].items(): | ||
yield f"{name.upper()}_VERSION={version}" | ||
|
||
|
||
@click.group() | ||
def cli(): | ||
pass | ||
|
||
|
||
@cli.command() | ||
@click.option( | ||
"--github-actions", | ||
is_flag=True, | ||
help="Output tags in a format convenient for GitHub actions.", | ||
) | ||
def tags(github_actions): | ||
if github_actions: | ||
click.echo(r"%0A".join(get_tags())) | ||
else: | ||
click.echo("\n".join(get_tags())) | ||
|
||
|
||
@cli.command() | ||
@click.option( | ||
"--github-actions", | ||
is_flag=True, | ||
help="Output tags in a format convenient for GitHub actions.", | ||
) | ||
def docker_build_args(github_actions): | ||
if github_actions: | ||
click.echo(r"%0A".join(get_docker_build_args())) | ||
else: | ||
click.echo(" ".join(f"--build-arg {arg}" for arg in get_docker_build_args())) | ||
|
||
|
||
if __name__ == "__main__": | ||
cli() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
organization: aiidalab | ||
version: '2022.1001' | ||
versions: | ||
python: '3.9.4' | ||
aiida: '2.0.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
[bumpver] | ||
current_version = "2022.1001" | ||
version_pattern = "YYYY.BUILD[-TAG]" | ||
commit_message = "Bump version {old_version} -> {new_version}." | ||
commit = true | ||
tag = false | ||
push = false | ||
|
||
[bumpver.file_patterns] | ||
"build.yml" = [ | ||
"version: '{version}'" | ||
] | ||
"bumpver.toml" = [ | ||
'current_version = "{version}"', | ||
] | ||
"docker-compose.yml" = [ | ||
"aiidalab/aiidalab:{version}" | ||
] | ||
"stack/aiidalab/Dockerfile" = [ | ||
'ARG VERSION={version}' | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters