run docker build

This commit is contained in:
Moritz 2026-02-23 17:23:36 +01:00
parent 2619e3ea29
commit 583c5ba512
Signed by: moritz
GPG key ID: 1020A035E5DD0824

View file

@ -1,213 +1,213 @@
kind: pipeline # kind: pipeline
type: docker # type: docker
name: check-fast # name: check-fast
#
services: # services:
- name: postgres # - name: postgres
image: docker.io/library/postgres:18.1 # image: docker.io/library/postgres:18.1
environment: # environment:
POSTGRES_USER: postgres # POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres # POSTGRES_PASSWORD: postgres
#
trigger: # #trigger:
event: # # event:
- push # # - push
#
steps: # steps:
- name: compute cache key # - name: compute cache key
image: docker.io/library/elixir:1.18.3-otp-27 # image: docker.io/library/elixir:1.18.3-otp-27
commands: # commands:
- mix_lock_hash=$(sha256sum mix.lock | cut -d ' ' -f 1) # - mix_lock_hash=$(sha256sum mix.lock | cut -d ' ' -f 1)
- echo "$DRONE_REPO_OWNER/$DRONE_REPO_NAME/$mix_lock_hash" >> .cache_key # - echo "$DRONE_REPO_OWNER/$DRONE_REPO_NAME/$mix_lock_hash" >> .cache_key
# Print cache key for debugging # # Print cache key for debugging
- cat .cache_key # - cat .cache_key
#
- name: restore-cache # - name: restore-cache
image: drillster/drone-volume-cache # image: drillster/drone-volume-cache
settings: # settings:
restore: true # restore: true
mount: # mount:
- ./deps # - ./deps
- ./_build # - ./_build
ttl: 30 # ttl: 30
volumes: # volumes:
- name: cache # - name: cache
path: /cache # path: /cache
#
- name: lint # - name: lint
image: docker.io/library/elixir:1.18.3-otp-27 # image: docker.io/library/elixir:1.18.3-otp-27
commands: # commands:
# Install hex package manager # # Install hex package manager
- mix local.hex --force # - mix local.hex --force
# Fetch dependencies # # Fetch dependencies
- mix deps.get # - mix deps.get
# Check for compilation errors & warnings # # Check for compilation errors & warnings
- mix compile --warnings-as-errors # - mix compile --warnings-as-errors
# Check formatting # # Check formatting
- mix format --check-formatted # - mix format --check-formatted
# Security checks # # Security checks
- mix sobelow --config # - mix sobelow --config
# Check dependencies for known vulnerabilities # # Check dependencies for known vulnerabilities
- mix deps.audit # - mix deps.audit
# Check for dependencies that are not maintained anymore # # Check for dependencies that are not maintained anymore
- mix hex.audit # - mix hex.audit
# Provide hints for improving code quality # # Provide hints for improving code quality
- mix credo # - mix credo
# Check that translations are up to date # # Check that translations are up to date
- mix gettext.extract --check-up-to-date # - mix gettext.extract --check-up-to-date
#
- name: wait_for_postgres # - name: wait_for_postgres
image: docker.io/library/postgres:18.1 # image: docker.io/library/postgres:18.1
commands: # commands:
# Wait for postgres to become available # # Wait for postgres to become available
- | # - |
for i in {1..20}; do # for i in {1..20}; do
if pg_isready -h postgres -U postgres; then # if pg_isready -h postgres -U postgres; then
exit 0 # exit 0
else # else
true # true
fi # fi
sleep 2 # sleep 2
done # done
echo "Postgres did not become available, aborting." # echo "Postgres did not become available, aborting."
exit 1 # exit 1
#
- name: test-fast # - name: test-fast
image: docker.io/library/elixir:1.18.3-otp-27 # image: docker.io/library/elixir:1.18.3-otp-27
environment: # environment:
MIX_ENV: test # MIX_ENV: test
TEST_POSTGRES_HOST: postgres # TEST_POSTGRES_HOST: postgres
TEST_POSTGRES_PORT: 5432 # TEST_POSTGRES_PORT: 5432
commands: # commands:
# Install hex package manager # # Install hex package manager
- mix local.hex --force # - mix local.hex --force
# Fetch dependencies # # Fetch dependencies
- mix deps.get # - mix deps.get
# Run fast tests (excludes slow/performance and UI tests) # # Run fast tests (excludes slow/performance and UI tests)
- mix test --exclude slow --exclude ui --max-cases 2 # - mix test --exclude slow --exclude ui --max-cases 2
#
- name: rebuild-cache # - name: rebuild-cache
image: drillster/drone-volume-cache # image: drillster/drone-volume-cache
settings: # settings:
rebuild: true # rebuild: true
mount: # mount:
- ./deps # - ./deps
- ./_build # - ./_build
volumes: # volumes:
- name: cache # - name: cache
path: /cache # path: /cache
#
volumes: # volumes:
- name: cache # - name: cache
host: # host:
path: /tmp/drone_cache # path: /tmp/drone_cache
#
--- # ---
kind: pipeline # kind: pipeline
type: docker # type: docker
name: check-full # name: check-full
#
services: # services:
- name: postgres # - name: postgres
image: docker.io/library/postgres:18.1 # image: docker.io/library/postgres:18.1
environment: # environment:
POSTGRES_USER: postgres # POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres # POSTGRES_PASSWORD: postgres
#
trigger: # #trigger:
event: # # event:
- promote # # - promote
target: # # target:
- production # # - production
#
steps: # steps:
- name: compute cache key # - name: compute cache key
image: docker.io/library/elixir:1.18.3-otp-27 # image: docker.io/library/elixir:1.18.3-otp-27
commands: # commands:
- mix_lock_hash=$(sha256sum mix.lock | cut -d ' ' -f 1) # - mix_lock_hash=$(sha256sum mix.lock | cut -d ' ' -f 1)
- echo "$DRONE_REPO_OWNER/$DRONE_REPO_NAME/$mix_lock_hash" >> .cache_key # - echo "$DRONE_REPO_OWNER/$DRONE_REPO_NAME/$mix_lock_hash" >> .cache_key
# Print cache key for debugging # # Print cache key for debugging
- cat .cache_key # - cat .cache_key
#
- name: restore-cache # - name: restore-cache
image: drillster/drone-volume-cache # image: drillster/drone-volume-cache
settings: # settings:
restore: true # restore: true
mount: # mount:
- ./deps # - ./deps
- ./_build # - ./_build
ttl: 30 # ttl: 30
volumes: # volumes:
- name: cache # - name: cache
path: /cache # path: /cache
#
- name: lint # - name: lint
image: docker.io/library/elixir:1.18.3-otp-27 # image: docker.io/library/elixir:1.18.3-otp-27
commands: # commands:
# Install hex package manager # # Install hex package manager
- mix local.hex --force # - mix local.hex --force
# Fetch dependencies # # Fetch dependencies
- mix deps.get # - mix deps.get
# Check for compilation errors & warnings # # Check for compilation errors & warnings
- mix compile --warnings-as-errors # - mix compile --warnings-as-errors
# Check formatting # # Check formatting
- mix format --check-formatted # - mix format --check-formatted
# Security checks # # Security checks
- mix sobelow --config # - mix sobelow --config
# Check dependencies for known vulnerabilities # # Check dependencies for known vulnerabilities
- mix deps.audit # - mix deps.audit
# Check for dependencies that are not maintained anymore # # Check for dependencies that are not maintained anymore
- mix hex.audit # - mix hex.audit
# Provide hints for improving code quality # # Provide hints for improving code quality
- mix credo # - mix credo
# Check that translations are up to date # # Check that translations are up to date
- mix gettext.extract --check-up-to-date # - mix gettext.extract --check-up-to-date
#
- name: wait_for_postgres # - name: wait_for_postgres
image: docker.io/library/postgres:18.1 # image: docker.io/library/postgres:18.1
commands: # commands:
# Wait for postgres to become available # # Wait for postgres to become available
- | # - |
for i in {1..20}; do # for i in {1..20}; do
if pg_isready -h postgres -U postgres; then # if pg_isready -h postgres -U postgres; then
exit 0 # exit 0
else # else
true # true
fi # fi
sleep 2 # sleep 2
done # done
echo "Postgres did not become available, aborting." # echo "Postgres did not become available, aborting."
exit 1 # exit 1
#
- name: test-all # - name: test-all
image: docker.io/library/elixir:1.18.3-otp-27 # image: docker.io/library/elixir:1.18.3-otp-27
environment: # environment:
MIX_ENV: test # MIX_ENV: test
TEST_POSTGRES_HOST: postgres # TEST_POSTGRES_HOST: postgres
TEST_POSTGRES_PORT: 5432 # TEST_POSTGRES_PORT: 5432
commands: # commands:
# Install hex package manager # # Install hex package manager
- mix local.hex --force # - mix local.hex --force
# Fetch dependencies # # Fetch dependencies
- mix deps.get # - mix deps.get
# Run all tests (including slow/performance and UI tests) # # Run all tests (including slow/performance and UI tests)
- mix test # - mix test
#
- name: rebuild-cache # - name: rebuild-cache
image: drillster/drone-volume-cache # image: drillster/drone-volume-cache
settings: # settings:
rebuild: true # rebuild: true
mount: # mount:
- ./deps # - ./deps
- ./_build # - ./_build
volumes: # volumes:
- name: cache # - name: cache
path: /cache # path: /cache
#
volumes: # volumes:
- name: cache # - name: cache
host: # host:
path: /tmp/drone_cache # path: /tmp/drone_cache
--- ---
kind: pipeline kind: pipeline
@ -217,6 +217,7 @@ name: build-and-publish
trigger: trigger:
branch: branch:
- main - main
- fix/imprintor
event: event:
- push - push
- tag - tag
@ -253,8 +254,8 @@ steps:
event: event:
- push - push
depends_on: #depends_on:
- check-fast # - check-fast
--- ---
kind: pipeline kind: pipeline