Skip to content

Commit

Permalink
Migrate from github to stash with packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
fatpat committed Dec 19, 2020
1 parent dbabd24 commit 4c65c19
Show file tree
Hide file tree
Showing 16 changed files with 360 additions and 126 deletions.
93 changes: 93 additions & 0 deletions .cds/gridinit-build.pip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
version: v1.0
name: gridinit-build

stages:
- compile
- package

jobs:
- job: Test and compile
stage: compile
steps:
- name: Checkout Application
checkout: '{{ .cds.workspace }}'
- name: Prepare system and install dependencies
script: |
#!/bin/bash
cat $0
set -ex
PKG='apt-get install -y --no-install-recommends'
export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true
echo "tzdata tzdata/Areas select Europe" > /tmp/preseed.txt
echo "tzdata tzdata/Zones/Europe select Brussels" >> /tmp/preseed.txt
debconf-set-selections /tmp/preseed.txt
apt-get update -q
$PKG tzdata ca-certificates
$PKG git pkg-config cmake make build-essential m4 autotools-dev autoconf automake libtool clang
$PKG libglib2.0-dev jq
- name: Compile local libdill (in order to be indenpendant from another package in testing)
script: |
#!/bin/bash
cat $0
set -ex
cd vendor/libdill
export CC=clang
./autogen.sh
./configure --prefix=/usr --enable-shared --disable-static --disable-tls --disable-threads
make -j 8
make install
- name: Compile and install gridinit
script: |
#!/bin/bash
cat $0
set -ex
export CC=clang
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_VERBOSE_MAKEFILE=TRUE -DCMAKE_INSTALL_PREFIX=/usr .
make -j 8
make install
- name: Test gridinit
script: |
#!/bin/bash
cat $0
set -ex
export TMPDIR=/tmp
./tools/gridinit-genconf.sh 15
gridinit -d -s gridinit /tmp/gridinit/gridinit.conf
./tools/cycle.sh
pkill gridinit
requirements:
- model: ubuntu-bionic

- job: Package
stage: package
steps:
- name: Checkout application
checkout: '{{ .cds.workspace }}'
- name: Clone external-packages
script:
- eval $(worker key install --env-git proj-ssh-openio)
- git clone {{ .cds.proj.STASH_URL }}/openio/external-packages.git /external-packages
- name: Build package and upload
script: |+
#!/bin/bash
cat $0
set -x
export REPO_URL="https://{{ .cds.proj.drive_mirrors_objectstorage_openio_user }}:{{ .cds.proj.drive_mirrors_objectstorage_openio_password }}@{{ .cds.proj.drive_mirrors_hostname }}"
make -f /external-packages/ubuntu/bionic/Makefile.common install-apt-repo
# dev or prod release
if [[ "{{ .git.tag }}" =~ ^[0-9]+\. ]]; then
export VERSION={{ .git.tag }}
export REPO_SUBREPO=main
export REPO_LIMIT=0
else
export VERSION=$(date +%Y%m%d%H%M).git{{ .git.hash.short }}
export REPO_SUBREPO=dev
export REPO_LIMIT=100
fi
export PACKAGE=gridinit
make -f /external-packages/ubuntu/bionic/Makefile.common deb_changelog
make -f /external-packages/ubuntu/bionic/Makefile.common
make -f /external-packages/ubuntu/bionic/Makefile.common upload_to_repo
requirements:
- model: openio-debbuild-18.04
21 changes: 21 additions & 0 deletions .cds/gridinit-mirror.pip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: v1.0
name: gridinit-mirror
jobs:
- job: Mirror to github
steps:
- name: Mirror to github
script:
# git clone directly in the script to prevent using checkout or gitclone action
# so we have full control on what we are doing
- set -x
- eval $(worker key install --env-git proj-ssh-openio)
- git clone --bare {{ .git.url }} {{ .cds.workspace }}
- cd {{ .cds.workspace }}
- git branch --all
# to remove branch to sync
#- git branch -D xxxx
- git push --mirror --prune --force https://openiobot:{{ .cds.proj.OPENIOBOT_GITHUB_TOKEN }}@github.com/open-io/gridinit.git
#- git push --prune https://openiobot:{{ .cds.proj.OPENIOBOT_GITHUB_TOKEN }}@github.com/open-io/gridinit.git +refs/remotes/origin/*:refs/heads/* +refs/tags/*:refs/tags/*

