Build for new platform (arm) and notifications

This commit is contained in:
Juanjo Gutiérrez 2022-01-31 12:56:07 +01:00 committed by Juanjo Gutierrez
parent 56db33478e
commit 3b7a769021
7 changed files with 97 additions and 77 deletions

2
.dockerignore Normal file
View file

@ -0,0 +1,2 @@
build_dir/
build/

View file

@ -1,15 +1,76 @@
--- ---
kind: pipeline kind: pipeline
type: docker type: docker
name: default name: amd64
platform:
os: linux
arch: amd64
steps: steps:
- name: build - name: prepare workspace
image: alpine
commands:
- rm -fr build_dir
- name: build hermes
image: alpine image: alpine
commands: commands:
- rm -fr build
- mkdir build
- cd build
- apk add -t hermes-build-deps --no-cache perl graphviz doxygen gcc make openssl-dev libspf2-dev cmake g++ sqlite-dev gettext-dev - apk add -t hermes-build-deps --no-cache perl graphviz doxygen gcc make openssl-dev libspf2-dev cmake g++ sqlite-dev gettext-dev
- cmake .. - cmake -B build_dir
- make -j4 - cmake --build build_dir
- name: docker image build
image: plugins/docker
settings:
tags:
- latest
repo: docker.gutierrezdequevedo.com/ps/hermes
---
kind: pipeline
type: docker
name: arm64
platform:
os: linux
arch: arm64
steps:
- name: prepare workspace
image: alpine
commands:
- rm -fr build_dir
- name: build hermes
image: alpine
commands:
- apk add -t hermes-build-deps --no-cache perl graphviz doxygen gcc make openssl-dev libspf2-dev cmake g++ sqlite-dev gettext-dev
- cmake -B build_dir
- cmake --build build_dir
- name: docker image build
image: plugins/docker
settings:
tags:
- latest-arm64
repo: docker.gutierrezdequevedo.com/ps/hermes
---
kind: pipeline
type: docker
name: notification
depends_on:
- amd64
- arm64
steps:
- name: notify matrix
image: spotlightkid/drone-matrixchat-notify
settings:
homeserver: 'https://grava.work'
roomid: '!wMVeFx6jwwF0TWA18h:grava.work'
userid: '@juanjo:grava.work'
deviceid: 'drone CI'
accesstoken: G66FRa3fG7qNfM4KKoW5wx6TWophvvtF
markdown: 'yes'
template: |
`${DRONE_REPO}` build #${DRONE_BUILD_NUMBER} status: **${DRONE_BUILD_STATUS}**
[${DRONE_BUILD_LINK}]

View file

@ -1,37 +0,0 @@
language: c++
jobs:
include:
- compiler: gcc
os: linux
dist: bionic
- compiler: clang
os: linux
dist: bionic
- compiler: gcc
os: linux
dist: xenial
- compiler: clang
os: linux
dist: xenial
addons:
apt:
packages:
- libspf2-dev
- doxygen
- graphviz
homebrew:
packages:
- libintl
- gettext
- openssl
- doxygen
- graphviz
script:
- mkdir build
- pushd build
- cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/install-dir
- make install
- find $PWD/install-dir
- popd

View file

@ -63,7 +63,7 @@ if(DOXYGEN_FOUND)
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/docs) WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/docs)
install( install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/docs/html DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/docs/html
DESTINATION usr/share/doc/hermes/html) TYPE DOC)
endif() endif()
target_link_libraries(hermes target_link_libraries(hermes
@ -76,11 +76,11 @@ install(TARGETS hermes
RUNTIME DESTINATION bin) RUNTIME DESTINATION bin)
install(FILES dists/hermesrc.example install(FILES dists/hermesrc.example
DESTINATION etc) TYPE SYSCONF)
install(FILES install(FILES
dists/hermesrc.example dists/hermesrc.example
docs/gpl.txt docs/gpl.txt
docs/installing-hermes.txt docs/installing-hermes.txt
docs/hermes-options.html docs/hermes-options.html
DESTINATION usr/share/doc/hermes) TYPE DOC)

24
Dockerfile Normal file
View file

@ -0,0 +1,24 @@
FROM alpine
WORKDIR /
ADD . /hermes
WORKDIR /hermes
RUN apk add -t hermes-build-deps --no-cache perl graphviz doxygen gcc make openssl-dev libspf2-dev cmake g++ sqlite-dev gettext-dev
RUN cmake -B build
RUN cmake --build build
RUN mkdir /hermes-installation
RUN cmake --install build --prefix /hermes-installation
FROM alpine
EXPOSE 25
COPY --from=0 /hermes-installation /
WORKDIR /
RUN apk add --no-cache openssl libspf2 sqlite-libs libstdc++ libgcc && \
mkdir /etc/hermes && \
apk add --no-cache openssl libspf2 sqlite-libs libstdc++ libgcc && \
openssl genrsa 1024 > /etc/hermes/hermes.key && \
openssl req -new -x509 -nodes -sha1 -days 365 -subj /C=SE/ST=State/L=Location/O=Organization/OU=Unit/CN=commonname.com -key /etc/hermes/hermes.key > /etc/hermes/hermes.cert
COPY --from=0 /hermes/dists/hermesrc.example /etc/hermes/hermesrc
RUN sed -e "s#background = true#background = false#" -i /etc/hermes/hermesrc && \
mkdir /var/hermes && \
chown nobody:nobody -R /var/hermes
CMD ["hermes", "/etc/hermes/hermesrc"]

28
Jenkinsfile vendored
View file

@ -1,28 +0,0 @@
pipeline {
environment {
DOCKER_HOST='docker.hem:2376'
}
agent any;
stages {
stage('Build') {
agent {
dockerfile { dir 'build-deps' }
}
steps {
dir('build') {
sh 'cmake ..'
sh 'make -j4'
}
}
}
}
triggers {
pollSCM('H */4 * * 1-5')
}
}

View file

@ -1,2 +0,0 @@
FROM alpine:3.13
RUN /sbin/apk add -t hermes-build-deps --no-cache gcc g++ make cmake openssl-dev libspf2-dev sqlite-dev gettext-dev doxygen graphviz perl