Skip to content

Commit

Permalink
Add temporary patches directory containing remaining patches
Browse files Browse the repository at this point in the history
  • Loading branch information
richardbadman committed Sep 16, 2022
1 parent 3bc38b3 commit d4d9d3d
Show file tree
Hide file tree
Showing 22 changed files with 1,545 additions and 0 deletions.
13 changes: 13 additions & 0 deletions solr/patches/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Other patches

The directories here contain the remaining patches that I didn't apply;
- misc
- unsure

## Misc

These typically contain the patches that are used for Dockerfile / Jenkins _(which has been completely skipped here)_

## Unsure

This contains patches which I wasn't 100% sure on, could be because the patch contents no longer exist, unsure if we need them _(for example a missing test case exists on 8.11.2 , but might not have on 7.7.2 hence the patch)_ etc.,
90 changes: 90 additions & 0 deletions solr/patches/misc/0008-Dockerfile-for-solr-build.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
From 8e523bc3aba4f9a283fb6ebf2e5985de3da5b7c3 Mon Sep 17 00:00:00 2001
From: Sergey Egorov <[email protected]>
Date: Mon, 13 Aug 2018 16:01:02 +0100
Subject: [PATCH 08/83] Dockerfile for solr build

---
Dockerfile | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 70 insertions(+)
create mode 100644 Dockerfile

diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000000..e8db5be772
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,70 @@
+FROM debian:jessie
+
+ARG buildn
+ARG pass
+
+ENV BUILD_NUMBER=$buildn
+ENV SOLR_VERSION=7.4.0
+ENV PASS=$pass
+
+RUN echo $SOLR_VERSION
+RUN echo $BUILD_NUMBER
+
+USER root
+
+RUN echo "deb http://http.debian.net/debian jessie-backports main" | \
+ tee --append /etc/apt/sources.list.d/jessie-backports.list > /dev/null && \
+ apt-get update -y && \
+ apt-get install -y \
+ wget \
+ curl \
+ ruby \
+ ruby-dev \
+ rubygems \
+ build-essential \
+ git-core && \
+ apt-get install -y -t jessie-backports openjdk-8-jdk && \
+ update-java-alternatives -s java-1.8.0-openjdk-amd64 && \
+ apt-get upgrade -y
+
+RUN export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64
+
+RUN gem install fpm
+RUN fpm --version
+
+#Installing Apache Ant
+RUN wget http://archive.apache.org/dist/ant/binaries/apache-ant-1.10.5-bin.tar.gz
+RUN wget https://www.apache.org/dist/ant/KEYS
+RUN wget https://www.apache.org/dist/ant/binaries/apache-ant-1.10.5-bin.tar.gz.asc
+
+#Verify download signature
+RUN gpg --import KEYS
+RUN gpg --verify apache-ant-1.10.5-bin.tar.gz.asc
+
+#Unpack
+RUN tar xvfvz apache-ant-1.10.5-bin.tar.gz
+
+RUN mv apache-ant-1.10.5 /opt/ant
+RUN echo ANT_HOME=/opt/ant >> /etc/environment
+RUN ln -s /opt/ant/bin/ant /usr/bin/ant
+
+#Installing Apache Ivy from git repository
+RUN git clone https://git-wip-us.apache.org/repos/asf/ant-ivy.git
+WORKDIR /ant-ivy
+RUN ant jar
+WORKDIR /ant-ivy/build/artifact/jars
+RUN scp ivy.jar /opt/ant/lib
+
+WORKDIR /usr/local
+ADD . bw-lucene-solr/
+WORKDIR /usr/local/bw-lucene-solr/solr
+RUN ant ivy-bootstrap && \
+ ant clean compile dist package
+
+
+WORKDIR /usr/local/bw-lucene-solr/solr/package
+
+
+RUN fpm --description "Brandwatch Solr distribution" --name solr -v $SOLR_VERSION-SNAPSHOT-bwbuild${BUILD_NUMBER} --prefix /opt -s tar -t deb solr-$SOLR_VERSION-SNAPSHOT.tgz
+RUN curl http://apt.service0.btn1.bwcom.net/packages -u $PASS -F my_file=@solr_$SOLR_VERSION-SNAPSHOT-bwbuild${BUILD_NUMBER}_amd64.deb -F name=solr_$SOLR_VERSION-SNAPSHOT-bwbuild${BUILD_NUMBER}_amd64.deb
+RUN curl https://aptly.stage.brandwatch.net/packages -u $PASS -F my_file=@solr_$SOLR_VERSION-SNAPSHOT-bwbuild${BUILD_NUMBER}_amd64.deb -F name=solr_$SOLR_VERSION-SNAPSHOT-bwbuild${BUILD_NUMBER}_amd64.deb
\ No newline at end of file
--
2.32.1 (Apple Git-133)

