Enable builds for armv7l and arm64

This commit is contained in:
Deon George 2024-01-22 22:57:56 +11:00
parent ad018b5469
commit 9a938ac3ea
6 changed files with 72 additions and 17 deletions

View File

@ -1,6 +1,12 @@
stages: stages:
- test - test
- build - build
- build-manifest
variables:
DOCKER_HOST: tcp://docker:2375
VERSION: latest
VERSIONARCH: ${VERSION}-${ARCH}
# This folder is cached between builds # This folder is cached between builds
# http://docs.gitlab.com/ce/ci/yaml/README.html#cache # http://docs.gitlab.com/ce/ci/yaml/README.html#cache
@ -15,6 +21,18 @@ cache:
- node_modules/ - node_modules/
- vendor/ - vendor/
image: docker:latest
services:
- docker:dind
before_script:
- docker info && docker version
- echo "$CI_JOB_TOKEN" | docker login -u "$CI_REGISTRY_USER" "$CI_REGISTRY" --password-stdin
- if [ -n "$GITHUB_TOKEN" ]; then cat $GITHUB_TOKEN |base64 -d > auth.json; fi
include: include:
- .gitlab-test.yml - .gitlab-test.yml
- .gitlab-docker-x86_64.yml - .gitlab-docker-x86_64.yml
- .gitlab-docker-armv7l.yml
- .gitlab-docker-arm64.yml
- .gitlab-docker-manifest.yml

18
.gitlab-docker-arm64.yml Normal file
View File

@ -0,0 +1,18 @@
arm64:build:
variables:
ARCH: arm64
stage: build
script:
- if [ -f init ]; then chmod 500 init; fi
- echo -n ${CI_COMMIT_SHORT_SHA} > VERSION
- rm -rf node_modules database/seeds database/schema database/factories/*
- docker build -f docker/Dockerfile -t ${CI_REGISTRY_IMAGE}:${VERSIONARCH} .
- docker push ${CI_REGISTRY_IMAGE}:${VERSIONARCH}
tags:
- docker
- arm64
only:
- master

18
.gitlab-docker-armv7l.yml Normal file
View File

@ -0,0 +1,18 @@
armv7l:build:
variables:
ARCH: armv7l
stage: build
script:
- if [ -f init ]; then chmod 500 init; fi
- echo -n ${CI_COMMIT_SHORT_SHA} > VERSION
- rm -rf node_modules database/seeds database/schema database/factories/*
- docker build -f docker/Dockerfile -t ${CI_REGISTRY_IMAGE}:${VERSIONARCH} .
- docker push ${CI_REGISTRY_IMAGE}:${VERSIONARCH}
tags:
- docker
- armv7l
only:
- master

View File

@ -0,0 +1,10 @@
x86_64:build-manifest:
stage: build-manifest
script:
- docker manifest create ${CI_REGISTRY_IMAGE}:${VERSION} ${CI_REGISTRY_IMAGE}:${VERSION}-x86_64 ${CI_REGISTRY_IMAGE}:${VERSION}-armv7l ${CI_REGISTRY_IMAGE}:${VERSION}-arm64
- docker manifest push --purge ${CI_REGISTRY_IMAGE}:${VERSION}
tags:
- docker
- x86_64
only:
- master

View File

@ -1,27 +1,18 @@
docker: x86_64:build:
variables: variables:
VERSION: latest ARCH: x86_64
DOCKER_HOST: tcp://docker:2375
stage: build stage: build
image: docker:latest
services:
- docker:dind
before_script:
- docker info && docker version
- echo "$CI_JOB_TOKEN" | docker login -u "$CI_REGISTRY_USER" "$CI_REGISTRY" --password-stdin
- if [ -n "$GITHUB_TOKEN" ]; then cat $GITHUB_TOKEN |base64 -d > auth.json; fi
script: script:
- if [ -f init ]; then chmod 500 init; fi - if [ -f init ]; then chmod 500 init; fi
- echo -n ${CI_COMMIT_SHORT_SHA} > VERSION - echo -n ${CI_COMMIT_SHORT_SHA} > VERSION
- rm -rf node_modules database/seeds database/schema database/factories/* - rm -rf node_modules database/seeds database/schema database/factories/*
- docker build -f docker/Dockerfile -t ${CI_REGISTRY_IMAGE}:${VERSION} . - docker build -f docker/Dockerfile -t ${CI_REGISTRY_IMAGE}:${VERSIONARCH} .
- docker push ${CI_REGISTRY_IMAGE}:${VERSION} - docker push ${CI_REGISTRY_IMAGE}:${VERSIONARCH}
tags: tags:
- docker - docker
- x86_64 - x86_64
only: only:
- BRANCH-2.0 - master

View File

@ -1,5 +1,5 @@
test: test:
image: ${CI_REGISTRY}/leenooks/php:8.1-fpm-alpine-ldap-test image: ${CI_REGISTRY}/leenooks/php:8.3-fpm-ldap-test
stage: test stage: test
@ -21,7 +21,7 @@ test:
tags: tags:
- php - php
only: only:
- BRANCH-2.0 - master
before_script: before_script:
- mv .env.testing .env - mv .env.testing .env