diff --git a/BUILD.md b/BUILD.md index 4895af7..79d6b7a 100644 --- a/BUILD.md +++ b/BUILD.md @@ -3,23 +3,6 @@ For the building purpose of a **Package** or **Docker Image** it is recommended git clone ``` -# Package Build - -## Debian/Ubuntu Package - -To generate a .deb package file for the instalation of the NITA webapp on a Debian based system you can run the *build-nita-webapp-21.7-1.sh* script file found under the *packaging* folder: -```bash -cd packaging -./build-nita-webapp-21.7-1.sh -``` - -## Centos/RedHat Package -To generate a .rpm package file for the instalation of the NITA webapp on a Centos based system you can run the *build-webapp-21.7-1.sh* script file found under the *packaging_redhat* folder: -```bash -cd packaging_redhat -./build-webapp-21.7-1.sh -``` - # Docker Image Build To build the webapp docker image you can simply run the *build_container.sh* also found on the root folder of this repo: ```bash diff --git a/Dockerfile b/Dockerfile index 935cf15..d84dd3d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,8 +26,8 @@ RUN apt-get install gcc default-mysql-client default-libmysqlclient-dev wget unz #COPY nita-yaml-to-excel/ yaml-to-excel/ -RUN wget --no-check-certificate https://github.com/Juniper/nita-yaml-to-excel/archive/refs/heads/21.7.zip -RUN unzip 21.7.zip +RUN wget --no-check-certificate https://github.com/Juniper/nita-yaml-to-excel/archive/refs/heads/22.8.zip +RUN unzip 22.8.zip COPY requirements.txt . RUN pip install -r requirements.txt diff --git a/README.md b/README.md index 9e83738..0760e9e 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ -# NITA Web Application 21.7 +# NITA Web Application 22.8 -Welcome to NITA 21.7. +Welcome to NITA 22.8. -Packages built from this branch will be nita-*-21.7-x where x is the packaging release. +Packages built from this branch will be nita-*-22.8-x where x is the packaging release. This branch also contains patches from other branches or minor modifications as required to support the stability and usability of the release. There are also some backwards compatibility packages here for ansible and robot that allow projects written for NITA 3.0.7 to work without having to make any changes. -Note that NITA 21.7 backward compatible with NITA 20.10 projects, provided the correct ansible and robot containers are installed. +Note that NITA 22.8 backward compatible with NITA 20.10 projects, provided the correct ansible and robot containers are installed. # Copyright @@ -33,23 +33,10 @@ It allows NITA projects to declare exactly which version of NITA they are compat Projects must explicitly use the versions of the containers provided by this package in order to avoid docker attempting to download from the registry. No containers tagged as "latest" are provided by the package. -## Current Version +## 22.8 New Features and Bug Fixes -The release has been broken up into multiple packages, see the list bellow: - -* Ubuntu 18.04 - * nita-jenkins-21.7-1 - * nita-webapp-21.7-1 - * nita-ansible-2.9.18-21.7-1 - * nita-robot-4.1-21.7-1 - * yaml-to-excel-21.7.0-1 - -* Centos 7 - * nita-jenkins-21.7-1 - * nita-webapp-21.7-1 - * nita-ansible-2.9.18-21.7-1 - * nita-robot-4.1-21.7-1 - * yaml-to-excel-21.7.0-1 +* Loads of security advisories, please use this version to avoid security problems in 21.7. +* Upgraded Jenkins ## 21.7 New Features and Bug Fixes @@ -137,7 +124,7 @@ Once you have docker-ce and docker-compose installed do the following steps as * ```bash git clone https://github.com/Juniper/nita-webapp cd nita-webapp -git checkout 21.7 +git checkout 22.8 mkdir nginx/certificates openssl req -batch -x509 -nodes -days 365 -newkey rsa:2048 -keyout nginx/certificates/nginx-certificate-key.key -out nginx/certificates/nginx-certificate.crt docker network create nita-network @@ -150,7 +137,7 @@ In order for NITA to work you also need to run jenkins: apt-get install -y openjdk-11-jre-headless git clone https://github.com/Juniper/nita-jenkins cd nita-jenkins -git checkout 21.7 +git checkout 22.8 mkdir certificates keytool -genkey -keyalg RSA -alias selfsigned -keystore certificates/jenkins_keystore.jks -keypass nita123 -storepass nita123 -keysize 4096 -dname "cn=, ou=, o=, l=, st=, c=" docker compose up -d @@ -169,12 +156,12 @@ cd nita-jenkins cd .. git clone https://github.com/Juniper/nita-ansible cd nita-ansible -git checkout 21.7 +git checkout 22.8 ( cd cli_scripts && install -m 0755 * /usr/local/bin ) cd .. git clone https://github.com/Juniper/nita-robot cd nita-robot -git checkout 21.7 +git checkout 22.8 ( cd cli_scripts && install -m 0755 * /usr/local/bin ) cd .. exec bash @@ -199,33 +186,7 @@ chgrp 1000 /var/nita_project Note: Verify that the group section of the permissions is writable as well. In some instances the linux permissions 755 are seen after this step and need to modified by ```sudo chmod 775 /var/nita_project``` -### Ubuntu packages -If you have been provided with or built the .deb package files, then follow the instructions provided in the [Dependencies](##Dependencies) section above and then run the following command: - -```bash -sudo apt-get install -``` - -Example: -```bash -sudo apt-get install ./nita-jenkins-21.7-1.deb ./nita-webapp-21.7-1.deb ./yaml-to-excel-21.7.0-1.deb -``` - -### Centos packages -If you have been provided with or built the .rpm package files, then follow the instructions provided in the [Dependencies](##Dependencies) section above and then run the following command: - -```bash -sudo yum install -``` - -Example: -```bash -sudo yum install ./nita-jenkins-21.7-1.noarch.rpm ./nita-webapp-21.7-1.noarch.rpm ./yaml-to-excel-21.7.0-1.noarch.rpm -``` - -NOTE: make sure you disable SELinux during the instalation process. Refer to [`Known Bugs and irritations`](#Known-Bugs-and-irritations) for more details. - -## +## Vagrant For users of vagrant, here is a handy "Vagrantfile" that will get you a working ubuntu 18.04 box quickly and forward the relevant ports: @@ -363,12 +324,12 @@ ExecStart=/usr/bin/dockerd -H tcp://192.168.49.2 -H fd:// --containerd=/run/cont The examples included with nita-webapp assume a local installation of Jenkins. The shell commands configured in the ``project.yaml`` file and loaded as Jenkins jobs to build the network environments are written for local installation. In order for the Jenkins to execute the jobs properly, the shell commands will need to be modified for remote execution. For example, in the DC build example, the file https://github.com/wildsubnet/nita-webapp/blob/main/examples/evpn_vxlan_erb_dc/project.yaml contains the following line: ``` configuration: - shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:21.3-1 /bin/bash -c "cd ${WORKSPACE}; bash build.sh ${build_dir}"' + shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:22.8-1 /bin/bash -c "cd ${WORKSPACE}; bash build.sh ${build_dir}"' ``` This would be modified for remote execution via TCP (as configured in the previous section) by adding ``-H tcp://docker-IP`` to the ``docker run`` command: ``` configuration: - shell_command: 'write_yaml_files.py; docker run -H tcp://docker-IP -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:21.3-1 /bin/bash -c "cd ${WORKSPACE}; bash build.sh ${build_dir}"' + shell_command: 'write_yaml_files.py; docker run -H tcp://docker-IP -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:22.8-1 /bin/bash -c "cd ${WORKSPACE}; bash build.sh ${build_dir}"' ``` ### nita-jenkins on a separate docker network diff --git a/VERSION.txt b/VERSION.txt index 411543d..8dc248c 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -21.7 +22.8 diff --git a/build-and-test-webapp/nita-webapp/ngcn_workbench/ngcn/views.py b/build-and-test-webapp/nita-webapp/ngcn_workbench/ngcn/views.py index 2db588d..849c7a5 100644 --- a/build-and-test-webapp/nita-webapp/ngcn_workbench/ngcn/views.py +++ b/build-and-test-webapp/nita-webapp/ngcn_workbench/ngcn/views.py @@ -521,7 +521,8 @@ def deleteCampusTypeView(request): action_url = 'network_type_validator'; current_build_number = server.get_job_info(action_url)['nextBuildNumber'] - Jenkins(JENKINS_SERVER_URL, username=JENKINS_SERVER_USER, password=JENKINS_SERVER_PASS).get_job(action_url).invoke(build_params={'file_name': campusType.app_zip_name, + crumb=CrumbRequester(baseurl=JENKINS_SERVER_URL, username=JENKINS_SERVER_USER, password=JENKINS_SERVER_PASS) + Jenkins(JENKINS_SERVER_URL, username=JENKINS_SERVER_USER, password=JENKINS_SERVER_PASS, requester=crumb).get_job(action_url).invoke(build_params={'file_name': campusType.app_zip_name, 'operation':'delete', 'project_workspace_path': ServerProperties.getWorkspaceLocation()}, ) diff --git a/build_container.sh b/build_container.sh index b12974b..512bf87 100755 --- a/build_container.sh +++ b/build_container.sh @@ -16,4 +16,4 @@ set -e -docker build -t juniper/nita-webapp:22.7-1 . +docker build -t juniper/nita-webapp:22.8-1 . diff --git a/docker-compose.yaml b/docker-compose.yaml index e516dfc..4d9d487 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -15,7 +15,7 @@ version: "2.0" services: webapp: - image: juniper/nita-webapp:22.7-1 + image: juniper/nita-webapp:22.8-1 command: ./build-and-test-webapp/wait-for-db.sh networks: - nita-network @@ -38,7 +38,7 @@ services: # extra_hosts: # - "jenkins:192.168.X.y" db: - image: mariadb:latest + image: mariadb:10.4.12 command: --default-authentication-plugin=mysql_native_password environment: MYSQL_DATABASE: Sites diff --git a/examples/ebgp_wan/project.yaml b/examples/ebgp_wan/project.yaml index cf26311..69785af 100644 --- a/examples/ebgp_wan/project.yaml +++ b/examples/ebgp_wan/project.yaml @@ -1,5 +1,5 @@ description: Simple IPCLOS based WAN setup to link two data centers -name: ebgp_wan_0.2 +name: ebgp_wan_0.3 action: - name: Build @@ -7,22 +7,22 @@ action: #must be one of NOOB, BUILD or TEST category: BUILD configuration: - shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:21.7-1 /bin/bash -c "cd ${WORKSPACE}; bash build.sh ${build_dir}"' + shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:22.8-1 /bin/bash -c "cd ${WORKSPACE}; bash build.sh ${build_dir}"' - name: Dump configuration jenkins_url: dump_vmx_wan #must be one of NOOB, BUILD or TEST category: BUILD configuration: - shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:21.7-1 /bin/bash -c "cd ${WORKSPACE}; bash dump.sh ${build_dir}"' + shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:22.8-1 /bin/bash -c "cd ${WORKSPACE}; bash dump.sh ${build_dir}"' - name: Test jenkins_url: test_vmx_wan #must be one of NOOB, BUILD or TEST category: TEST configuration: - shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:21.7-1 /bin/bash -c "cd ${WORKSPACE}; bash test_setup.sh ${build_dir}" - write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name robot -e ROBOT_OPTIONS="-d ${PWD}/test/outputs" juniper/nita-robot:21.7-1 /bin/bash -c "cd ${WORKSPACE}; bash test.sh"' + shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:22.8-1 /bin/bash -c "cd ${WORKSPACE}; bash test_setup.sh ${build_dir}" + write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name robot -e ROBOT_OPTIONS="-d ${PWD}/test/outputs" juniper/nita-robot:22.8-1 /bin/bash -c "cd ${WORKSPACE}; bash test.sh"' output_path: test/outputs/ - name: Netbox Population @@ -30,11 +30,11 @@ action: #must be one of NOOB, BUILD or TEST category: BUILD configuration: - shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:21.7-1 /bin/bash -c "cd ${WORKSPACE}; bash netbox.sh ${build_dir}"' + shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:22.8-1 /bin/bash -c "cd ${WORKSPACE}; bash netbox.sh ${build_dir}"' - name: HealthBot Population jenkins_url: healthbot_population #must be one of NOOB, BUILD or TEST category: BUILD configuration: - shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:21.7-1 /bin/bash -c "cd ${WORKSPACE}; bash healthbot.sh ${build_dir}"' + shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:22.8-1 /bin/bash -c "cd ${WORKSPACE}; bash healthbot.sh ${build_dir}"' diff --git a/examples/evpn_vxlan_erb_dc/project.yaml b/examples/evpn_vxlan_erb_dc/project.yaml index ac0d937..16a9b3c 100644 --- a/examples/evpn_vxlan_erb_dc/project.yaml +++ b/examples/evpn_vxlan_erb_dc/project.yaml @@ -12,43 +12,43 @@ # # ******************************************************** description: EVPN VLXAN ERB Data Center -name: evpn_vxlan_erb_dc_1.2 +name: evpn_vxlan_erb_dc_1.3 action: - name: Build jenkins_url: build_qfx_fabric #must be one of NOOB, BUILD or TEST category: BUILD configuration: - shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:21.7-1 /bin/bash -c "cd ${WORKSPACE}; bash build.sh ${build_dir}"' + shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:22.8-1 /bin/bash -c "cd ${WORKSPACE}; bash build.sh ${build_dir}"' - name: Build server interfaces jenkins_url: build_server_interfaces #must be one of NOOB, BUILD or TEST category: BUILD configuration: - shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:21.7-1 /bin/bash -c "cd ${WORKSPACE}; bash configure_bms.sh ${build_dir}"' + shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:22.8-1 /bin/bash -c "cd ${WORKSPACE}; bash configure_bms.sh ${build_dir}"' - name: Build base config jenkins_url: base_qfx_fabric #must be one of NOOB, BUILD or TEST category: BUILD configuration: - shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:21.7-1 /bin/bash -c "cd ${WORKSPACE}; bash base.sh ${build_dir}"' + shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:22.8-1 /bin/bash -c "cd ${WORKSPACE}; bash base.sh ${build_dir}"' - name: Dump configuration jenkins_url: dump_qfx_fabric #must be one of NOOB, BUILD or TEST category: BUILD configuration: - shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:21.7-1 /bin/bash -c "cd ${WORKSPACE}; bash dump.sh ${build_dir}"' + shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:22.8-1 /bin/bash -c "cd ${WORKSPACE}; bash dump.sh ${build_dir}"' - name: Test jenkins_url: test_qfx_fabric #must be one of NOOB, BUILD or TEST category: TEST configuration: - shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:21.7-1 /bin/bash -c "cd ${WORKSPACE}; bash test_setup.sh ${build_dir}" - write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name robot -e ROBOT_OPTIONS="-d ${PWD}/test/outputs" juniper/nita-robot:21.7-1 /bin/bash -c "cd ${WORKSPACE}; bash test.sh"' + shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:22.8-1 /bin/bash -c "cd ${WORKSPACE}; bash test_setup.sh ${build_dir}" + write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name robot -e ROBOT_OPTIONS="-d ${PWD}/test/outputs" juniper/nita-robot:22.8-1 /bin/bash -c "cd ${WORKSPACE}; bash test.sh"' output_path: test/outputs/ - name: Netbox Population @@ -56,11 +56,11 @@ action: #must be one of NOOB, BUILD or TEST category: BUILD configuration: - shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:21.7-1 /bin/bash -c "cd ${WORKSPACE}; bash netbox.sh ${build_dir}"' + shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:22.8-1 /bin/bash -c "cd ${WORKSPACE}; bash netbox.sh ${build_dir}"' - name: HealthBot Population jenkins_url: healthbot_population #must be one of NOOB, BUILD or TEST category: BUILD configuration: - shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:21.7-1 /bin/bash -c "cd ${WORKSPACE}; bash healthbot.sh ${build_dir}"' + shell_command: 'write_yaml_files.py; docker run -u root -v "/var/nita_project:/project:rw" -v "/var/nita_configs:/var/tmp/build:rw" --rm --name ansible juniper/nita-ansible:22.8-1 /bin/bash -c "cd ${WORKSPACE}; bash healthbot.sh ${build_dir}"' diff --git a/nita-cmd/packaging/.gitignore b/nita-cmd/packaging/.gitignore deleted file mode 100644 index 5889ad9..0000000 --- a/nita-cmd/packaging/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -nita-cmd-*/etc -nita-cmd-*/usr -*.deb diff --git a/nita-cmd/packaging/build-nita-cmd-21.7-1.sh b/nita-cmd/packaging/build-nita-cmd-21.7-1.sh deleted file mode 100755 index 7f54edb..0000000 --- a/nita-cmd/packaging/build-nita-cmd-21.7-1.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -# stop the script if a command fails -set -e - -PACKAGE=nita-cmd -VERSION=21.7-1 - -# cleanup version if the directory name is used -VTMP="${VERSION#$PACKAGE-}" -VERSION=${VTMP%/} - - -if [ -z "$VERSION" ]; then - echo "Must provide package version" - exit 1 -fi - -if [ ! -d ${PACKAGE}-${VERSION} ]; then - echo "Directory ${PACKAGE}-${VERSION} does not exist" - exit 1 -fi - -rm -rf ${PACKAGE}-${VERSION}/usr -rm -rf ${PACKAGE}-${VERSION}/etc -mkdir -p ${PACKAGE}-${VERSION}/usr/local/bin -mkdir -p ${PACKAGE}-${VERSION}/etc/bash_completion.d - -( - cd .. - INSTALLDIR=packaging/${PACKAGE}-${VERSION}/usr/local/bin \ - BASH_COMPLETION=packaging/${PACKAGE}-${VERSION}/etc/bash_completion.d \ - bash install.sh -) - -dpkg-deb --build ${PACKAGE}-${VERSION} - diff --git a/nita-cmd/packaging/nita-cmd-21.7-1/DEBIAN/control b/nita-cmd/packaging/nita-cmd-21.7-1/DEBIAN/control deleted file mode 100644 index 361fe16..0000000 --- a/nita-cmd/packaging/nita-cmd-21.7-1/DEBIAN/control +++ /dev/null @@ -1,11 +0,0 @@ -Package: nita-cmd -Version: 21.7-1 -Source: nita-cmd -Section: shells -Priority: extra -Maintainer: Ashley Burston -Build-Depends: bash -Architecture: all -Pre-Depends: dpkg -Depends: jq,docker-ce,bash -Description: NITA command line interface diff --git a/nita-cmd/packaging_redhat/.rpmmacros b/nita-cmd/packaging_redhat/.rpmmacros deleted file mode 100644 index df63b0b..0000000 --- a/nita-cmd/packaging_redhat/.rpmmacros +++ /dev/null @@ -1,3 +0,0 @@ -%_topdir %(echo $RPM_BUILD_DIR) - -%_tmppath %{_topdir}/TMP \ No newline at end of file diff --git a/nita-cmd/packaging_redhat/build-nita-cmd-21.7-1.sh b/nita-cmd/packaging_redhat/build-nita-cmd-21.7-1.sh deleted file mode 100755 index 5dfc98e..0000000 --- a/nita-cmd/packaging_redhat/build-nita-cmd-21.7-1.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash - -# stop the script if a command fails -set -e -set +x - -PACKAGE=nita-cmd -VERSION=21.7 -RELEASE=1 - -# cleanup version if the directory name is used -VTMP="${VERSION#$PACKAGE-}" -VERSION=${VTMP%/} - - -if [[ "x$VERSION" == "x" ]]; then - echo "Must provide package version" - exit 1 -fi - -if [ ! -d ${PACKAGE}-${VERSION}-${RELEASE} ]; then - echo "Directory ${PACKAGE}-${VERSION}-${RELEASE} does not exist" -fi - -export SOURCE_DIR=${PACKAGE}-${VERSION}-${RELEASE}/SOURCES - -# clear the source dir -rm -rf ${SOURCE_DIR}/${PACKAGE}-${VERSION}* - -# make the dest directories -mkdir -p ${SOURCE_DIR}/${PACKAGE}-${VERSION}/usr/local/bin -mkdir -p ${SOURCE_DIR}/${PACKAGE}-${VERSION}/etc/bash_completion.d - -# install the scripts -( - cd .. - export INSTALLDIR=packaging_redhat/${SOURCE_DIR}/${PACKAGE}-${VERSION}/usr/local/bin - export BASH_COMPLETION=packaging_redhat/${SOURCE_DIR}/${PACKAGE}-${VERSION}/etc/bash_completion.d - bash install.sh -) - -# Create a tarball of with source -( - cd ${SOURCE_DIR} - tar czf ${PACKAGE}-${VERSION}.tar.gz ${PACKAGE}-${VERSION} -) - -# Build rpm file -export RPM_BUILD_DIR="${PWD}/${PACKAGE}-${VERSION}-${RELEASE}" -cp .rpmmacros ~ -rpmbuild -ba ${PACKAGE}-${VERSION}-${RELEASE}/SPECS/${PACKAGE}.spec diff --git a/nita-cmd/packaging_redhat/nita-cmd-21.7-1/BUILD/.gitignore b/nita-cmd/packaging_redhat/nita-cmd-21.7-1/BUILD/.gitignore deleted file mode 100644 index c96a04f..0000000 --- a/nita-cmd/packaging_redhat/nita-cmd-21.7-1/BUILD/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore \ No newline at end of file diff --git a/nita-cmd/packaging_redhat/nita-cmd-21.7-1/BUILDROOT/.gitignore b/nita-cmd/packaging_redhat/nita-cmd-21.7-1/BUILDROOT/.gitignore deleted file mode 100644 index c96a04f..0000000 --- a/nita-cmd/packaging_redhat/nita-cmd-21.7-1/BUILDROOT/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore \ No newline at end of file diff --git a/nita-cmd/packaging_redhat/nita-cmd-21.7-1/RPMS/.gitignore b/nita-cmd/packaging_redhat/nita-cmd-21.7-1/RPMS/.gitignore deleted file mode 100644 index c96a04f..0000000 --- a/nita-cmd/packaging_redhat/nita-cmd-21.7-1/RPMS/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore \ No newline at end of file diff --git a/nita-cmd/packaging_redhat/nita-cmd-21.7-1/SOURCES/.gitignore b/nita-cmd/packaging_redhat/nita-cmd-21.7-1/SOURCES/.gitignore deleted file mode 100644 index d6b7ef3..0000000 --- a/nita-cmd/packaging_redhat/nita-cmd-21.7-1/SOURCES/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/nita-cmd/packaging_redhat/nita-cmd-21.7-1/SPECS/nita-cmd.spec b/nita-cmd/packaging_redhat/nita-cmd-21.7-1/SPECS/nita-cmd.spec deleted file mode 100644 index c472bb7..0000000 --- a/nita-cmd/packaging_redhat/nita-cmd-21.7-1/SPECS/nita-cmd.spec +++ /dev/null @@ -1,55 +0,0 @@ -%define __spec_install_post %{nil} -%define debug_package %{nil} -%define __os_install_post %{_dbpath}/brp-compress - -Name: nita-cmd -Version: 21.7 -Release: 1 -Summary: Network Implementation and Test Automation command line interface -Group: Development/Tools -BuildArch: noarch -License: Apache License, Version 2.0, http://www.apache.org/licenses/LICENSE-2.0 -URL: https://www.juniper.net -Source0: %{name}-%{version}.tar.gz - -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root - -%description -Command line interface for NITA docker-compose based cli/web application for doing provisioning and testing of network hardware and software - -%prep -%setup -q - -%build -# Empty section. - -%install -rm -rf %{buildroot} -mkdir -p %{buildroot} -# in builddir -cp -a * %{buildroot} - -%clean -rm -rf %{buildroot} - -%post -ln -s -f %{_prefix}/local/bin/cli_runner %{_prefix}/local/bin/nita - -%preun -rm -f %{_prefix}/local/bin/nita - -%files -%defattr(-,root,root,-) -%{_prefix}/local/bin/* -%{_sysconfdir}/bash_completion.d/nita-cmd -%{_sysconfdir}/bash_completion.d/cli_runner_completions - -%changelog -* Fri Aug 6 2021 Hugo Ribeiro 21.7-1 - - Release bump -* Thu Nov 26 2020 Ashley Burston 20.10-1 - - Release bump -* Fri Jul 24 2020 Hugo Ribeiro 20.7-1 - - Release bump -* Sat May 2 2020 Ashley Burston 20.4-1 - - Initial rpm release diff --git a/nita-cmd/packaging_redhat/nita-cmd-21.7-1/SRPMS/.gitignore b/nita-cmd/packaging_redhat/nita-cmd-21.7-1/SRPMS/.gitignore deleted file mode 100644 index c96a04f..0000000 --- a/nita-cmd/packaging_redhat/nita-cmd-21.7-1/SRPMS/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore \ No newline at end of file diff --git a/nita-cmd/packaging_redhat/nita-cmd-21.7-1/TMP/.gitignore b/nita-cmd/packaging_redhat/nita-cmd-21.7-1/TMP/.gitignore deleted file mode 100644 index c96a04f..0000000 --- a/nita-cmd/packaging_redhat/nita-cmd-21.7-1/TMP/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore \ No newline at end of file diff --git a/nita-cmd/scripts/nita-cmd_cli_version b/nita-cmd/scripts/nita-cmd_cli_version index b85649c..bde34f4 100644 --- a/nita-cmd/scripts/nita-cmd_cli_version +++ b/nita-cmd/scripts/nita-cmd_cli_version @@ -1,5 +1,5 @@ #!/bin/bash -VERSION=21.7 +VERSION=22.8 if [ "$_CLI_RUNNER_DEBUG" == 1 ]; then echo `cat </dev/null 2>&1; then - echo "docker-ce already installed" -else - apt-get -y update - apt-get -y install apt-transport-https ca-certificates curl \ - software-properties-common - curl -fsSL https://download.docker.com/linux/ubuntu/gpg |apt-key add - - apt-key fingerprint 0EBFCD88 - add-apt-repository \ - "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ - $(lsb_release -cs) stable" - apt-get -y update - apt-get -y install docker-ce -fi - -# copy cli scripts -SCRIPTSDIR=${PACKAGE}-${VERSION}/usr/local/bin -rm -rf ${SCRIPTSDIR} -mkdir -p ${SCRIPTSDIR} -install -m 755 ../cli_scripts/* ${SCRIPTSDIR} - -# install nita-cmd -rm -rf ${PACKAGE}-${VERSION}/etc/bash_completion.d -mkdir -p ${PACKAGE}-${VERSION}/etc/bash_completion.d -( - cd ../nita-cmd - BASH_COMPLETION=../packaging/${PACKAGE}-${VERSION}/etc/bash_completion.d \ - INSTALLDIR=../packaging/${SCRIPTSDIR} ../nita-cmd/install.sh -) - -# pull all the required containers -IMAGEDIR=${PACKAGE}-${VERSION}/usr/share/${PACKAGE}/images -mkdir -p ${IMAGEDIR} - -docker pull mariadb:10.4.12 -docker save mariadb:10.4.12 | gzip > ${IMAGEDIR}/mariadb.tar.gz - -docker pull nginx:1.17.9 -docker save nginx:1.17.9 | gzip > ${IMAGEDIR}/nginx.tar.gz - -( - cd .. - ./build_container.sh -) -docker save juniper/nita-webapp:${VERSION} | gzip > ${IMAGEDIR}/nita-webapp.tar.gz - - -dpkg-deb --build ${PACKAGE}-${VERSION} diff --git a/packaging/nita-webapp-21.7-1/DEBIAN/control b/packaging/nita-webapp-21.7-1/DEBIAN/control deleted file mode 100755 index 48aeb31..0000000 --- a/packaging/nita-webapp-21.7-1/DEBIAN/control +++ /dev/null @@ -1,14 +0,0 @@ -Package: nita-webapp -Version: 21.7-1 -Section: base -Priority: optional -Architecture: all -Depends: docker-ce -Maintainer: Ashley Burston , Hugo Ribeiro -Description: Network Implementation and Test Automation - docker-compose based cli/web application for doing provisioning - and testing of network hardware and software. - Copyright 2020 Juniper Networks - Licensed under the Apache License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0 - diff --git a/packaging/nita-webapp-21.7-1/DEBIAN/postinst b/packaging/nita-webapp-21.7-1/DEBIAN/postinst deleted file mode 100755 index b2d2331..0000000 --- a/packaging/nita-webapp-21.7-1/DEBIAN/postinst +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -bash /etc/nita-webapp/install.sh diff --git a/packaging/nita-webapp-21.7-1/DEBIAN/prerm b/packaging/nita-webapp-21.7-1/DEBIAN/prerm deleted file mode 100755 index d54c55f..0000000 --- a/packaging/nita-webapp-21.7-1/DEBIAN/prerm +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -bash /etc/nita-webapp/remove.sh diff --git a/packaging/nita-webapp-21.7-1/etc/nita-webapp/docker-compose.yaml b/packaging/nita-webapp-21.7-1/etc/nita-webapp/docker-compose.yaml deleted file mode 100644 index b1b40f9..0000000 --- a/packaging/nita-webapp-21.7-1/etc/nita-webapp/docker-compose.yaml +++ /dev/null @@ -1,56 +0,0 @@ -# ******************************************************** -# -# Project: nita-webapp -# -# Copyright (c) Juniper Networks, Inc., 2021. All rights reserved. -# -# Notice and Disclaimer: This code is licensed to you under the Apache 2.0 License (the "License"). You may not use this code except in compliance with the License. This code is not an official Juniper product. You can obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0.html -# -# SPDX-License-Identifier: Apache-2.0 -# -# Third-Party Code: This code may depend on other components under separate copyright notice and license terms. Your use of the source code for those components is subject to the terms and conditions of the respective license as noted in the Third-Party source code file. -# -# ******************************************************** - -version: "2.0" -services: - webapp: - image: juniper/nita-webapp:_nita_release_21.7-1 - command: ./build-and-test-webapp/wait-for-db.sh - networks: - - nita-network - depends_on: [ db ] - environment: - - DJANGO_LOG_LEVEL=DEBUG - - WEBAPP_USER - - WEBAPP_PASS - - JENKINS_USER - - JENKINS_PASS - restart: always - db: - image: mariadb:_nita_release_21.7-1 - command: --default-authentication-plugin=mysql_native_password - environment: - MYSQL_DATABASE: Sites - MYSQL_ROOT_PASSWORD: root - networks: - - nita-network - volumes: - - "mariadb:/var/lib/mysql" - restart: always - proxy: - image: nginx:_nita_release_21.7-1 - volumes: - - "/etc/nita-webapp/nginx.conf:/etc/nginx/nginx.conf" - - "/etc/nita-webapp/certificates/:/etc/certificate/" - ports: - - "443:443" - networks: - - nita-network - depends_on: [ webapp ] - restart: always -volumes: - mariadb: -networks: - nita-network: - external: true diff --git a/packaging/nita-webapp-21.7-1/etc/nita-webapp/install.sh b/packaging/nita-webapp-21.7-1/etc/nita-webapp/install.sh deleted file mode 100755 index ac7243f..0000000 --- a/packaging/nita-webapp-21.7-1/etc/nita-webapp/install.sh +++ /dev/null @@ -1,87 +0,0 @@ -#!/bin/bash - -# ******************************************************** -# -# Project: nita-webapp -# -# Copyright (c) Juniper Networks, Inc., 2021. All rights reserved. -# -# Notice and Disclaimer: This code is licensed to you under the Apache 2.0 License (the "License"). You may not use this code except in compliance with the License. This code is not an official Juniper product. You can obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0.html -# -# SPDX-License-Identifier: Apache-2.0 -# -# Third-Party Code: This code may depend on other components under separate copyright notice and license terms. Your use of the source code for those components is subject to the terms and conditions of the respective license as noted in the Third-Party source code file. -# -# ******************************************************** - -PACKAGE=nita-webapp -VERSION=21.7-1 -IMAGES_DIR=/usr/share/${PACKAGE}/images - -# stop the script if a command fails -set -e - -# function to add docker images -function add_image { - - SRC="$1" - TAG="$2" - - echo "Adding docker image $2" - - # load the image - RESPONSE=`docker load -q < ${SRC}` - echo $RESPONSE - ID=`echo ${RESPONSE} | awk -F: '{ print \$3 }'` - - if [[ "x$ID" == "x" ]]; then - echo "Failed to load image $SRC" - exit 1 - fi - - # tag the image if it isn't already tagged in the tar.gz file - # older versions of docker-ce have this issue - if [[ `docker images | awk '{print $1":"$2}' | grep -c "$TAG"` == 0 ]]; then - docker tag "$ID" "$TAG" - fi - - docker tag "$TAG" "${TAG%:*}:_nita_release_$VERSION" - -} - -# Create necessary folders -mkdir -p /etc/${PACKAGE}/certificates -mkdir -p /var/nita_configs -mkdir -p /var/nita_project - -# give the project directory workable permissions -PROJECTDIR=/var/nita_project -chown 0.1000 $PROJECTDIR -chmod 775 $PROJECTDIR - -# generate selfsigned certificate for nginx -if [ -e /etc/${PACKAGE}/certificates/nginx-certificate.crt ] -then - echo "Using existing certificate for webapp https connection" -else - echo "Generation selfsigned certificate for webapp https connection" - openssl req -batch -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/${PACKAGE}/certificates/nginx-certificate-key.key -out /etc/${PACKAGE}/certificates/nginx-certificate.crt -fi - -# load docker images -add_image $IMAGES_DIR/mariadb.tar.gz mariadb:10.4.12 -add_image $IMAGES_DIR/nginx.tar.gz nginx:1.17.9 -add_image $IMAGES_DIR/nita-webapp.tar.gz juniper/nita-webapp:${VERSION} - -# create nita docker network -if [[ `docker network ls -f 'name=nita-network' -q` == '' ]] -then - echo "Creating NITA network" - docker network create -d bridge nita-network -else - echo "NITA network already exists, skipping creation" -fi - -# deploy nita using docker compose -echo "Deploying nita services with docker compose" -docker-compose -p nitawebapp -f /etc/${PACKAGE}/docker-compose.yaml up -d diff --git a/packaging/nita-webapp-21.7-1/etc/nita-webapp/nginx.conf b/packaging/nita-webapp-21.7-1/etc/nita-webapp/nginx.conf deleted file mode 100644 index 5f01541..0000000 --- a/packaging/nita-webapp-21.7-1/etc/nita-webapp/nginx.conf +++ /dev/null @@ -1,35 +0,0 @@ -# ******************************************************** -# -# Project: nita-webapp -# -# Copyright (c) Juniper Networks, Inc., 2021. All rights reserved. -# -# Notice and Disclaimer: This code is licensed to you under the Apache 2.0 License (the "License"). You may not use this code except in compliance with the License. This code is not an official Juniper product. You can obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0.html -# -# SPDX-License-Identifier: Apache-2.0 -# -# Third-Party Code: This code may depend on other components under separate copyright notice and license terms. Your use of the source code for those components is subject to the terms and conditions of the respective license as noted in the Third-Party source code file. -# -# ******************************************************** - -events { - -} - -http { - error_log /etc/nginx/error_log.log warn; - client_max_body_size 20m; - - server { - - location / { - proxy_pass http://webapp:8000; - rewrite ^/webapp(.*)$ $1 break; - } - - listen 8000; - listen 443 ssl; - ssl_certificate /etc/certificate/nginx-certificate.crt; - ssl_certificate_key /etc/certificate/nginx-certificate-key.key; - } -} diff --git a/packaging/nita-webapp-21.7-1/etc/nita-webapp/remove.sh b/packaging/nita-webapp-21.7-1/etc/nita-webapp/remove.sh deleted file mode 100755 index 3827b37..0000000 --- a/packaging/nita-webapp-21.7-1/etc/nita-webapp/remove.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash - -# ******************************************************** -# -# Project: nita-webapp -# -# Copyright (c) Juniper Networks, Inc., 2021. All rights reserved. -# -# Notice and Disclaimer: This code is licensed to you under the Apache 2.0 License (the "License"). You may not use this code except in compliance with the License. This code is not an official Juniper product. You can obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0.html -# -# SPDX-License-Identifier: Apache-2.0 -# -# Third-Party Code: This code may depend on other components under separate copyright notice and license terms. Your use of the source code for those components is subject to the terms and conditions of the respective license as noted in the Third-Party source code file. -# -# ******************************************************** - -PACKAGE=nita-webapp -VERSION=21.7-1 - -# stop the script if a command fails -#set -e -#set -x - -# removing nita using docker compose -docker-compose -p nitawebapp -f /etc/${PACKAGE}/docker-compose.yaml down - -# wait 15 seconds for the containers to exit -sleep 15 - -# remove exited containers: -docker ps --filter status=dead --filter status=exited -aq | xargs -r docker rm -v - -# remove unused volumes: -docker volume ls -qf dangling=true | xargs -r docker volume rm - -# remove docker network -if [[ `docker network ls -f 'name=nita-network' -q` == '' ]] -then - echo "NITA network not present, skipping removal" -else - echo "NITA network found, trying to remove" - if [[ `docker network inspect nita-network | grep "EndpointID"` == '' ]] - then - echo "Removing NITA network" - docker network rm nita-network - else - echo "NITA network is still in use, skipping removal" - fi -fi - -# remove docker images -docker rmi -f mariadb:10.4.12 -docker rmi -f mariadb:_nita_release_$VERSION -docker rmi -f nginx:1.17.9 -docker rmi -f nginx:_nita_release_$VERSION -docker rmi -f juniper/nita-webapp:$VERSION -docker rmi -f juniper/nita-webapp:_nita_release_$VERSION - -# remove unused images -docker images --no-trunc | grep '' | awk '{ print $3 }' | xargs -r docker rmi diff --git a/packaging_redhat/.rpmmacros b/packaging_redhat/.rpmmacros deleted file mode 100644 index df63b0b..0000000 --- a/packaging_redhat/.rpmmacros +++ /dev/null @@ -1,3 +0,0 @@ -%_topdir %(echo $RPM_BUILD_DIR) - -%_tmppath %{_topdir}/TMP \ No newline at end of file diff --git a/packaging_redhat/build-webapp-21.7-1.sh b/packaging_redhat/build-webapp-21.7-1.sh deleted file mode 100755 index 5d3097d..0000000 --- a/packaging_redhat/build-webapp-21.7-1.sh +++ /dev/null @@ -1,99 +0,0 @@ -#!/bin/bash - -# ******************************************************** -# -# Project: nita-webapp -# -# Copyright (c) Juniper Networks, Inc., 2021. All rights reserved. -# -# Notice and Disclaimer: This code is licensed to you under the Apache 2.0 License (the "License"). You may not use this code except in compliance with the License. This code is not an official Juniper product. You can obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0.html -# -# SPDX-License-Identifier: Apache-2.0 -# -# Third-Party Code: This code may depend on other components under separate copyright notice and license terms. Your use of the source code for those components is subject to the terms and conditions of the respective license as noted in the Third-Party source code file. -# -# ******************************************************** - -# stop the script if a command fails -set -e - -PACKAGE=nita-webapp -VERSION=21.7 -RELEASE=1 - -# cleanup version if the directory name is used -VTMP="${VERSION#$PACKAGE-}" -VERSION=${VTMP%/} - - -if [[ "x$VERSION" == "x" ]]; then - echo "Must provide package version" - exit 1 -fi - -if [ ! -d ${PACKAGE}-${VERSION}-${RELEASE} ]; then - echo "Directory ${PACKAGE}-${VERSION}-${RELEASE} does not exist" -fi - -# installing docker-ce on host -if (yum list installed | grep docker-ce) >/dev/null 2>&1; then - echo "docker-ce already installed" -else - yum install -y yum-utils rpm-build - yum-config-manager \ - --add-repo \ - https://download.docker.com/linux/centos/docker-ce.repo - yum update -y - yum install -y docker-ce - systemctl start docker -fi - -SOURCE_DIR=${PACKAGE}-${VERSION}-${RELEASE}/SOURCES - -# copy cli scripts -SCRIPTSDIR=${SOURCE_DIR}/${PACKAGE}-${VERSION}/usr/local/bin -rm -rf ${SCRIPTSDIR} -mkdir -p ${SCRIPTSDIR} -install -m 755 ../cli_scripts/* ${SCRIPTSDIR} - -# install nita-cmd -BASHCOMPLETIONDIR=${SOURCE_DIR}/${PACKAGE}-${VERSION}/etc/bash_completion.d -rm -rf ${BASHCOMPLETIONDIR} -mkdir -p ${BASHCOMPLETIONDIR} -( - cd ../nita-cmd - BASH_COMPLETION=../packaging_redhat/${BASHCOMPLETIONDIR} \ - INSTALLDIR=../packaging_redhat/${SCRIPTSDIR} ../nita-cmd/install.sh -) - -# pull all the required containers -IMAGEDIR=${SOURCE_DIR}/${PACKAGE}-${VERSION}/usr/share/${PACKAGE}/images -mkdir -p ${IMAGEDIR} - -# give the project directory workable permissions -# PROJECTDIR=${SOURCE_DIR}/${PACKAGE}-${VERSION}/var/nita_project -# chown 0.1000 $PROJECTDIR -# chmod 775 $PROJECTDIR - -docker pull mariadb:10.4.12 -docker save mariadb:10.4.12 | gzip > ${IMAGEDIR}/mariadb.tar.gz - -docker pull nginx:1.17.9 -docker save nginx:1.17.9 | gzip > ${IMAGEDIR}/nginx.tar.gz - -( - cd .. - ./build_container.sh -) -docker save juniper/nita-webapp:${VERSION}-${RELEASE} | gzip > ${IMAGEDIR}/nita-webapp.tar.gz - -# Create a tarball of with source -( - cd ${SOURCE_DIR} - tar czf ${PACKAGE}-${VERSION}.tar.gz ${PACKAGE}-${VERSION} -) - -# Build rpm file -export RPM_BUILD_DIR="${PWD}/${PACKAGE}-${VERSION}-${RELEASE}" -cp .rpmmacros ~ -rpmbuild -ba ${PACKAGE}-${VERSION}-${RELEASE}/SPECS/${PACKAGE}.spec diff --git a/packaging_redhat/nita-webapp-21.7-1/BUILD/.gitignore b/packaging_redhat/nita-webapp-21.7-1/BUILD/.gitignore deleted file mode 100644 index c96a04f..0000000 --- a/packaging_redhat/nita-webapp-21.7-1/BUILD/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore \ No newline at end of file diff --git a/packaging_redhat/nita-webapp-21.7-1/BUILDROOT/.gitignore b/packaging_redhat/nita-webapp-21.7-1/BUILDROOT/.gitignore deleted file mode 100644 index c96a04f..0000000 --- a/packaging_redhat/nita-webapp-21.7-1/BUILDROOT/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore \ No newline at end of file diff --git a/packaging_redhat/nita-webapp-21.7-1/RPMS/.gitignore b/packaging_redhat/nita-webapp-21.7-1/RPMS/.gitignore deleted file mode 100644 index c96a04f..0000000 --- a/packaging_redhat/nita-webapp-21.7-1/RPMS/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore \ No newline at end of file diff --git a/packaging_redhat/nita-webapp-21.7-1/SOURCES/.gitignore b/packaging_redhat/nita-webapp-21.7-1/SOURCES/.gitignore deleted file mode 100644 index 287f298..0000000 --- a/packaging_redhat/nita-webapp-21.7-1/SOURCES/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -!.gitignore -*.tar.gz -nita-*/usr/local/bin/* \ No newline at end of file diff --git a/packaging_redhat/nita-webapp-21.7-1/SOURCES/nita-webapp-21.7/etc/nita-webapp/docker-compose.yaml b/packaging_redhat/nita-webapp-21.7-1/SOURCES/nita-webapp-21.7/etc/nita-webapp/docker-compose.yaml deleted file mode 100644 index b1b40f9..0000000 --- a/packaging_redhat/nita-webapp-21.7-1/SOURCES/nita-webapp-21.7/etc/nita-webapp/docker-compose.yaml +++ /dev/null @@ -1,56 +0,0 @@ -# ******************************************************** -# -# Project: nita-webapp -# -# Copyright (c) Juniper Networks, Inc., 2021. All rights reserved. -# -# Notice and Disclaimer: This code is licensed to you under the Apache 2.0 License (the "License"). You may not use this code except in compliance with the License. This code is not an official Juniper product. You can obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0.html -# -# SPDX-License-Identifier: Apache-2.0 -# -# Third-Party Code: This code may depend on other components under separate copyright notice and license terms. Your use of the source code for those components is subject to the terms and conditions of the respective license as noted in the Third-Party source code file. -# -# ******************************************************** - -version: "2.0" -services: - webapp: - image: juniper/nita-webapp:_nita_release_21.7-1 - command: ./build-and-test-webapp/wait-for-db.sh - networks: - - nita-network - depends_on: [ db ] - environment: - - DJANGO_LOG_LEVEL=DEBUG - - WEBAPP_USER - - WEBAPP_PASS - - JENKINS_USER - - JENKINS_PASS - restart: always - db: - image: mariadb:_nita_release_21.7-1 - command: --default-authentication-plugin=mysql_native_password - environment: - MYSQL_DATABASE: Sites - MYSQL_ROOT_PASSWORD: root - networks: - - nita-network - volumes: - - "mariadb:/var/lib/mysql" - restart: always - proxy: - image: nginx:_nita_release_21.7-1 - volumes: - - "/etc/nita-webapp/nginx.conf:/etc/nginx/nginx.conf" - - "/etc/nita-webapp/certificates/:/etc/certificate/" - ports: - - "443:443" - networks: - - nita-network - depends_on: [ webapp ] - restart: always -volumes: - mariadb: -networks: - nita-network: - external: true diff --git a/packaging_redhat/nita-webapp-21.7-1/SOURCES/nita-webapp-21.7/etc/nita-webapp/install.sh b/packaging_redhat/nita-webapp-21.7-1/SOURCES/nita-webapp-21.7/etc/nita-webapp/install.sh deleted file mode 100755 index 52f7895..0000000 --- a/packaging_redhat/nita-webapp-21.7-1/SOURCES/nita-webapp-21.7/etc/nita-webapp/install.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/bash - -# ******************************************************** -# -# Project: nita-webapp -# -# Copyright (c) Juniper Networks, Inc., 2021. All rights reserved. -# -# Notice and Disclaimer: This code is licensed to you under the Apache 2.0 License (the "License"). You may not use this code except in compliance with the License. This code is not an official Juniper product. You can obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0.html -# -# SPDX-License-Identifier: Apache-2.0 -# -# Third-Party Code: This code may depend on other components under separate copyright notice and license terms. Your use of the source code for those components is subject to the terms and conditions of the respective license as noted in the Third-Party source code file. -# -# ******************************************************** - -PACKAGE=nita-webapp -VERSION=21.7-1 -IMAGES_DIR=/usr/share/${PACKAGE}/images - -# stop the script if a command fails -set -e - -# function to add docker images -function add_image { - - SRC="$1" - TAG="$2" - - echo "Adding docker image $2" - - # load the image - RESPONSE=`docker load -q < ${SRC}` - echo $RESPONSE - ID=`echo ${RESPONSE} | awk -F: '{ print \$3 }'` - - if [[ "x$ID" == "x" ]]; then - echo "Failed to load image $SRC" - exit 1 - fi - - # tag the image if it isn't already tagged in the tar.gz file - # older versions of docker-ce have this issue - if [[ `docker images | awk '{print $1":"$2}' | grep -c "$TAG"` == 0 ]]; then - docker tag "$ID" "$TAG" - fi - - docker tag "$TAG" "${TAG%:*}:_nita_release_$VERSION" - -} - -# generate selfsigned certificate for nginx -if [ -e /etc/${PACKAGE}/certificates/nginx-certificate.crt ] -then - echo "Using existing certificate for webapp https connection" -else - echo "Generation selfsigned certificate for webapp https connection" - openssl req -batch -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/${PACKAGE}/certificates/nginx-certificate-key.key -out /etc/${PACKAGE}/certificates/nginx-certificate.crt -fi - -# load docker images -add_image $IMAGES_DIR/mariadb.tar.gz mariadb:10.4.12 -add_image $IMAGES_DIR/nginx.tar.gz nginx:1.17.9 -add_image $IMAGES_DIR/nita-webapp.tar.gz juniper/nita-webapp:${VERSION} - -# create nita docker network -if [[ `docker network ls -f 'name=nita-network' -q` == '' ]] -then - echo "Creating NITA network" - docker network create -d bridge nita-network -else - echo "NITA network already exists, skipping creation" -fi - -# deploy nita using docker compose -echo "Deploying nita services with docker compose" -docker-compose -p nitawebapp -f /etc/${PACKAGE}/docker-compose.yaml up -d diff --git a/packaging_redhat/nita-webapp-21.7-1/SOURCES/nita-webapp-21.7/etc/nita-webapp/nginx.conf b/packaging_redhat/nita-webapp-21.7-1/SOURCES/nita-webapp-21.7/etc/nita-webapp/nginx.conf deleted file mode 100644 index 5f01541..0000000 --- a/packaging_redhat/nita-webapp-21.7-1/SOURCES/nita-webapp-21.7/etc/nita-webapp/nginx.conf +++ /dev/null @@ -1,35 +0,0 @@ -# ******************************************************** -# -# Project: nita-webapp -# -# Copyright (c) Juniper Networks, Inc., 2021. All rights reserved. -# -# Notice and Disclaimer: This code is licensed to you under the Apache 2.0 License (the "License"). You may not use this code except in compliance with the License. This code is not an official Juniper product. You can obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0.html -# -# SPDX-License-Identifier: Apache-2.0 -# -# Third-Party Code: This code may depend on other components under separate copyright notice and license terms. Your use of the source code for those components is subject to the terms and conditions of the respective license as noted in the Third-Party source code file. -# -# ******************************************************** - -events { - -} - -http { - error_log /etc/nginx/error_log.log warn; - client_max_body_size 20m; - - server { - - location / { - proxy_pass http://webapp:8000; - rewrite ^/webapp(.*)$ $1 break; - } - - listen 8000; - listen 443 ssl; - ssl_certificate /etc/certificate/nginx-certificate.crt; - ssl_certificate_key /etc/certificate/nginx-certificate-key.key; - } -} diff --git a/packaging_redhat/nita-webapp-21.7-1/SOURCES/nita-webapp-21.7/etc/nita-webapp/remove.sh b/packaging_redhat/nita-webapp-21.7-1/SOURCES/nita-webapp-21.7/etc/nita-webapp/remove.sh deleted file mode 100755 index 3827b37..0000000 --- a/packaging_redhat/nita-webapp-21.7-1/SOURCES/nita-webapp-21.7/etc/nita-webapp/remove.sh +++ /dev/null @@ -1,60 +0,0 @@ -#!/bin/bash - -# ******************************************************** -# -# Project: nita-webapp -# -# Copyright (c) Juniper Networks, Inc., 2021. All rights reserved. -# -# Notice and Disclaimer: This code is licensed to you under the Apache 2.0 License (the "License"). You may not use this code except in compliance with the License. This code is not an official Juniper product. You can obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0.html -# -# SPDX-License-Identifier: Apache-2.0 -# -# Third-Party Code: This code may depend on other components under separate copyright notice and license terms. Your use of the source code for those components is subject to the terms and conditions of the respective license as noted in the Third-Party source code file. -# -# ******************************************************** - -PACKAGE=nita-webapp -VERSION=21.7-1 - -# stop the script if a command fails -#set -e -#set -x - -# removing nita using docker compose -docker-compose -p nitawebapp -f /etc/${PACKAGE}/docker-compose.yaml down - -# wait 15 seconds for the containers to exit -sleep 15 - -# remove exited containers: -docker ps --filter status=dead --filter status=exited -aq | xargs -r docker rm -v - -# remove unused volumes: -docker volume ls -qf dangling=true | xargs -r docker volume rm - -# remove docker network -if [[ `docker network ls -f 'name=nita-network' -q` == '' ]] -then - echo "NITA network not present, skipping removal" -else - echo "NITA network found, trying to remove" - if [[ `docker network inspect nita-network | grep "EndpointID"` == '' ]] - then - echo "Removing NITA network" - docker network rm nita-network - else - echo "NITA network is still in use, skipping removal" - fi -fi - -# remove docker images -docker rmi -f mariadb:10.4.12 -docker rmi -f mariadb:_nita_release_$VERSION -docker rmi -f nginx:1.17.9 -docker rmi -f nginx:_nita_release_$VERSION -docker rmi -f juniper/nita-webapp:$VERSION -docker rmi -f juniper/nita-webapp:_nita_release_$VERSION - -# remove unused images -docker images --no-trunc | grep '' | awk '{ print $3 }' | xargs -r docker rmi diff --git a/packaging_redhat/nita-webapp-21.7-1/SPECS/nita-webapp.spec b/packaging_redhat/nita-webapp-21.7-1/SPECS/nita-webapp.spec deleted file mode 100644 index b304b6c..0000000 --- a/packaging_redhat/nita-webapp-21.7-1/SPECS/nita-webapp.spec +++ /dev/null @@ -1,83 +0,0 @@ -# ******************************************************** -# -# Project: nita-webapp -# -# Copyright (c) Juniper Networks, Inc., 2021. All rights reserved. -# -# Notice and Disclaimer: This code is licensed to you under the Apache 2.0 License (the "License"). You may not use this code except in compliance with the License. This code is not an official Juniper product. You can obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0.html -# -# SPDX-License-Identifier: Apache-2.0 -# -# Third-Party Code: This code may depend on other components under separate copyright notice and license terms. Your use of the source code for those components is subject to the terms and conditions of the respective license as noted in the Third-Party source code file. -# -# ******************************************************** - -%define __spec_install_post %{nil} -%define debug_package %{nil} -%define __os_install_post %{_dbpath}/brp-compress - -Name: nita-webapp -Version: 21.7 -Release: 1 -Summary: Network Implementation and Test Automation - Webapp -Group: Development/Tools -BuildArch: noarch -License: Apache License, Version 2.0, http://www.apache.org/licenses/LICENSE-2.0 -URL: https://www.juniper.net -Source0: %{name}-%{version}.tar.gz -Requires: docker-ce - -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root - -%description -Network Implementation and Test Automation docker-compose based cli/web application for doing provisioning and testing of network hardware and software - -%pre -if [ $(getenforce) != Permissive ]; then echo "****** Please disable SELinux during instalation (setenforce 0) ******"; exit 1; fi - -%prep -%setup -q - -%build -# Empty section. - -%install -rm -rf %{buildroot} -mkdir -p %{buildroot} -# in builddir -cp -a * %{buildroot} - -%clean -rm -rf %{buildroot} - -%post -mkdir -p %{_sysconfdir}/%{name}/certificates -mkdir -p /var/nita_configs -mkdir -p /var/nita_project -chmod 775 /var/nita_project -chgrp 1000 /var/nita_project -%{_sysconfdir}/%{name}/install.sh - -%preun -if [ $(getenforce) != Permissive ]; then echo "****** Please disable SELinux during removal (setenforce 0) ******"; exit 1; fi -%{_sysconfdir}/%{name}/remove.sh - -%files -%defattr(-,root,root,-) -%config(noreplace) %{_sysconfdir}/%{name}/docker-compose.yaml -%config(noreplace) %{_sysconfdir}/%{name}/nginx.conf -%{_sysconfdir}/%{name}/install.sh -%{_sysconfdir}/%{name}/remove.sh -%{_datadir}/%{name}/* -%{_prefix}/local/bin/* -%{_sysconfdir}/bash_completion.d/cli_runner_completions -%{_sysconfdir}/bash_completion.d/nita-cmd - -%changelog -* Fri Aug 6 2021 Hugo Ribeiro 21.7-1 - - Loads of security advisories, please use this version to avoid security problems in 20.10. - - Upgraded django and openpyxl. - - Removed dependency on xlrd. - - Made it possible to configure the Jenkins password more easily. -* Wed Sep 23 2020 Hugo Ribeiro 20.10-1 - - OS Release diff --git a/packaging_redhat/nita-webapp-21.7-1/SRPMS/.gitignore b/packaging_redhat/nita-webapp-21.7-1/SRPMS/.gitignore deleted file mode 100644 index c96a04f..0000000 --- a/packaging_redhat/nita-webapp-21.7-1/SRPMS/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore \ No newline at end of file diff --git a/packaging_redhat/nita-webapp-21.7-1/TMP/.gitignore b/packaging_redhat/nita-webapp-21.7-1/TMP/.gitignore deleted file mode 100644 index c96a04f..0000000 --- a/packaging_redhat/nita-webapp-21.7-1/TMP/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 528f49c..5545d76 100644 --- a/requirements.txt +++ b/requirements.txt @@ -18,4 +18,4 @@ certifi requests==2.20.0 jdcal==1.4.1 jinja2==2.11.3 -nita-yaml-to-excel-21.7/ +nita-yaml-to-excel-22.8/