Here we will show you how to setup APPC build environment on Ubuntu 16.04
- Reference links
- Install and setup Docker
sudo apt update -y
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common wget zip
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt update -y
sudo apt install -y docker-ce
sudo apt-get install -y docker-compose
sudo usermod -aG docker $USER
Note: You should logout and login back to execute docker commands
- Install Java & Maven
sudo apt update
sudo apt install openjdk-8-jdk openjdk-8-jre -y
sudo apt install maven -y
bash -c 'echo export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 >> ~/.bashrc'
- Setup local maven repository
mkdir -p $HOME/.m2
Download and copy settings.xml settings.xml to $HOME/.m2 folder - Clone APPC git repository
mkdir -p $HOME/ONAP-APPC
cd $HOME/ONAP-APPC
# APPC Core projects
# TODO : For now we are using the Casablanca maintenance release tag 3.0.1-ONAPgit clone -b 3.0.1-ONAP https://github.com/onap/appc-parent
git clone -b 3.0.1-ONAP https://gerrit.onap.org/r/appc
# This for building APPC docker images
git clone -b 3.0.1-ONAP https://gerrit.onap.org/r/appc/deployment
Build appc-parent
cd $HOME/ONAP-APPC/appc-parent
# We need to increment minor version in the following POM files
# Execute the following command to increment the minor version from 1.4.1-SNAPSHOT to 1.4.2-SNAPSHOT
find . -name "pom.xml" | xargs sed -i 's|1.4.1-SNAPSHOT|1.4.2-SNAPSHOT|g'
# Use the following command verify the list of files updated
grep -ril '1.4.2-SNAPSHOT'
# Updated the CCSDK parent artifact "org.onap.ccsdk.parent" version should like the below one
# Replace '1.1.3' with 1.2.2 using the below command, otherwise we can use vi or other text editor to the same
find . -name pom.xml | xargs sed -i 's|1.1.3|1.2.2|g'
#vi ./feature-repo-parent/pom.xml
#vi ./binding-parent/pom.xml
#vi ./bundle-parent/pom.xml
#vi ./pom.xml
#vi ./single-feature-parent/pom.xml
#vi ./odlparent-lite/pom.xml
# This is to use the CCSDK with ODL Fluorine SR2 release
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>odlparent-lite</artifactId>
<version>1.2.2</version>
<relativePath />
</parent>
# Now, build the parent project. It would sometime and we should wait for this one to get completed.
mvn clean install -DskipTests | tee appc-parent-build.log
- Build appc core project
cd $HOME/ONAP-APPC/appc
# We should first refer new local release version of the appc-parent components under <groupId>org.onap.appc.parent</groupId>
# We should update 1.4.1 to 1.4.2-SNAPSHOT using the below command
grep -ril 'org.onap.appc.parent' * | xargs sed -i 's|1.4.1|1.4.2-SNAPSHOT|g'
# Build the APPC project and this will take a while to complete the entire build
mvn clean install -DskipTests -e | tee -a appc-build.log
- Build appc deployment project (This is responsible to build APPC docker images)
# First pull the ccsdk-odlsli-image for ODL Fluorine SR2 release. This will take some time
docker pull nexus3.onap.org:10001/onap/ccsdk-odlsli-image:0.4.4
# Edit the below file with the latest version of ccsdk-odlsli-image
# vi ./installation/appc/src/main/docker/Dockerfile
# You can use the below command to replace the image version
cd $HOME/ONAP-APPC/deployment
sed -i 's|FROM onap/ccsdk-odlsli-image:0.3.3|FROM onap/ccsdk-odlsli-image:0.4.4|g' ./installation/appc/src/main/docker/Dockerfile
# Now, run the maven build
mvn clean install -DskipTests | tee -a appc-deployment-build.log
# Execute docker image create command
mvn clean install -P docker -DskipTests | tee -a appc-deployment-docker-image-build.log
- TODO