[DO-1495] add cmake-format (!2)
Some checks failed
Build and publish docker image / Builds the image and publishes to docker hub (push) Has been cancelled
Some checks failed
Build and publish docker image / Builds the image and publishes to docker hub (push) Has been cancelled
Co-authored-by: aleksandr.vodyanov <aleksandr.vodyanov@avroid.tech> Reviewed-on: https://git.avroid.tech/Docker/clang-format/pulls/2
This commit is contained in:
49
.gitea/workflows/build-and-push-image.yaml
Normal file
49
.gitea/workflows/build-and-push-image.yaml
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
name: Build and publish docker image
|
||||||
|
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
env:
|
||||||
|
CI: ON
|
||||||
|
|
||||||
|
# Allow workflow to be manually run from the Gitea UI
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build_and_push:
|
||||||
|
runs-on: docker
|
||||||
|
name: Builds the image and publishes to docker hub
|
||||||
|
container:
|
||||||
|
image: harbor.avroid.tech/docker-hub-proxy/catthehacker/ubuntu:act-latest
|
||||||
|
steps:
|
||||||
|
- run: printenv
|
||||||
|
|
||||||
|
- name: Login to Harbor Docker Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: https://harbor.avroid.tech
|
||||||
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
|
password: ${{ secrets.DOCKER_TOKEN }}
|
||||||
|
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: "Build image"
|
||||||
|
run: |
|
||||||
|
make build
|
||||||
|
|
||||||
|
- name: "Push image"
|
||||||
|
run: |
|
||||||
|
make push
|
||||||
|
if: ${{ gitea.ref == 'refs/heads/master' }}
|
||||||
|
|
||||||
|
- name: "Clear image"
|
||||||
|
run: |
|
||||||
|
make clean
|
||||||
|
|
||||||
|
- name: Create and push tag
|
||||||
|
run: |
|
||||||
|
git config user.name "Jenkins"
|
||||||
|
git config user.email "svc-jenkins@avroid.tech"
|
||||||
|
git tag $(make getTag)
|
||||||
|
git push origin $(make getTag)
|
||||||
|
if: ${{ gitea.ref == 'refs/heads/master' }}
|
||||||
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
|
|||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [14-node20-1] - 2025-20-01
|
||||||
|
|
||||||
|
### Added
|
||||||
|
* cmake-format
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
* refactor Makefile
|
||||||
|
|
||||||
## [14-node20] - 2023-11-01
|
## [14-node20] - 2023-11-01
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ ARG UBUNTU_VERSION=22.04
|
|||||||
FROM ${DOCKER_REGISTRY}/ubuntu:${UBUNTU_VERSION}
|
FROM ${DOCKER_REGISTRY}/ubuntu:${UBUNTU_VERSION}
|
||||||
|
|
||||||
LABEL maintainer="devops <devops@avroid.tech>" \
|
LABEL maintainer="devops <devops@avroid.tech>" \
|
||||||
description="Image with LLVM clang-format, for check sources" \
|
description="Image with LLVM clang-format and cmake-format for check sources" \
|
||||||
tools.nodejs.version="20.9.0"
|
tools.nodejs.version="20.9.0"
|
||||||
|
|
||||||
ARG CLANG_TOOLS_VERSION=14
|
ARG CLANG_TOOLS_VERSION=14
|
||||||
@@ -21,10 +21,10 @@ ARG USER_HOME=/home/${USER}
|
|||||||
ARG NEXUS_DOMAIN_NAME='nexus.avroid.tech'
|
ARG NEXUS_DOMAIN_NAME='nexus.avroid.tech'
|
||||||
ARG NEXUS_URL="https://${NEXUS_DOMAIN_NAME}"
|
ARG NEXUS_URL="https://${NEXUS_DOMAIN_NAME}"
|
||||||
|
|
||||||
ENV TZ Europe/Moscow
|
ENV TZ=Europe/Moscow
|
||||||
|
|
||||||
# Подавляем вывод в консоль интерактивных диалогов у служебных команд
|
# Подавляем вывод в консоль интерактивных диалогов у служебных команд
|
||||||
ENV DEBIAN_FRONTEND noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
RUN sed -ie "s/deb\ http\:\/\/archive.ubuntu.com\/ubuntu/deb\ [trusted=yes] https\:\/\/${NEXUS_DOMAIN_NAME}\/repository\/all-apt-proxy-archive-ubuntu-com/g" /etc/apt/sources.list \
|
RUN sed -ie "s/deb\ http\:\/\/archive.ubuntu.com\/ubuntu/deb\ [trusted=yes] https\:\/\/${NEXUS_DOMAIN_NAME}\/repository\/all-apt-proxy-archive-ubuntu-com/g" /etc/apt/sources.list \
|
||||||
&& sed -ie "s/deb\ http\:\/\/security.ubuntu.com\/ubuntu/deb\ [trusted=yes] https\:\/\/${NEXUS_DOMAIN_NAME}\/repository\/all-apt-proxy-security-ubuntu-com/g" /etc/apt/sources.list \
|
&& sed -ie "s/deb\ http\:\/\/security.ubuntu.com\/ubuntu/deb\ [trusted=yes] https\:\/\/${NEXUS_DOMAIN_NAME}\/repository\/all-apt-proxy-security-ubuntu-com/g" /etc/apt/sources.list \
|
||||||
@@ -64,6 +64,7 @@ RUN wget -O - "${NEXUS_URL}/repository/all-raw-proxy-apt-llvm-org/llvm-snapshot.
|
|||||||
&& apt-get install -y \
|
&& apt-get install -y \
|
||||||
clang-format-${CLANG_TOOLS_VERSION} \
|
clang-format-${CLANG_TOOLS_VERSION} \
|
||||||
clang-tidy-${CLANG_TOOLS_VERSION} \
|
clang-tidy-${CLANG_TOOLS_VERSION} \
|
||||||
|
cmake-format \
|
||||||
parallel \
|
parallel \
|
||||||
&& ln -s /usr/bin/clang-format-${CLANG_TOOLS_VERSION} /usr/bin/clang-format \
|
&& ln -s /usr/bin/clang-format-${CLANG_TOOLS_VERSION} /usr/bin/clang-format \
|
||||||
&& ln -s /usr/bin/clang-tidy-${CLANG_TOOLS_VERSION} /usr/bin/clang-tidy \
|
&& ln -s /usr/bin/clang-tidy-${CLANG_TOOLS_VERSION} /usr/bin/clang-tidy \
|
||||||
|
|||||||
13
Makefile
13
Makefile
@@ -3,10 +3,16 @@
|
|||||||
IMAGE_NAME = clang-format
|
IMAGE_NAME = clang-format
|
||||||
IMAGE_GROUP = devops
|
IMAGE_GROUP = devops
|
||||||
APP_VERSION = 14
|
APP_VERSION = 14
|
||||||
REVISION = -node20
|
REVISION = -node20-1
|
||||||
IMAGE_TAG = $(APP_VERSION)$(REVISION)
|
IMAGE_TAG = $(APP_VERSION)$(REVISION)
|
||||||
DOCKER_REGISTRY = harbor.avroid.tech
|
DOCKER_REGISTRY = harbor.avroid.tech
|
||||||
|
|
||||||
|
CI_FLAGS =
|
||||||
|
|
||||||
|
ifeq ($(CI), false)
|
||||||
|
CI_FLAGS = --no-cache
|
||||||
|
endif
|
||||||
|
|
||||||
all:
|
all:
|
||||||
@echo 'DEFAULT:'
|
@echo 'DEFAULT:'
|
||||||
@echo ' make build'
|
@echo ' make build'
|
||||||
@@ -16,16 +22,13 @@ all:
|
|||||||
|
|
||||||
build:
|
build:
|
||||||
DOCKER_BUILDKIT=1 docker build \
|
DOCKER_BUILDKIT=1 docker build \
|
||||||
--no-cache \
|
|
||||||
--pull \
|
--pull \
|
||||||
|
--network=host \
|
||||||
--platform linux/amd64 \
|
--platform linux/amd64 \
|
||||||
-t $(DOCKER_REGISTRY)/$(IMAGE_GROUP)/$(IMAGE_NAME):$(IMAGE_TAG) \
|
-t $(DOCKER_REGISTRY)/$(IMAGE_GROUP)/$(IMAGE_NAME):$(IMAGE_TAG) \
|
||||||
--build-arg CLANG_TOOLS_VERSION=$(APP_VERSION) .
|
--build-arg CLANG_TOOLS_VERSION=$(APP_VERSION) .
|
||||||
|
|
||||||
push:
|
push:
|
||||||
ifeq ($(CI), false)
|
|
||||||
docker login https://$(DOCKER_REGISTRY)
|
|
||||||
endif
|
|
||||||
docker push $(DOCKER_REGISTRY)/$(IMAGE_GROUP)/$(IMAGE_NAME):$(IMAGE_TAG)
|
docker push $(DOCKER_REGISTRY)/$(IMAGE_GROUP)/$(IMAGE_NAME):$(IMAGE_TAG)
|
||||||
|
|
||||||
getTag:
|
getTag:
|
||||||
|
|||||||
Reference in New Issue
Block a user