46 changes: 46 additions & 0 deletions solr/patches/misc/0009-Split-pass-for-stage-and-Int.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
From 3af585fce0a7d2e42154126c4e0e47aaa14e1311 Mon Sep 17 00:00:00 2001
From: Sergey Egorov <[email protected]>
Date: Mon, 13 Aug 2018 16:16:11 +0100
Subject: [PATCH 09/83] Split pass for stage and Int

---
Dockerfile | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index e8db5be772..cf12c6c793 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,11 +1,17 @@
FROM debian:jessie

ARG buildn
-ARG pass
+
+ARG stage
+ARG int

ENV BUILD_NUMBER=$buildn
ENV SOLR_VERSION=7.4.0
-ENV PASS=$pass
+
+
+ENV STAGE=$stage
+ENV INT=$int
+

RUN echo $SOLR_VERSION
RUN echo $BUILD_NUMBER
@@ -66,5 +72,5 @@ WORKDIR /usr/local/bw-lucene-solr/solr/package


RUN fpm --description "Brandwatch Solr distribution" --name solr -v $SOLR_VERSION-SNAPSHOT-bwbuild${BUILD_NUMBER} --prefix /opt -s tar -t deb solr-$SOLR_VERSION-SNAPSHOT.tgz
-RUN curl http://apt.service0.btn1.bwcom.net/packages -u $PASS -F my_file=@solr_$SOLR_VERSION-SNAPSHOT-bwbuild${BUILD_NUMBER}_amd64.deb -F name=solr_$SOLR_VERSION-SNAPSHOT-bwbuild${BUILD_NUMBER}_amd64.deb
-RUN curl https://aptly.stage.brandwatch.net/packages -u $PASS -F my_file=@solr_$SOLR_VERSION-SNAPSHOT-bwbuild${BUILD_NUMBER}_amd64.deb -F name=solr_$SOLR_VERSION-SNAPSHOT-bwbuild${BUILD_NUMBER}_amd64.deb
\ No newline at end of file
+RUN curl http://apt.service0.btn1.bwcom.net/packages -u $INT -F my_file=@solr_$SOLR_VERSION-SNAPSHOT-bwbuild${BUILD_NUMBER}_amd64.deb -F name=solr_$SOLR_VERSION-SNAPSHOT-bwbuild${BUILD_NUMBER}_amd64.deb
+RUN curl https://aptly.stage.brandwatch.net/packages -u $STAGE -F my_file=@solr_$SOLR_VERSION-SNAPSHOT-bwbuild${BUILD_NUMBER}_amd64.deb -F name=solr_$SOLR_VERSION-SNAPSHOT-bwbuild${BUILD_NUMBER}_amd64.deb
\ No newline at end of file
--
2.32.1 (Apple Git-133)

35 changes: 35 additions & 0 deletions solr/patches/misc/0025-Add-base-Jenkinsfile-to-repo.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
From 3e0c74da9d7ec1738599d4a7e40b760422068ca1 Mon Sep 17 00:00:00 2001
From: Richard Goodman <[email protected]>
Date: Mon, 18 May 2020 12:28:48 +0100
Subject: [PATCH 25/83] Add base Jenkinsfile to repo

---
Jenkinsfile | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
create mode 100644 Jenkinsfile

diff --git a/Jenkinsfile b/Jenkinsfile
new file mode 100644
index 0000000000..ce1fd0e42c
--- /dev/null
+++ b/Jenkinsfile
@@ -0,0 +1,16 @@
+#!groovy
+
+node('docker') {
+ stage ('Checkout') {
+ checkout([
+ $class: 'GitSCM',
+ branches: scm.branches,
+ doGenerateSubmoduleConfigurations: scm.doGenerateSubmoduleConfigurations,
+ extensions: scm.extensions + [[$class: 'CleanCheckout']],
+ userRemoteConfigs: scm.userRemoteConfigs
+ ])
+ test = sh(script: 'printenv', returnStdout: true)
+ echo "${test}"
+ echo "Test: ..." + env.BRANCH_NAME
+ }
+}
--
2.32.1 (Apple Git-133)

33 changes: 33 additions & 0 deletions solr/patches/misc/0026-Fleshed-out-Jenkinsfile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From e2064b28e3a0abf744f7c133cfbbadee73111795 Mon Sep 17 00:00:00 2001
From: Richard Goodman <[email protected]>
Date: Mon, 18 May 2020 12:46:18 +0100
Subject: [PATCH 26/83] Fleshed out Jenkinsfile

---
Jenkinsfile | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index ce1fd0e42c..6cbf0c53b9 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -9,8 +9,13 @@ node('docker') {
extensions: scm.extensions + [[$class: 'CleanCheckout']],
userRemoteConfigs: scm.userRemoteConfigs
])
- test = sh(script: 'printenv', returnStdout: true)
- echo "${test}"
- echo "Test: ..." + env.BRANCH_NAME
+ branch = env.BRANCH_NAME
+ test_branch = 'bw_branch_7_7_2'
+ branch_period = test_branch.replaceAll('_', '.')
+ echo "branch_period..." + branch_period
+ def regex_capture = branch_period =~ /\d.+/
+ echo "regex_capture..." + regex_capture
+ version = regex_capture[0]
+ echo "version..." + version
}
}
--
2.32.1 (Apple Git-133)

75 changes: 75 additions & 0 deletions solr/patches/misc/0027-Add-newer-refreshed-dockerfile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
From 24b7e89ec27f5d5137df765fc7c1516d8645b45a Mon Sep 17 00:00:00 2001
From: Richard Goodman <[email protected]>
Date: Mon, 18 May 2020 12:59:58 +0100
Subject: [PATCH 27/83] Add newer refreshed dockerfile

---
Dockerfile | 40 +++++++---------------------------------
1 file changed, 7 insertions(+), 33 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index cf12c6c793..8200135418 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,25 +1,9 @@
-FROM debian:jessie
+FROM debian:stretch

-ARG buildn
+ARG VERSION=0

-ARG stage
-ARG int
-
-ENV BUILD_NUMBER=$buildn
-ENV SOLR_VERSION=7.4.0
-
-
-ENV STAGE=$stage
-ENV INT=$int
-
-
-RUN echo $SOLR_VERSION
-RUN echo $BUILD_NUMBER
-
-USER root
-
-RUN echo "deb http://http.debian.net/debian jessie-backports main" | \
- tee --append /etc/apt/sources.list.d/jessie-backports.list > /dev/null && \
+RUN echo "deb http://http.debian.net/debian stretch-backports main" | \
+ tee --append /etc/apt/sources.list.d/stretch-backports.list > /dev/null && \
apt-get update -y && \
apt-get install -y \
wget \
@@ -29,7 +13,7 @@ RUN echo "deb http://http.debian.net/debian jessie-backports main" | \
rubygems \
build-essential \
git-core && \
- apt-get install -y -t jessie-backports openjdk-8-jdk && \
+ apt-get install -y -t stretch-backports openjdk-8-jdk && \
update-java-alternatives -s java-1.8.0-openjdk-amd64 && \
apt-get upgrade -y

@@ -61,16 +45,6 @@ RUN ant jar
WORKDIR /ant-ivy/build/artifact/jars
RUN scp ivy.jar /opt/ant/lib

-WORKDIR /usr/local
-ADD . bw-lucene-solr/
-WORKDIR /usr/local/bw-lucene-solr/solr
+WORKDIR /solr-main/solr/
RUN ant ivy-bootstrap && \
- ant clean compile dist package
-
-
-WORKDIR /usr/local/bw-lucene-solr/solr/package
-
-
-RUN fpm --description "Brandwatch Solr distribution" --name solr -v $SOLR_VERSION-SNAPSHOT-bwbuild${BUILD_NUMBER} --prefix /opt -s tar -t deb solr-$SOLR_VERSION-SNAPSHOT.tgz
-RUN curl http://apt.service0.btn1.bwcom.net/packages -u $INT -F my_file=@solr_$SOLR_VERSION-SNAPSHOT-bwbuild${BUILD_NUMBER}_amd64.deb -F name=solr_$SOLR_VERSION-SNAPSHOT-bwbuild${BUILD_NUMBER}_amd64.deb
-RUN curl https://aptly.stage.brandwatch.net/packages -u $STAGE -F my_file=@solr_$SOLR_VERSION-SNAPSHOT-bwbuild${BUILD_NUMBER}_amd64.deb -F name=solr_$SOLR_VERSION-SNAPSHOT-bwbuild${BUILD_NUMBER}_amd64.deb
\ No newline at end of file
+ ant clean compile dist package
--
2.32.1 (Apple Git-133)

37 changes: 37 additions & 0 deletions solr/patches/misc/0028-Add-build-phase.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
From dd4e6b126c2e9367c620092aeb5a8e7f19c2e6f7 Mon Sep 17 00:00:00 2001
From: Richard Goodman <[email protected]>
Date: Mon, 18 May 2020 13:01:35 +0100
Subject: [PATCH 28/83] Add build phase

This should hopefully build the docker image
---
Jenkinsfile | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 6cbf0c53b9..38023236c8 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -10,12 +10,16 @@ node('docker') {
userRemoteConfigs: scm.userRemoteConfigs
])
branch = env.BRANCH_NAME
+ // TODO - change this when no longer using this branch name
test_branch = 'bw_branch_7_7_2'
branch_period = test_branch.replaceAll('_', '.')
- echo "branch_period..." + branch_period
def regex_capture = branch_period =~ /\d.+/
- echo "regex_capture..." + regex_capture
version = regex_capture[0]
- echo "version..." + version
+ }
+
+ stage ('Build and push images') {
+ withEnv(["DOCKER_BUILDKIT=1"]) {
+ sh "docker build -f Dockerfile --build-arg VERSION=${version} ."
+ }
}
}
--
2.32.1 (Apple Git-133)

Loading

0 comments on commit d4d9d3d

Please sign in to comment.