th2_grpc_sim_template
Project description
GRPC Sim Template Library
This tool generates code from .proto
files and upload constructed packages (.proto
files and generated code) to specified repositories.
How to use:
- Create a directory with the name same as project name (replace dashes with underscores) under
src/main/proto
directory (remove other files and directories if they exist). - Place your own
.proto
files in created directory. Pay attention topackage
specifier andimport
statements. - Edit paths in
python_service_generator
stage in Dockerfile. - Edit
rootProject.name
variable insettings.gradle
file. This will be the name of Java package. - Edit parameters of
setup.py
insetup
function invocation such as:author
,author_email
,url
. Do not edit the others.
Note that the name of created directory under src/main/proto
directory is used in Python (it's a package name) and Docker (in python_service_generator
stage), so it should be the same in all places.
Parameters
IMAGE_NAME
- name of Docker imageIMAGE_VERSION
- version of Docker imageAPP_VERSION
- version of Java packageARTIFACTORY_USER
- user for Java artifactoryARTIFACTORY_PASS
- password for Java artifactoryARTIFACTORY_REPO
- repository for Java artifactoryARTIFACTORY_URL
- URL for Java artifactoryNEXUS_URL
- URL for Nexus (Java)NEXUS_USER
- user for Nexus (Java)NEXUS_PASS
- password for Nexus (Java)PYPI_REPOSITORY_URL
- URL for Python package repositoryPYPI_USER
- user for Python package repositoryPYPI_PASSWORD
- password for Python package repositoryAPP_NAME
- name of Python packageAPP_VERSION
- version of Python package
Docker
You can run everything via Docker:
docker build --tag {IMAGE_NAME}:{IMAGE_VERSION} . --build-arg release_version=${APP_VERSION}
--build-arg artifactory_user=${ARTIFACTORY_USER}
--build-arg artifactory_password=${ARTIFACTORY_PASS}
--build-arg artifactory_deploy_repo_key=${ARTIFACTORY_REPO}
--build-arg artifactory_url=${ARTIFACTORY_URL}
--build-arg pypi_repository_url=${PYPI_REPOSITORY_URL}
--build-arg nexus_url=${NEXUS_URL}
--build-arg nexus_user=${NEXUS_USER}
--build-arg nexus_password=${NEXUS_PASS}
--build-arg pypi_user=${PYPI_USER}
--build-arg pypi_password=${PYPI_PASSWORD}
--build-arg app_name=${APP_NAME}
--build-arg app_version=${APP_VERSION}
See Parameters section.
Java
If you wish to manually create and publish package for Java, run these command:
gradle --no-daemon clean build publish artifactoryPublish \
-Prelease_version=${RELEASE_VERSION} \
-Partifactory_user=${ARTIFACTORY_USER} \
-Partifactory_password=${ARTIFACTORY_PASSWORD} \
-Partifactory_deploy_repo_key=${ARTIFACTORY_DEPLOY_REPO_KEY} \
-Partifactory_url=${ARTIFACTORY_URL} \
-Pnexus_url=${NEXUS_URL} \
-Pnexus_user=${NEXUS_USER} \
-Pnexus_password=${NEXUS_PASSWORD}
See Parameters section.
Python
If you wish to manually create and publish package for Python:
- Edit
package_info.json
file in order to specify name and version for package (create file if it's absent). - Run these commands:
pip install -r requirements.txt
python setup.py generate
python setup.py sdist
twine upload --repository-url ${PYPI_REPOSITORY_URL} --username ${PYPI_USER} --password ${PYPI_PASSWORD} dist/*
See Parameters section.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for th2_grpc_sim_template-2.3.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | dff23cc82c7e2c11f58a1123ccb774b306a8a5f318804fd3c58373b4a9a6269e |
|
MD5 | 265c486ffa8a3047180193037f3468f8 |
|
BLAKE2b-256 | a7f03bf232e5fcc73da6ca441fd1d50ec6cb64da66184b957874b74cd7c7e8fa |