Skip to content

Commit e20ee25

Browse files
committed
Migrate from github to stash with packaging
1 parent dbabd24 commit e20ee25

16 files changed

+361
-126
lines changed

.cds/gridinit-build.pip.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
version: v1.0
2+
name: gridinit-build
3+
4+
stages:
5+
- compile
6+
- package
7+
8+
jobs:
9+
- job: Test and compile
10+
stage: compile
11+
steps:
12+
- name: Checkout Application
13+
checkout: '{{ .cds.workspace }}'
14+
- name: Prepare system and install dependencies
15+
script: |
16+
#!/bin/bash
17+
cat $0
18+
set -ex
19+
PKG='apt-get install -y --no-install-recommends'
20+
export DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true
21+
echo "tzdata tzdata/Areas select Europe" > /tmp/preseed.txt
22+
echo "tzdata tzdata/Zones/Europe select Brussels" >> /tmp/preseed.txt
23+
debconf-set-selections /tmp/preseed.txt
24+
apt-get update -q
25+
$PKG tzdata ca-certificates
26+
$PKG git pkg-config cmake make build-essential m4 autotools-dev autoconf automake libtool clang
27+
$PKG libglib2.0-dev jq
28+
- name: Compile local libdill (in order to be indenpendant from another package in testing)
29+
script: |
30+
#!/bin/bash
31+
cat $0
32+
set -ex
33+
cd vendor/libdill
34+
export CC=clang
35+
./autogen.sh
36+
./configure --prefix=/usr --enable-shared --disable-static --disable-tls --disable-threads
37+
make -j 8
38+
make install
39+
- name: Compile and install gridinit
40+
script: |
41+
#!/bin/bash
42+
cat $0
43+
set -ex
44+
export CC=clang
45+
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_VERBOSE_MAKEFILE=TRUE -DCMAKE_INSTALL_PREFIX=/usr .
46+
make -j 8
47+
make install
48+
- name: Test gridinit
49+
script: |
50+
#!/bin/bash
51+
cat $0
52+
set -ex
53+
export TMPDIR=/tmp
54+
./tools/gridinit-genconf.sh 15
55+
gridinit -d -s gridinit /tmp/gridinit/gridinit.conf
56+
./tools/cycle.sh
57+
pkill gridinit
58+
requirements:
59+
- model: ubuntu-bionic
60+
61+
- job: Package
62+
stage: package
63+
steps:
64+
- name: Checkout application
65+
checkout: '{{ .cds.workspace }}'
66+
- name: Clone external-packages
67+
script:
68+
- eval $(worker key install --env-git proj-ssh-openio)
69+
- git clone {{ .cds.proj.STASH_URL }}/openio/external-packages.git /external-packages
70+
- name: Build package and upload
71+
script: |+
72+
#!/bin/bash
73+
cat $0
74+
set -x
75+
export REPO_URL="https://{{ .cds.proj.drive_mirrors_objectstorage_openio_user }}:{{ .cds.proj.drive_mirrors_objectstorage_openio_password }}@{{ .cds.proj.drive_mirrors_hostname }}"
76+
make -f /external-packages/ubuntu/bionic/Makefile.common install-apt-repo
77+
# dev or prod release
78+
if [[ "{{ .git.tag }}" =~ ^[0-9]+\. ]]; then
79+
export VERSION={{ .git.tag }}
80+
export REPO_SUBREPO=main
81+
export REPO_LIMIT=0
82+
else
83+
export VERSION=$(date +%Y%m%d%H%M).git{{ .git.hash.short }}
84+
export REPO_SUBREPO=dev
85+
export REPO_LIMIT=100
86+
fi
87+
export PACKAGE=gridinit
88+
89+
make -f /external-packages/ubuntu/bionic/Makefile.common deb_changelog
90+
make -f /external-packages/ubuntu/bionic/Makefile.common
91+
make -f /external-packages/ubuntu/bionic/Makefile.common upload_to_repo
92+
requirements:
93+
- model: openio-debbuild-18.04

.cds/gridinit-mirror.pip.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
version: v1.0
2+
name: gridinit-mirror
3+
jobs:
4+
- job: Mirror to github
5+
steps:
6+
- name: Mirror to github
7+
script:
8+
# git clone directly in the script to prevent using checkout or gitclone action
9+
# so we have full control on what we are doing
10+
- set -x
11+
- eval $(worker key install --env-git proj-ssh-openio)
12+
# don't use --mirror to prevent mirroring pull requests ref
13+
# that would be messy
14+
- git clone --bare {{ .git.url }} {{ .cds.workspace }}
15+
- cd {{ .cds.workspace }}
16+
- git branch --all
17+
# to remove branch to sync
18+
#- git branch -D xxxx
19+
- git push --mirror --prune --force https://openiobot:{{ .cds.proj.OPENIOBOT_GITHUB_TOKEN }}@github.com/open-io/gridinit.git
20+
21+
requirements:
22+
- binary: git

.cds/gridinit-root.pip.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version: v1.0
2+
name: gridinit-root
3+
jobs:

