|
1 | | -############################################################ |
2 | | -# Please check readme at: https://github.com/opencrvs/infrastructure/tree/develop |
3 | | -############################################################ |
4 | | -# Variables declaration: |
5 | | -# Core images tag: usually "develop" or one of release name: |
6 | | -# - v1.7.0 |
7 | | -# - v1.7.1 |
8 | | -# NOTE: It could take any value from https://github.com/orgs/opencrvs/packages |
9 | | -# If you are under opencrvs-core repository, please use "local" tag |
10 | | -# Tilt will build new image every time when changes are made to repository |
11 | | -core_images_tag="develop" |
| 1 | +########################################################################## |
| 2 | +# Tiltfile: OpenCRVS Country config developer |
| 3 | +# For more information about variables, please check: |
| 4 | +# https://github.com/opencrvs/infrastructure/blob/develop/Tiltfile |
12 | 5 |
|
13 | | -# Countryconfig/Farajaland image repository and tag |
14 | | -# Usually image repository value is to your repository on DockerHub |
15 | | -# If for some reason you don't have DockerHub account yet, please create |
16 | | -# you local registry |
17 | | -# (see: https://medium.com/@ankitkumargupta/quick-start-local-docker-registry-35107038242e) |
| 6 | +core_images_tag = "v1.9.0-beta-6" |
18 | 7 | countryconfig_image_name="opencrvs/ocrvs-countryconfig" |
19 | | -# If you are under opencrvs-countryconfig or your own repository, please use "local" tag, |
20 | | -# Tilt will build new image every time when changes are made to repository |
21 | 8 | countryconfig_image_tag="local" |
22 | 9 |
|
23 | | -# Namespaces: |
24 | | -opencrvs_namespace = 'opencrvs-dev' |
25 | | -dependencies_namespace = 'opencrvs-deps-dev' |
26 | | - |
27 | | - |
28 | | -# Checkout infrastructure directory if not exists |
29 | 10 | if not os.path.exists('../infrastructure'): |
30 | 11 | local( "git clone [email protected]:opencrvs/infrastructure.git ../infrastructure") |
31 | 12 |
|
32 | | -local_resource('README.md', cmd='awk "/For OpenCRVS Country Config Developers/{flag=1; next} /Seed data/{flag=0} flag" ../infrastructure/README.md', labels=['0.Readme']) |
33 | | - |
34 | | - |
35 | | -# Load extensions for namespace and helm operations |
36 | | -load('ext://helm_resource', 'helm_resource', 'helm_repo') |
37 | | -load('ext://namespace', 'namespace_create', 'namespace_inject') |
38 | | -load("../infrastructure/tilt/lib.tilt", "copy_secrets", "reset_environment", "seed_data") |
39 | | - |
40 | | -include('../infrastructure/tilt/common.tilt') |
41 | | - |
42 | | -# If your machine is powerful feel free to change parallel updates from default 3 |
43 | | -# update_settings(max_parallel_updates=3) |
| 13 | +load('../infrastructure/tilt/opencrvs.tilt', 'setup_opencrvs') |
44 | 14 |
|
45 | 15 | # Build countryconfig image |
46 | 16 | docker_build(countryconfig_image_name, ".", |
47 | 17 | dockerfile="Dockerfile", |
48 | 18 | network="host") |
49 | 19 |
|
50 | | -# Create namespaces: |
51 | | -# - opencrvs-deps-dev, dependencies namespace |
52 | | -# - opencrvs-dev, main namespace |
53 | | -namespace_create(dependencies_namespace) |
54 | | -namespace_create(opencrvs_namespace) |
55 | | - |
56 | | - |
57 | | -# Install Traefik GW |
58 | | -# helm_repo('traefik-repo', 'https://traefik.github.io/charts', labels=['Dependencies']) |
59 | | -# helm_resource( |
60 | | -# 'traefik', 'traefik-repo/traefik', namespace='traefik', resource_deps=['traefik-repo'], |
61 | | -# flags=['--values=../infrastructure/infrastructure/localhost/traefik/values.yaml']) |
62 | | - |
63 | | -###################################################### |
64 | | -# OpenCRVS Dependencies Deployment |
65 | | -# NOTE: This helm chart can be deployed as helm release |
66 | | -k8s_yaml(helm('../infrastructure/charts/dependencies', |
67 | | - namespace=dependencies_namespace, |
68 | | - values=['../infrastructure/infrastructure/localhost/dependencies/values-dev.yaml'])) |
69 | | - |
70 | | -###################################################### |
71 | | -# OpenCRVS Deployment |
72 | | -k8s_yaml( |
73 | | - helm('../infrastructure/charts/opencrvs-services', |
74 | | - namespace=opencrvs_namespace, |
75 | | - values=['../infrastructure/infrastructure/localhost/opencrvs-services/values-dev.yaml'], |
76 | | - set=[ |
77 | | - "image.tag={}".format(core_images_tag), |
78 | | - "countryconfig.image.name={}".format(countryconfig_image_name), |
79 | | - "countryconfig.image.tag={}".format(countryconfig_image_tag) |
80 | | - ] |
81 | | - ) |
| 20 | +setup_opencrvs( |
| 21 | + infrastructure_path='../infrastructure', |
| 22 | + core_images_tag=core_images_tag, |
| 23 | + countryconfig_image_name=countryconfig_image_name, |
| 24 | + countryconfig_image_tag=countryconfig_image_tag, |
82 | 25 | ) |
83 | 26 |
|
84 | | -####################################################### |
85 | | -# Add Data Tasks to Tilt Dashboard |
86 | | -reset_environment(opencrvs_namespace, opencrvs_configuration_file) |
87 | | - |
88 | | -seed_data(opencrvs_namespace, opencrvs_configuration_file) |
89 | | - |
90 | | -if security_enabled: |
91 | | - copy_secrets(dependencies_namespace, opencrvs_namespace) |
92 | | - |
93 | 27 | print("✅ Tiltfile configuration loaded successfully.") |
0 commit comments