requirements:
- binary: git
3 changes: 3 additions & 0 deletions .cds/gridinit-root.pip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
version: v1.0
name: gridinit-root
jobs:
7 changes: 7 additions & 0 deletions .cds/gridinit.app.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: v1.0
name: gridinit
vcs_server: stash_ovh_net
repo: OPENIO/gridinit
vcs_connection_type: ssh
vcs_ssh_key: proj-ssh-openio
vcs_pgp_key: proj-pgp-openio
42 changes: 42 additions & 0 deletions .cds/gridinit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: gridinit
version: v2.0

workflow:
root:
pipeline: gridinit-root
application: gridinit

mirror:
pipeline: gridinit-mirror
application: gridinit
depends_on:
- root

build:
pipeline: gridinit-build
application: gridinit
depends_on:
- root
conditions:
check:
- variable: cds.triggered_by.username
operator: ne
value: "cds.scheduler"

metadata:
default_tags: git.branch,git.author

retention_policy: return (git_branch_exist == "false" and run_days_before < 2) or run_days_before < 365

notifications:
- type: vcs
settings:
on_success: always

hooks:
root:
- type: Scheduler
config:
# once very hour
cron: "56 * * * *"
timezone: UTC
78 changes: 0 additions & 78 deletions .circleci/config.yml

This file was deleted.

48 changes: 0 additions & 48 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9
23 changes: 23 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Source: gridinit
Section: admin
Priority: optional
Maintainer: PU ObjectStorage <[email protected]>
Uploaders: PU ObjectStorage <[email protected]>
Build-Depends: debhelper (>= 9),
dh-systemd,
cmake,
libglib2.0-dev,
xutils-dev,
libdill,
Standards-Version: 3.9.5

Package: gridinit
Architecture: any
Depends: ${shlibs:Depends},
${misc:Depends},
python3-setproctitle,
Description: OpenIO gridinit daemon
Init program used by the OpenIO Open Source Project. It forks processes
and respawns them as soon as they die. It also provides a simple management
interface through a UNIX socket. Services can be started/stopped/monitored.
OpenIO gridinit is a fork of Redcurrant gridinit, from Worldline by Atos.
38 changes: 38 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: openio-gridinit
Source: <url://example.com>

Files: *
Copyright: <years> <put author's name and email here>
<years> <likewise for another author>
License: <special license>
<Put the license of the package here indented by 1 space>
<This follows the format of Description: lines in control file>
.
<Including paragraphs>

# If you want to use GPL v2 or later for the /debian/* files use
# the following clauses, or change it to suit. Delete these two lines
Files: debian/*
Copyright: 2015 Romain Acciari <[email protected]>
License: GPL-2+
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
.
This package is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".

# Please also look if there are files or directories which have a
# different copyright/license attached and list them here.
# Please avoid to pick license terms that are more restrictive than the
# packaged work, as it may make Debian's contributions unacceptable upstream.
1 change: 1 addition & 0 deletions debian/docs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
README.md
27 changes: 27 additions & 0 deletions debian/gridinit.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
[Unit]
Description=Gridinit daemon from OpenIO
After=syslog.target network.target

[Service]
User=root
Group=root
ExecStart=/usr/bin/gridinit -s GRIDINIT,local,gridinit,0 /etc/gridinit.conf
ExecReload=/usr/bin/gridinit_cmd reload
Restart=on-failure
LimitCPU=infinity
LimitFSIZE=infinity
LimitDATA=infinity
#LimitSTACK=infinity
LimitCORE=0
LimitRSS=infinity
LimitNOFILE=500000
LimitAS=infinity
#LimitNPROC=infinity
#LimitMEMLOCK=infinity
#LimitLOCKS=infinity
#LimitSIGPENDING=infinity
#LimitMSGQUEUE=infinity
TasksMax=infinity

[Install]
WantedBy=multi-user.target
1 change: 1 addition & 0 deletions debian/gridinit.tmpfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d /run/gridinit 755 root root -
Loading

0 comments on commit 4c65c19

Please sign in to comment.