z is the one-stop shop for the Zilliqa provisioning and deployment operations. To deploy applications with z ensure the z
binary is installed in your operative system PATH environment variable. For more details about z please refer to the documentation.
To deploy the localdev/development environment go to the project folder in the zilliqa-developer repository:
cd ./products/developer-portalThe ./products/developer-portal/z.yaml contains all the relevant configurations for the development environment.
Now set the following environment variables to reference the project's z.yaml file:
Z_ENVto the path in which yourz.yamlresides.ZQ_USERto your username (the bit before@in your email address)
for example:
export Z_ENV=z.yaml
export ZQ_USER=<user_id>@zilliqa.comCreate the local kind cluster (if not created previously):
z local createExecute the manifests (in this case for ensuring the installation of the ingress-nginx controller, required for localdev/development environments):
z k-applyBuild and push the image:
make image/build-and-pushAnd deploy the application to your local cluster with:
z app syncVerify your application is running correct from the http://localhost URL and with kubectl commands (if required).
To deploy the staging environment we need to clone the devops repository and execute z from there:
git clone https://github.com/Zilliqa/devops.git
cd devops
source setenvZ_ENVto the path in which yourz.yamlresides.ZQ_USERto your username (the bit before@in your email address)GITHUB_PAT(if you are deploying staging or production apps) to a classic PAT with all the repo permissions ticked.
for example:
export Z_ENV=`pwd`/infra/live/gcp/non-production/prj-d-staging/z_ase1.yaml
export ZQ_USER=<user_id>@zilliqa.com
export GITHUB_PAT=<GITHUB_PAT>z login-
Create a branch:
git checkout -b users/<username>/add_developer_portal_to_staging_cluster
-
In the file
infra/live/gcp/non-production/prj-d-staging/z_ase1.yamladd the following:-
in
appsstanza add:clusters: staging: apps: developer-portal: repo: https://github.com/Zilliqa/zilliqa-developer path: products/developer-portal/cd/overlays/staging track: staging type: kustomize
-
in
subdomainsstanza add:infrastructure: dns: vars: subdomains: developer-portal: {}
-
-
Push the changes
git add . git commit -m "Add Developer Portal to staging cluster" git push origin users/<username>/add_developer_portal_to_staging_cluster
-
Open a Pull Request to the main branch
-
Apply the changes
z plan z apply
z app sync --cache-dir=.cache developer-portalVerify your application is running correct from the staging URL and with kubectl commands (if required).
To deploy the production environment we need to clone the devops repository and execute z from there:
git clone https://github.com/Zilliqa/devops.git
cd devops
source setenvZ_ENVto the path in which yourz.yamlresides.ZQ_USERto your username (the bit before@in your email address)GITHUB_PAT(if you are deploying staging or production apps) to a classic PAT with all the repo permissions ticked.
for example:
export Z_ENV=`pwd`/infra/live/gcp/production/prj-p-prod-apps/z_ase1.yaml
export ZQ_USER=<user_id>@zilliqa.com
export GITHUB_PAT=<GITHUB_PAT>z login-
Create a branch:
git checkout -b users/<username>/add_developer_portal_to_production_cluster
-
In the file
infra/live/gcp/production/prj-p-prod-apps/z_ase1.yamladd the following:-
in
appsstanza add:clusters: production: apps: developer-portal: repo: https://github.com/Zilliqa/zilliqa-developer path: products/developer-portal/cd/overlays/production track: production type: kustomize
-
in
subdomainsstanza add:infrastructure: dns: vars: subdomains: dev: {}
-
-
Push the changes
git add . git commit -m "Add Developer Portal to production cluster" git push origin users/<username>/add_developer_portal_to_production_cluster
-
Open a Pull Request to the main branch
-
Apply the changes
z plan z apply
z app sync --cache-dir=.cache developer-portalVerify your application is running correct from the production URL and with kubectl commands (if required).