Skip to content
Snippets Groups Projects
Verified Commit 6e9e45f4 authored by Konrad Botor's avatar Konrad Botor
Browse files

Added psql image

parent 32073829
Branches
No related tags found
1 merge request!45Added psql image
Pipeline #92935 passed
......@@ -9,6 +9,7 @@ stages:
- validation
- pre-build
- build
- test
- example-build
- example-test
- example-cleanup
......@@ -187,6 +188,55 @@ build_emsdk_image:
- scripts/bash/emscripten/**/*
compare_to: 'refs/heads/develop'
build_psql_image:
extends: .build_docker_image
stage: build
variables:
BUILD_TARGET: "psql"
needs:
- build_docker_dind_image
rules:
- if: $CI_COMMIT_BRANCH == "main" # for branch main run if there were changes on the branch
exists:
- Dockerfile.psql
changes:
paths:
- Dockerfile.psql
- if: $CI_COMMIT_BRANCH !~ /^main$/ # for other branches compare to develop and run if there are diffrences
exists:
- Dockerfile.psql
changes:
paths:
- Dockerfile.psql
compare_to: 'refs/heads/develop'
psql_image_test:
stage: test
image:
name: registry.gitlab.syncad.com/hive/common-ci-configuration/psql:14-1
entrypoint: [""]
services:
- postgres:14
variables:
POSTGRES_DB: haf
POSTGRES_USER: haf_admin
POSTGRES_PASSWORD: password
POSTGRES_HOST_AUTH_METHOD: trust
PGHOST: postgres
PGPORT: 5432
PGDATABASE: $POSTGRES_DB
PGUSER: $POSTGRES_USER
PGPASSWORD: $POSTGRES_PASSWORD
CI_DEBUG_SERVICES: "false"
script:
- |
set -e
psql --command="\conninfo"
psql --list
psql --command="\set"
tags:
- public-runner-docker
example_docker_image_builder_job:
extends: .docker_image_builder_job_template
......
# syntax=docker/dockerfile:1.5
ARG PAAS_PSQL_VERSION=11251948d5dd4867552f9b9836a9e02110304df5
FROM ghcr.io/alphagov/paas/psql:${PAAS_PSQL_VERSION} AS psql
RUN <<EOF
set -e
apk add --no-cache sudo git bash
adduser -s /bin/bash -G users -D "haf_admin"
echo "haf_admin ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers
EOF
USER haf_admin
WORKDIR /home/haf_admin
ENTRYPOINT [ "psql" ]
\ No newline at end of file
......@@ -3,6 +3,12 @@ variable "CI_COMMIT_SHA" {}
variable "EMSCRIPTEN_VERSION" {
default = "3.1.56"
}
variable "PSQL_IMAGE_VERSION" {
default = "14-1" # After updating tag here, remeber to also update it in job 'psql_image_test'
}
variable "PAAS_PSQL_VERSION" {
default = "11251948d5dd4867552f9b9836a9e02110304df5"
}
variable "BOOST_VERSION_TAG" {
default = null
}
......@@ -85,4 +91,11 @@ target "emsdk" {
BOOST_VERSION_TAG = "${BOOST_VERSION_TAG}",
OPENSSL_VERSION_TAG = "${OPENSSL_VERSION_TAG}"
}
}
target "psql" {
dockerfile = "Dockerfile.psql"
tags = generate-tags("psql", "${PSQL_IMAGE_VERSION}")
cache-from = generate-cache-from("psql", "${PSQL_IMAGE_VERSION}")
cache-to = generate-cache-to("psql", "${PSQL_IMAGE_VERSION}")
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment