4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
8 http://www.apache.org/licenses/LICENSE-2.0
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
14 See the License for the specific language governing permissions and
15 limitations under the License
19 Scripts and artifacts for OSM installation and CI/CD pipelines.
23 - `jenkins`: scripts run by jenkins. All OSM modules rely on these scripts.
24 - `installers`: scripts to be executed to install OSM. It also includes the OSM helm chart.
26 ## Instructions to test new code in the same way is done in OSM CI/CD pipeline
37 Clone the projects that you would like to test
40 git clone "https://osm.etsi.org/gerrit/osm/devops"
41 git clone "https://osm.etsi.org/gerrit/osm/common"
42 git clone "https://osm.etsi.org/gerrit/osm/N2VC"
43 git clone "https://osm.etsi.org/gerrit/osm/LCM"
47 ### Update repos to use a specific branch or a Gerrit patch
49 If needed, update code in the repos. An example for N2VC is shown below
53 git pull "https://osm.etsi.org/gerrit/osm/N2VC" refs/changes/22/14222/2
56 git pull "https://osm.etsi.org/gerrit/osm/LCM" refs/changes/24/14224/3
60 ### Start an HTTP server to host the intermediate artifacts (deb packages)
63 ./devops/tools/local-build.sh --run-httpserver
67 ### Run stage2 to build artifacts
70 # Clean previous artifacts
71 rm $HOME/.osm/httpd/*.deb
73 ./devops/tools/local-build.sh --module common,N2VC,LCM stage-2
74 # Check that artifacts were created
78 __Note: Artifacts need to be cleaned every time we want to try new patches__
80 ### Run stage3 to build docker images
83 ./devops/tools/local-build.sh --module LCM stage-3
85 # Copy the image to your image resistry, e.g.: "your-registry/osm/osm-testing/opensourcemano/lcm:myfeature"
88 ### Update OSM Helm release to use the new image
92 helm3 -n osm get values osm
98 kubectl -n osm patch deployment lcm --patch '{"spec": {"template": {"spec": {"containers": [{"name": "lcm", "image": "your-registry/osm/osm-testing/opensourcemano/lcm:myfeature}]}}}}'
99 kubectl -n osm get all
106 helm3 -n osm history osm
107 helm3 -n osm upgrade --reuse-values --set lcm.image.repository="your-registry/osm/osm-testing/opensourcemano/lcm" --set lcm.image.tag="myfeature" osm ./helm-chart-dir
108 helm3 -n osm status osm
109 kubectl -n osm get all
111 ### Test OSM Helm Chart independently
114 git clone "https://osm.etsi.org/gerrit/osm/devops"
116 # Get a patch from Gerrit
117 # git pull "https://osm.etsi.org/gerrit/osm/devops" refs/changes/25/14325/17
118 ./installers/install_helm_client.sh -D . --debug
119 ./devops-stages/stage-test.sh
120 ./installers/full_install_osm.sh -D . --debug -R testing-daily -t testing-daily -r testing -y 2>&1 | tee osm_install_log.txt
121 kubectl -n osm get all
122 kubectl -n osm get ingress