diff --git a/build-debian-packages-telegraf.groovy b/build-debian-packages-telegraf.groovy
new file mode 100644
index 0000000..5434ff3
--- /dev/null
+++ b/build-debian-packages-telegraf.groovy
@@ -0,0 +1,102 @@
+def common = new com.mirantis.mk.Common()
+def git = new com.mirantis.mk.Git()
+def artifactory = new com.mirantis.mk.Artifactory()
+def aptly = new com.mirantis.mk.Aptly()
+
+def timestamp = common.getDatetime()
+def version = timestamp
+
+node('docker') {
+    try{
+
+        stage("cleanup") {
+            sh("rm -rf * || true")
+        }
+
+        def workingDir = "src/github.com/influxdata"
+        stage("checkout") {
+            git.checkoutGitRepository(
+                "${workingDir}/telegraf",
+                "${SOURCE_URL}/telegraf",
+                SOURCE_BRANCH,
+                SOURCE_CREDENTIALS,
+                true,
+                30,
+                1
+            )
+        }
+
+        try {
+
+            def jenkinsUID = sh (
+                script: 'id -u',
+                returnStdout: true
+            ).trim()
+            def imgName = "${OS}-${DIST}-${ARCH}"
+            def img
+
+            stage("build image") {
+                img = docker.build(
+                    "${imgName}:${timestamp}",
+                    [
+                        "--build-arg uid=${jenkinsUID}",
+                        "--build-arg timestamp=${timestamp}",
+                        "-f ${workingDir}/telegraf/docker/${OS}-${DIST}-${ARCH}.Dockerfile",
+                        "docker"
+                    ].join(' ')
+                )
+            }
+            stage("build package") {
+                img.inside{
+                    sh("wget https://storage.googleapis.com/golang/go1.8.1.linux-amd64.tar.gz &&
+                        tar xf go1.8.1.linux-amd64.tar.gz &&
+                        export GOROOT=$PWD/go &&
+                        export PATH=$PATH:$GOROOT/bin &&
+                        export GOPATH=$PWD &&
+                        cd src/github.com/influxdata/telegraf &&
+                        scripts/build.py --package --version=\"${version}\" --platform=linux --arch=amd64")
+                }
+                archiveArtifacts artifacts: "${workingDir}/*.deb"
+            }
+            lock("aptly-api") {
+                stage("upload") {
+                    def buildSteps = [:]
+                    def debFiles = sh script: "ls ${workingDir}/telegraf/build/*.deb", returnStdout: true
+                    def debFilesArray = debFiles.trim().tokenize()
+                    for (int i = 0; i < debFilesArray.size(); i++) {
+
+                        def debFile = debFiles[i];
+                        buildSteps[debFiles[i]] = aptly.uploadPackageStep(
+                            "${workingDir}/telegraf/build/"+debFile,
+                            APTLY_URL,
+                            APTLY_REPO,
+                            true
+                        )
+                    }
+                    parallel buildSteps
+                }
+                stage("publish") {
+                    aptly.snapshotRepo(APTLY_URL, APTLY_REPO, timestamp)
+                    aptly.publish(APTLY_URL)
+                }
+            }
+
+        } catch (Exception e) {
+            currentBuild.result = 'FAILURE'
+            println "Cleaning up docker images"
+            sh("docker images | grep -E '[-:\\ ]+${timestamp}[\\.\\ /\$]+' | awk '{print \$3}' | xargs docker rmi -f || true")
+            throw e
+        }
+
+    } catch (Throwable e) {
+       // If there was an exception thrown, the build failed
+       currentBuild.result = "FAILURE"
+       throw e
+    } finally {
+       common.sendNotification(currentBuild.result,"",["slack"])
+
+       if (currentBuild.result != 'FAILURE') {
+          sh("rm -rf *")
+       }
+    }
+}
