From 00bd7aa1794a71388cb323f524926958e0dd25c7 Mon Sep 17 00:00:00 2001 From: vagrant Date: Sat, 20 Jan 2018 15:12:44 +0000 Subject: snmptrap collector dockerization Issue-ID: DCAEGEN2-228 Change-Id: I118a4c62452a53f647fc868c5cac9bd2b19730ae Signed-off-by: Vijay VK --- Dockerfile | 30 ++++++++++++++++++++++++++++++ mvn-phase-script.sh | 30 ++++-------------------------- pom.xml | 5 ++--- version.properties | 2 +- 4 files changed, 37 insertions(+), 30 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e4806c3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +# Use an official Python runtime as a base image +FROM python:3.6 + +ENV INSROOT /opt/app +ENV APPUSER snmptrap +ENV APPDIR ${INSROOT}/${APPUSER} + +RUN useradd -d ${APPDIR} ${APPUSER} + +WORKDIR ${APPDIR} + +EXPOSE 162 + +# Copy the current directory contents into the container at ${APPDIR} +COPY ./src/ ./bin/ +COPY ./etc/ ./etc/ + +RUN mkdir -p ${APPDIR}/logs \ + && chown -R ${APPUSER}:${APPUSER} ${APPDIR} \ + && chmod a+w ${APPDIR}/logs \ + && chmod 500 ${APPDIR}/etc \ + && chmod 500 ${APPDIR}/bin/dcae_snmptrapd.sh + + +USER ${APPUSER} + +VOLUME ${APPDIR}/logs + +# Run run_policy.sh when the container launches +CMD ["./bin/dcae_snmptrapd.sh"] diff --git a/mvn-phase-script.sh b/mvn-phase-script.sh index 80ca660..edfbed0 100755 --- a/mvn-phase-script.sh +++ b/mvn-phase-script.sh @@ -56,10 +56,10 @@ if [ -z "$WORKSPACE" ]; then WORKSPACE=$(pwd) fi -if [ -z "$SETTINGS_FILE" ]; then - echo "SETTINGS_FILE environment variable not set. Cannot proceed" - exit -fi +#if [ -z "$SETTINGS_FILE" ]; then +# echo "SETTINGS_FILE environment variable not set. Cannot proceed" +# exit +#fi @@ -116,31 +116,9 @@ deploy) # copy the ones suitable for your repo, and remove the "if false" statement # build docker image from Docker file (under root of repo) and push to registry - if false ; then build_and_push_docker - fi # upload all yaml file under the root of repo - if false ; then - upload_files_of_extension yaml - fi - - if false ; then - case $MVN_PROJECT_MODULEID in - bootstrap) - # build docker image from Docker file (under module dir) and push to registry - build_and_push_docker - ;; - scripts) - # upload all sh file under the root of module - upload_files_of_extension sh - ;; - *) - echo "====> unknown mvn project module" - ;; - esac - fi - ;; *) echo "==> unprocessed phase" diff --git a/pom.xml b/pom.xml index b50c61f..5f3acab 100644 --- a/pom.xml +++ b/pom.xml @@ -23,15 +23,14 @@ ECOMP is a trademark and service mark of AT&T Intellectual Property. org.onap.oparent oparent - 1.1.0-SNAPSHOT + 0.1.1 org.onap.dcaegen2.collectors snmptrap dcaegen2-collectors-snmptrap - - 1.1.0-SNAPSHOT + 1.2.0-SNAPSHOT http://maven.apache.org UTF-8 diff --git a/version.properties b/version.properties index 73415a7..07578e5 100644 --- a/version.properties +++ b/version.properties @@ -1,5 +1,5 @@ major=1 -minor=1 +minor=2 patch=0 base_version=${major}.${minor}.${patch} release_version=${base_version} -- cgit 1.2.3-korg