Skip to content
Snippets Groups Projects
Commit 8d654b8e authored by Eric Vidal's avatar Eric Vidal :speech_balloon:
Browse files

first commit

parents
No related branches found
No related tags found
No related merge requests found
trunk/*-66serv/
trunk/pkg/
trunk/src/
trunk/*.pkg.tar.xz
trunk/*.pkg.tar.xz.sig
image: obarun/pkgbuild:latest
variables:
repo: "$CI_PROJECT_DIR"
pkg_name: "$CI_PROJECT_NAME"
ssh_private_key: "$SSH_PRIVATE_KEY"
ssh_known_host: "$SSH_KNOWN_HOSTS"
# followed variable are ignored but
# need to be set
pkg_track: "branch"
pkg_target: "$CI_COMMIT_REF_NAME"
pkg_address: "$CI_PROJECT_URL"
stages:
- build
- deploy
build_repo:
stage: build
script:
# you can specify the directory where find pkgbuild
# with e.g builder.sh --chdir=trunk
# you can ask to install the package after a build
# e.g builder.sh --install
- builder.sh --chdir=trunk
artifacts:
expire_in: 2 days
paths:
- "*.pkg.tar.xz"
only:
changes:
- trunk/PKGBUILD
deploy:
stage: deploy
only:
changes:
- trunk/PKGBUILD
script:
- ./deploy.sh
#!/usr/bin/bash
# Copyright (c) 2015-2019 Eric Vidal <eric@obarun.org>
# All rights reserved.
#
# This file is part of Obarun. It is subject to the license terms in
# the LICENSE file found in the top-level directory of this
# distribution.
# This file may not be copied, modified, propagated, or distributed
# except according to the terms contained in the LICENSE file.
PROG="${0}"
install=0
reset='\033[0m'
red='\033[1;31m'
green='\033[1;32m'
yellow='\033[1;33m'
bold='\033[1m'
out() {
local errno="${1}" color="${2}" msg="${@:3}"
printf "${PROG}: ${color}%s${reset}: %s\n" "${errno}" "$msg" >&1
}
out_trace() {
out "tracing" "${bold}" "${@}"
}
out_success() {
out "success" "${green}" "${@}"
}
out_warn(){
out "warning" "${yellow}" "${@}"
}
out_error(){
out "fatal" "${red}" "${@}"
}
out_usage() {
out "usage" "${reset}" "${@}"
}
die() {
out_error "${@}"
exit 111
}
out_trace "Install openssh"
pacman -Sy openssh --noconfirm || die "Unable to install openssh"
out_trace "Starts ssh-agent"
eval $(ssh-agent)
out_trace "Configure ssh"
mkdir -p ~/.ssh || die "Unable to create ~/.ssh directory"
echo "${ssh_private_key}"| tr -d '\r' > ~/.ssh/id_rsa
chmod 700 ~/.ssh/id_rsa || die "Unable to change permissions of ~/.ssh/id_rsa"
ssh-add ~/.ssh/id_rsa || die "Unable to add key ~/.ssh/id_rsa"
echo ${ssh_known_host} > ~/.ssh/known_hosts
out_trace "Configure git"
git config --global user.name ${GITLAB_USER_NAME}
git config --global user.email ${GITLAB_USER_EMAIL}
out_trace "Cd to /tmp"
cd /tmp
out_trace "Clone git@${CI_SERVER_HOST}:/${CI_PROJECT_PATH}.git"
git clone git@${CI_SERVER_HOST}:/${CI_PROJECT_PATH}.git
out_trace "Cd to ${CI_PROJECT_NAME}"
cd ${CI_PROJECT_NAME}
out_trace "Retrieve pkgver and pkgrel variables from PKGBUILD"
source trunk/PKGBUILD
out_trace "Make directory of version: ${pkgver}-${pkgrel}"
mkdir -p version/${pkgver}-${pkgrel}
out_trace "Copy file from trunk to version/${pkgver}-${pkgrel}"
cp trunk/* version/${pkgver}-${pkgrel}
out_trace "Git add new file"
git add . || die "Unable to git add"
out_trace "Git commit message: upgpkg: ${pkgver}-${pkgrel}"
git commit -m "upgpkg: ${pkgver}-${pkgrel}" || die "Unable to commit"
out_trace "Push the new version"
git push --all || die "Unable to push at git@${CI_SERVER_HOST}:/${CI_PROJECT_PATH}.git"
exit 0
Copyright (c) 2018-2019 Eric Vidal <eric@obarun.org>
Copyright (c) 2015-2019 Jean-Michel T.Dydak <jean-michel@obarun.org>
All rights reserved.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# Obarun : 66 init/supervisor
# Maintainer : Eric Vidal <eric@obarun.org>
# Maintainer : Jean-Michel T.Dydak <jean-michel@obarun.org>
# Source : url="https://framagit.org/pkg/service/@BASE@-66serv"
#--------------------------------------------------------------------------------------
pkgbase=@BASE@
pkgdepends=@BASE@
pkgname="${pkgbase}"-66serv
pkgver=0.0.1
pkgrel=1
pkgdesc="${pkgbase} service for 66 tools"
url="https://framagit.org/pkg/service/${pkgbase}-66serv.git"
track=branch
checkout=master
source=("${pkgname}::git+${url}#${track}=${checkout}")
depends=(
"${pkgdepends}"
'66')
makedepends=(
'git')
#--------------------------------------------------------------------------------------
package() {
cd "${pkgname}/trunk"
install -Dm 0644 @BASE@ "${pkgdir}"/usr/lib/66/service/@BASE@
install -Dm644 LICENSE "${pkgdir}"/usr/share/licenses/"${pkgname}"/LICENSE
}
#--------------------------------------------------------------------------------------
sha512sums=('SKIP')
license=('ISC')
arch=('x86_64')
[main]
@type = classic,bundle,longrun,oneshot
@name =
@description = ""
@depends = ()
@contents = ()
@options = ( log env pipeline )
@flags = ( down nosetsid )
@notify =
@user = ()
@timeout-finish =
@timeout-kill =
@timeout-up =
@timeout-down =
@maxdeath =
@down-signal =
@hiercopy = ()
[start]
@build = auto,custom
@runas =
@shebang = ""
@execute = ()
[stop]
@build = auto,custom
@runas =
@shebang = ""
@execute = ()
[logger]
@build = auto,custom
@runas =
@shebang = ""
@destination =
@backup =
@maxsize =
@timestamp =
@timeout-finish =
@timeout-kill =
@execute = ()
[environment]
cmd_args= # command args
cmd_log= # place for the log of the command
cmd_dir= # place of the binaries
cmd_file= # extra file to use with command
cmd_args_stop= # stop command args
cmd_log_stop= # place for the log of the stop command
cmd_dir_stop= # place of the stop binaries
cmd_file_stop= # extra file to use with stop command
mnt_dir= # mountpoint directories
mnt_type= # mount type
mk_dir= # mkdir a directory
mk_dir_conf= # extra configuration to mkdir command
conf_dir= # directory of configuration file
conf_file= # name of the configuration file
script_dir= # script directory location
script_file= # name of the script
script_conf= # extra configuration to use with script
script_args= # command argument to pass to the scripts
socket_dir= # socket directory location
socket_name= # name of the socket
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment