Skip to content

Commit d77cf3b

Browse files
authored
feat! :upgrade postgresql to 13 in cicd plugin testing env (#242)
* feat! :upgrade postgresql to 13 in cicd plugin testing env * fix: also add the startPostgreSQL script to the docker image * fix: lower number of import users * fix: trying to fine-tune gradle on ci * fix: trying to fine-tune gradle on ci * fix: tweaking gradle props * fix: add _java_options * running tests on current branch * check out my branch when running tests * fix: make this work with tagged branches
1 parent 1afbbd3 commit d77cf3b

File tree

3 files changed

+90
-7
lines changed

3 files changed

+90
-7
lines changed

.circleci/Dockerfile-ubuntu22

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
FROM ubuntu:22.04
2+
3+
RUN apt-get update && apt-get upgrade -y
4+
5+
RUN apt-get install build-essential -y
6+
7+
RUN apt-get install -y git-core
8+
9+
RUN apt-get install -y wget
10+
11+
# Install OpenJDK 12
12+
RUN wget https://download.java.net/java/GA/jdk12.0.2/e482c34c86bd4bf8b56c0b35558996b9/10/GPL/openjdk-12.0.2_linux-x64_bin.tar.gz
13+
14+
RUN mkdir /usr/java
15+
16+
RUN mv openjdk-12.0.2_linux-x64_bin.tar.gz /usr/java
17+
18+
RUN cd /usr/java && tar -xzvf openjdk-12.0.2_linux-x64_bin.tar.gz
19+
20+
RUN echo 'JAVA_HOME=/usr/java/jdk-12.0.2' >> /etc/profile
21+
RUN echo 'PATH=$PATH:$HOME/bin:$JAVA_HOME/bin' >> /etc/profile
22+
23+
RUN apt-get install jq -y
24+
25+
RUN apt-get install curl -y
26+
27+
RUN apt-get install unzip -y
28+
29+
ADD ./runPostgreSQL.sh /runPostgreSQL.sh
30+
31+
RUN chmod +x /runPostgreSQL.sh
32+
33+
# Install OpenJDK 15.0.1
34+
RUN wget https://download.java.net/java/GA/jdk15.0.1/51f4f36ad4ef43e39d0dfdbaf6549e32/9/GPL/openjdk-15.0.1_linux-x64_bin.tar.gz
35+
36+
RUN mv openjdk-15.0.1_linux-x64_bin.tar.gz /usr/java
37+
38+
RUN cd /usr/java && tar -xzvf openjdk-15.0.1_linux-x64_bin.tar.gz
39+
40+
RUN echo 'JAVA_HOME=/usr/java/jdk-15.0.1' >> /etc/profile
41+
RUN echo 'PATH=$PATH:$HOME/bin:$JAVA_HOME/bin' >> /etc/profile
42+
RUN echo 'export JAVA_HOME' >> /etc/profile
43+
RUN echo 'export JRE_HOME' >> /etc/profile
44+
RUN echo 'export PATH' >> /etc/profile
45+
46+
RUN update-alternatives --install "/usr/bin/java" "java" "/usr/java/jdk-12.0.2/bin/java" 1
47+
RUN update-alternatives --install "/usr/bin/javac" "javac" "/usr/java/jdk-12.0.2/bin/javac" 1
48+
49+
#install postgres 13
50+
# Import Repository Signing Key
51+
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
52+
RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata
53+
RUN apt install curl gpg gnupg2 software-properties-common apt-transport-https lsb-release ca-certificates sudo -y
54+
# Add PostgreSQL repository
55+
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list
56+
# Update again
57+
RUN apt update
58+
# Install PostgreSQL 13
59+
RUN apt install -y postgresql-13
60+
# Verify PostgreSQL 13 Installation on Ubuntu 22.04|20.04|18.04
61+
RUN psql --version
62+
63+
USER postgres
64+
65+
RUN service postgresql start && psql --command "CREATE USER root WITH SUPERUSER PASSWORD 'root';" \
66+
&& createdb -O root root \
67+
&& createdb -O root supertokens
68+
69+
USER root
70+
71+
RUN echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/13/main/pg_hba.conf
72+
73+
74+
RUN echo "listen_addresses='*'" >> /etc/postgresql/13/main/postgresql.conf
75+
76+
77+
RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql
78+
79+
VOLUME ["/etc/postgresql", "/var/log/postgresql", "/var/lib/postgresql"]

.circleci/config.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ orbs:
44
jobs:
55
test:
66
docker:
7-
- image: rishabhpoddar/supertokens_postgresql_plugin_test
7+
- image: tamassupertokens/supertokens_postgresql_plugin_test
88
- image: rishabhpoddar/oauth-server-cicd
99
resource_class: large
1010
steps:
@@ -15,7 +15,7 @@ jobs:
1515
- run:
1616
name: update postgresql max_connections
1717
command: |
18-
sed -i 's/^#*\s*max_connections\s*=.*/max_connections = 10000/' /etc/postgresql/9.5/main/postgresql.conf
18+
sed -i 's/^#*\s*max_connections\s*=.*/max_connections = 10000/' /etc/postgresql/13/main/postgresql.conf
1919
- run:
2020
name: starting postgresql
2121
command: |
@@ -80,7 +80,7 @@ jobs:
8080
- slack/status
8181
test-onemillionusers:
8282
docker:
83-
- image: rishabhpoddar/supertokens_postgresql_plugin_test
83+
- image: tamassupertokens/supertokens_postgresql_plugin_test
8484
resource_class: large
8585
steps:
8686
- add_ssh_keys:
@@ -90,7 +90,7 @@ jobs:
9090
- run:
9191
name: update postgresql max_connections
9292
command: |
93-
sed -i 's/^#*\s*max_connections\s*=.*/max_connections = 10000/' /etc/postgresql/9.5/main/postgresql.conf
93+
sed -i 's/^#*\s*max_connections\s*=.*/max_connections = 10000/' /etc/postgresql/13/main/postgresql.conf
9494
- run:
9595
name: starting postgresql
9696
command: |
@@ -155,7 +155,7 @@ jobs:
155155
- slack/status
156156
mark-passed:
157157
docker:
158-
- image: rishabhpoddar/supertokens_postgresql_plugin_test
158+
- image: tamassupertokens/supertokens_postgresql_plugin_test
159159
steps:
160160
- checkout
161161
- run: (cd .circleci && ./markPassed.sh)
@@ -172,15 +172,15 @@ workflows:
172172
tags:
173173
only: /dev-v[0-9]+(\.[0-9]+)*/
174174
branches:
175-
ignore: /.*/
175+
only: /test-cicd\/.*/
176176
- test-onemillionusers:
177177
context:
178178
- slack-notification
179179
filters:
180180
tags:
181181
only: /dev-v[0-9]+(\.[0-9]+)*/
182182
branches:
183-
ignore: /.*/
183+
only: /test-cicd\/.*/
184184
- mark-passed:
185185
context:
186186
- slack-notification

.circleci/doTests.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ do
102102
pluginY=$(cut -d'.' -f2 <<<"$pluginVersion")
103103
echo -e "core,$coreVersionX2\nplugin-interface,$piVersion\npostgresql-plugin,$pluginX.$pluginY" > modules.txt
104104
./loadModules
105+
106+
#gradle properties overrides
107+
export _JAVA_OPTIONS="-Xms1g -Xmx4g"
108+
105109
cd supertokens-core
106110
git checkout $coreVersionTag
107111
cd ../supertokens-plugin-interface

0 commit comments

Comments
 (0)