.cds/gridinit.app.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: v1.0
2+
name: gridinit
3+
vcs_server: stash_ovh_net
4+
repo: OPENIO/gridinit
5+
vcs_connection_type: ssh
6+
vcs_ssh_key: proj-ssh-openio
7+
vcs_pgp_key: proj-pgp-openio

.cds/gridinit.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: gridinit
2+
version: v2.0
3+
4+
workflow:
5+
root:
6+
pipeline: gridinit-root
7+
application: gridinit
8+
9+
mirror:
10+
pipeline: gridinit-mirror
11+
application: gridinit
12+
depends_on:
13+
- root
14+
15+
build:
16+
pipeline: gridinit-build
17+
application: gridinit
18+
depends_on:
19+
- root
20+
conditions:
21+
check:
22+
- variable: cds.triggered_by.username
23+
operator: ne
24+
value: "cds.scheduler"
25+
26+
metadata:
27+
default_tags: git.branch,git.author
28+
29+
retention_policy: return (git_branch_exist == "false" and run_days_before < 2) or run_days_before < 365
30+
31+
notifications:
32+
- type: vcs
33+
settings:
34+
on_success: always
35+
36+
hooks:
37+
root:
38+
- type: Scheduler
39+
config:
40+
# once very hour
41+
cron: "56 * * * *"
42+
timezone: UTC

.circleci/config.yml

Lines changed: 0 additions & 78 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

debian/compat

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9

debian/control

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
Source: gridinit
2+
Section: admin
3+
Priority: optional
4+
Maintainer: PU ObjectStorage <pu.objectstorage@internal.ovh.net>
5+
Uploaders: PU ObjectStorage <pu.objectstorage@internal.ovh.net>
6+
Build-Depends: debhelper (>= 9),
7+
dh-systemd,
8+
cmake,
9+
libglib2.0-dev,
10+
xutils-dev,
11+
libdill,
12+
Standards-Version: 3.9.5
13+
14+
Package: gridinit
15+
Architecture: any
16+
Depends: ${shlibs:Depends},
17+
${misc:Depends},
18+
python3-setproctitle,
19+
Description: OpenIO gridinit daemon
20+
Init program used by the OpenIO Open Source Project. It forks processes
21+
and respawns them as soon as they die. It also provides a simple management
22+
interface through a UNIX socket. Services can be started/stopped/monitored.
23+
OpenIO gridinit is a fork of Redcurrant gridinit, from Worldline by Atos.

debian/copyright

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2+
Upstream-Name: openio-gridinit
3+
Source: <url://example.com>
4+
5+
Files: *
6+
Copyright: <years> <put author's name and email here>
7+
<years> <likewise for another author>
8+
License: <special license>
9+
<Put the license of the package here indented by 1 space>
10+
<This follows the format of Description: lines in control file>
11+
.
12+
<Including paragraphs>
13+
14+
# If you want to use GPL v2 or later for the /debian/* files use
15+
# the following clauses, or change it to suit. Delete these two lines
16+
Files: debian/*
17+
Copyright: 2015 Romain Acciari <romain.acciari@openio.io>
18+
License: GPL-2+
19+
This package is free software; you can redistribute it and/or modify
20+
it under the terms of the GNU General Public License as published by
21+
the Free Software Foundation; either version 2 of the License, or
22+
(at your option) any later version.
23+
.
24+
This package is distributed in the hope that it will be useful,
25+
but WITHOUT ANY WARRANTY; without even the implied warranty of
26+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27+
GNU General Public License for more details.
28+
.
29+
You should have received a copy of the GNU General Public License
30+
along with this program. If not, see <http://www.gnu.org/licenses/>
31+
.
32+
On Debian systems, the complete text of the GNU General
33+
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
34+
35+
# Please also look if there are files or directories which have a
36+
# different copyright/license attached and list them here.
37+
# Please avoid to pick license terms that are more restrictive than the
38+
# packaged work, as it may make Debian's contributions unacceptable upstream.

debian/docs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
README.md

debian/gridinit.service

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[Unit]
2+
Description=Gridinit daemon from OpenIO
3+
After=syslog.target network.target
4+
5+
[Service]
6+
User=root
7+
Group=root
8+
ExecStart=/usr/bin/gridinit -s GRIDINIT,local,gridinit,0 /etc/gridinit.conf
9+
ExecReload=/usr/bin/gridinit_cmd reload
10+
Restart=on-failure
11+
LimitCPU=infinity
12+
LimitFSIZE=infinity
13+
LimitDATA=infinity
14+
#LimitSTACK=infinity
15+
LimitCORE=0
16+
LimitRSS=infinity
17+
LimitNOFILE=500000
18+
LimitAS=infinity
19+
#LimitNPROC=infinity
20+
#LimitMEMLOCK=infinity
21+
#LimitLOCKS=infinity
22+
#LimitSIGPENDING=infinity
23+
#LimitMSGQUEUE=infinity
24+
TasksMax=infinity
25+
26+
[Install]
27+
WantedBy=multi-user.target

debian/gridinit.tmpfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
d /run/gridinit 755 root root -

0 commit comments

Comments
 (0)