From 29513a0a7f4b2da7f4a5b01da0cbe3a4a5cf24d7 Mon Sep 17 00:00:00 2001 From: Araozu Date: Sun, 6 Oct 2024 21:50:00 -0500 Subject: [PATCH] fix: jenkins, pt5? --- .gitignore | 1 + Jenkinsfile | 8 +++++++- db/init.sql | 3 +++ docker-compose.yml | 14 +++++++++++++- 4 files changed, 24 insertions(+), 2 deletions(-) create mode 100644 db/init.sql diff --git a/.gitignore b/.gitignore index 1666735..09a5f1d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ node_modules public/css/output.css .env tmp +main diff --git a/Jenkinsfile b/Jenkinsfile index 4322d81..6338fed 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,13 @@ pipeline { stage('Populate env') { steps { sh 'rm .env || true' - sh 'echo "PORT=8007" > .env' + sh 'echo "PORT=8007" >> .env' + sh 'echo "DB_HOST=localhost" >> .env' + sh 'echo "DB_PORT=5432" >> .env' + sh 'echo "DB_DATABASE=music" >> .env' + sh 'echo "DB_USERNAME=root" >> .env' + sh 'echo "DB_PASSWORD=root" >> .env' + sh 'echo "DB_SCHEMA=public" >> .env' } } stage('Profit') { diff --git a/db/init.sql b/db/init.sql new file mode 100644 index 0000000..97a73e1 --- /dev/null +++ b/db/init.sql @@ -0,0 +1,3 @@ +create database music; + + diff --git a/docker-compose.yml b/docker-compose.yml index 5a16eff..b5fbb7b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,5 @@ services: - dev.araozu.music: + music-to-go: container_name: music-to-go build: context: . @@ -7,3 +7,15 @@ services: ports: - "8007:8007" restart: unless-stopped + music-to-go-db: + image: postgres + container_name: music-to-go-db + restart: unless-stopped + # set shared memory limit when using docker-compose + shm_size: 128mb + volumes: + - ./db:/docker-entrypoint-initdb.d + environment: + POSTGRES_USER: root + POSTGRES_PASSWORD: root +