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

Added psql image

parent 32073829
No related branches found
No related tags found
No related merge requests found
Pipeline #91445 failed
......@@ -9,6 +9,7 @@ stages:
- validation
- pre-build
- build
- test
- example-build
- example-test
- example-cleanup
......@@ -187,6 +188,50 @@ 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: registry.gitlab.syncad.com/hive/common-ci-configuration/psql:14-1
services:
- postgres:14
variables:
POSTGRES_DB: haf
POSTGRES_USER: haf_admin
POSTGRES_PASSWORD: password
POSTGRES_HOST_AUTH_METHOD: trust
PGHOSTADDR: postgres
PGPORT: 5432
PGDATABASE: $POSTGRES_DB
PGPASSWORD: $POSTGRES_PASSWORD
script:
- |
set -e
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.
Finish editing this message first!
Please register or to comment