Skip to content

Commit d25f172

Browse files
committed
feat! :upgrade postgresql to 13 in cicd plugin testing env
1 parent ee588e1 commit d25f172

File tree

2 files changed

+82
-7
lines changed

2 files changed

+82
-7
lines changed

.circleci/Dockerfile-ubuntu22

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
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+
# Install OpenJDK 15.0.1
30+
RUN wget https://download.java.net/java/GA/jdk15.0.1/51f4f36ad4ef43e39d0dfdbaf6549e32/9/GPL/openjdk-15.0.1_linux-x64_bin.tar.gz
31+
32+
RUN mv openjdk-15.0.1_linux-x64_bin.tar.gz /usr/java
33+
34+
RUN cd /usr/java && tar -xzvf openjdk-15.0.1_linux-x64_bin.tar.gz
35+
36+
RUN echo 'JAVA_HOME=/usr/java/jdk-15.0.1' >> /etc/profile
37+
RUN echo 'PATH=$PATH:$HOME/bin:$JAVA_HOME/bin' >> /etc/profile
38+
RUN echo 'export JAVA_HOME' >> /etc/profile
39+
RUN echo 'export JRE_HOME' >> /etc/profile
40+
RUN echo 'export PATH' >> /etc/profile
41+
42+
RUN update-alternatives --install "/usr/bin/java" "java" "/usr/java/jdk-12.0.2/bin/java" 1
43+
RUN update-alternatives --install "/usr/bin/javac" "javac" "/usr/java/jdk-12.0.2/bin/javac" 1
44+
45+
#install postgres 13
46+
# Import Repository Signing Key
47+
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
48+
RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata
49+
RUN apt install curl gpg gnupg2 software-properties-common apt-transport-https lsb-release ca-certificates sudo -y
50+
# Add PostgreSQL repository
51+
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list
52+
# Update again
53+
RUN apt update
54+
# Install PostgreSQL 13
55+
RUN apt install -y postgresql-13
56+
# Verify PostgreSQL 13 Installation on Ubuntu 22.04|20.04|18.04
57+
RUN psql --version
58+
59+
USER postgres
60+
61+
RUN service postgresql start && psql --command "CREATE USER root WITH SUPERUSER PASSWORD 'root';" \
62+
&& createdb -O root root \
63+
&& createdb -O root supertokens
64+
65+
USER root
66+
67+
RUN echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/13/main/pg_hba.conf
68+
69+
70+
RUN echo "listen_addresses='*'" >> /etc/postgresql/13/main/postgresql.conf
71+
72+
73+
RUN mkdir -p /var/run/postgresql && chown -R postgres /var/run/postgresql
74+
75+
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

0 commit comments

Comments
 (0)