Compare commits

...

42 Commits

Author SHA1 Message Date
wpetit 8db349571a Remplacement des '/' par '_' dans le tag d'image 2023-02-21 10:59:40 +01:00
wpetit 68ca0365ae Utilisation du proxy Cadoles pour le téléchargement de l'image Debian 2023-02-15 16:23:44 +01:00
Benjamin Bohard 6fe1d305e0 Ajout du profil pour la version 2.9.0 d'EOLE 2023-02-01 08:32:02 +01:00
Benjamin Bohard fdebf244d5 Mieux interpréter la numérotation utilisée pour les projets envole 2023-02-01 08:32:02 +01:00
Benjamin Bohard b49c8c8b02 Limit entries created in changelog. 2022-03-31 15:43:21 +02:00
Benjamin Bohard 766151eae3 Pour une poignée de profils 2022-03-29 10:42:21 +02:00
wpetit f8195ba9f7 Utilisation de wget pour la récupération des certificats LetsEncrypt
Contournement pour https://github.com/moby/buildkit/issues/905
2022-01-28 09:29:29 +01:00
Benjamin Bohard 47c7d0ac3c Suppression du hash de commit pour les paquets dev et staging 2022-01-12 15:08:30 +01:00
wpetit 4c4fd6d42c Add 'no libs volumes' mode 2021-02-25 08:42:54 +01:00
wpetit 546e62e077 Update LetsEncrypt certs 2021-02-22 15:41:22 +01:00
wpetit 4b61e5dafc Install LetsEncrypt CA in packaging environment 2021-02-18 18:56:45 +01:00
Benjamin Bohard c83e6190c4 Find first commit starting from HEAD 2020-09-16 11:31:47 +02:00
Benjamin Bohard cad163ffd0 Branch master is not always available, pointing to origin/master 2020-09-16 10:25:16 +02:00
Benjamin Bohard 97fd00a3c7 Fixes changelog creation starting on a pkg tag 2020-09-16 09:39:35 +02:00
Benjamin Bohard fdba555beb New profile and remove debug flag in hook 2020-09-03 14:50:36 +02:00
Benjamin Bohard 253c77489b Fixes changelog et version computation 2020-09-03 08:45:00 +02:00
Benjamin Bohard 9a46f34f73 SSH for Jenkins 2020-09-02 15:49:20 +02:00
Benjamin Bohard 5a4c17a959 Add script for using ssh with options 2020-09-02 15:10:50 +02:00
Benjamin Bohard be739a965c Attempt to fix comparison problem with git hash added 2020-08-27 17:19:56 +02:00
Benjamin Bohard e49636df62 Merge changelog creation and package name suffix in one hook 2020-08-25 14:23:59 +02:00
Benjamin Bohard 878b8c48ce Refactor changelog based on git history 2020-08-25 11:25:34 +02:00
Benjamin Bohard 0d5470e1a7 Profil pour EOLE 2.8.0 2020-08-12 08:32:12 +02:00
Benjamin Bohard ea5a73210f EOLE 2.7.1 profile 2020-07-27 16:23:11 +02:00
wpetit f1ce64b1be Affichage du changelog générée dans la sortie standard 2020-07-08 11:43:13 +02:00
wpetit ef4c6d821f Gestion de la présence ou non d'espaces dans l'attribut 'Source' du
fichier debian/control
2020-07-08 11:42:38 +02:00
wpetit 5fd65bbb89 Permettre la préparation seule de l'environnement Docker
... via l'utilisation du drapeau '--prepare-only'
2020-03-25 12:16:02 +01:00
Teddy Cornaut db952bc2f7 Passage a Debian Stretch 2019-03-26 14:05:13 +01:00
wpetit 09673ce967 Ignore release/XXX tags by default 2019-03-15 11:47:41 +01:00
Benjamin Bohard f87c18f907 Merge branch 'feature/4-tag_to_package_suffix' into develop 2018-03-21 11:19:38 +01:00
Benjamin Bohard 1c146441fb Utiliser git describe pour récupérer le tag en fonction de la branche active.
Ref #4
2018-03-21 11:19:12 +01:00
Benjamin Bohard 60b0eaad53 Utiliser git describe pour récupérer le tag en fonction de la branche active.
Ref #4
2018-03-21 11:14:16 +01:00
wpetit 71f2bb767f Merge branch 'feature/docker-args' into develop 2017-07-24 17:18:53 +02:00
wpetit 948745877c Fix templating 2017-07-17 17:59:33 +02:00
wpetit 422407a37c Ajout des points d'insertions [ARCH] et [PROFILE] pour la commande passée au drapeau override-docker-args 2017-07-17 17:54:25 +02:00
wpetit 110097ec81 String override 2017-07-11 17:39:47 +02:00
wpetit 4e27cc8b6e IMAGE_TAG templating in arguments 2017-07-11 14:42:52 +02:00
wpetit f1bccc8e23 OVerride all 2017-07-11 14:36:22 +02:00
wpetit 7f8a13bd52 Add default flags 2017-07-11 12:14:38 +02:00
wpetit 16b0ef996d Correction init docker_args 2017-07-11 12:07:00 +02:00
wpetit 50f578216b Ajout drapeau pour surcharger totalement les drapeaux docker 2017-07-11 11:56:41 +02:00
wpetit 7ead22e8ec Fix arguments order 2017-07-10 17:29:39 +02:00
wpetit 17d371c804 Add flag to append custom arguments to the docker run command 2017-07-10 17:24:12 +02:00
16 changed files with 602 additions and 30 deletions

View File

@ -0,0 +1,28 @@
#!/usr/bin/env bash
set -e
DESTDIR=/usr/local/share/ca-certificates
UPDATE_CERTS_CMD=update-ca-certificates
CERTS="$(cat <<EOF
https://letsencrypt.org/certs/isrgrootx1.pem
https://letsencrypt.org/certs/isrg-root-x2.pem
https://letsencrypt.org/certs/lets-encrypt-r3.pem
https://letsencrypt.org/certs/lets-encrypt-e1.pem
https://letsencrypt.org/certs/lets-encrypt-r4.pem
https://letsencrypt.org/certs/lets-encrypt-e2.pem
EOF
)"
echo "ENV DEBIAN_FRONTEND=noninteractive" >> Dockerfile
echo "RUN apt-get update && apt-get install --yes --no-install-recommends wget openssl ca-certificates" >> Dockerfile
for cert in $CERTS; do
filename=$(basename "$cert")
echo "RUN wget -O '$DESTDIR/$filename' $cert" >> Dockerfile
echo "RUN openssl x509 -in '$DESTDIR/$filename' -inform PEM -out '$DESTDIR/$filename.crt'" >> Dockerfile
done
echo "RUN $UPDATE_CERTS_CMD" >> Dockerfile
echo "ENV DEBIAN_FRONTEND=" >> Dockerfile

View File

@ -7,7 +7,7 @@ if [ ! -f debian/control ]; then
exit 1
fi
package_name=$(grep -E '^Source:' debian/control | awk '{ print $2 }')
package_name=$(sed -n 's/^Source:[ \t]*\(.*\)$/\1/p' debian/control | tr -d '[:space:]')
project_name=$(tamarin_db get project_name)
if [ "${package_name}" != "${project_name}" ]; then

View File

@ -7,6 +7,13 @@ if [ -f debian/changelog ] || [ ! -d .git ]; then
exit
fi
# Check ignore release tag
IGNORE_RELEASE_TAG=$(tamarin_db get ignore_release_tag "yes")
if [ "${IGNORE_RELEASE_TAG}" == "yes" ]; then
tamarin_warn "Release tag is ignored. Add 'ignore_release_tag=no' in .tamarinrc to enable."
exit
fi
# Get commits log as changelog
BUILD_TAG=$(tamarin_db get build_tag "last")
@ -15,7 +22,7 @@ tamarin_debug "BUILD TAG IS ${BUILD_TAG}"
if [[ ${BUILD_TAG} == "last" ]]
then
tags=$(git tag master -l "release/*" | tr '_' '-' | sort -rV)
tags=$(git describe --match "release/*" --abbrev=0)
else
tagbranch="build-tag-${BUILD_TAG}"
git checkout -b ${tagbranch}

View File

@ -19,3 +19,8 @@ echo >> ${changelog}
echo " * Package built with Tamarin. Based on commit ${current_commit}." >> ${changelog}
echo >> ${changelog}
echo " -- ${top_contributor} ${date}" >> ${changelog}
tamarin_info "Generated dummy changelog:"
tamarin_info " "
cat ${changelog} | tamarin_info
tamarin_info " "

View File

@ -0,0 +1,39 @@
#!/usr/bin/env bash
cd src
if [ ! -f debian/changelog ]; then
tamarin_info "No changelog. Skipping adding suffix to package version"
exit
fi
if [ $(tamarin_db get no_version_suffix 'no') == 'yes' ]; then
tamarin_info "Not adding version suffix."
exit
fi
tamarin_info "Suffixing package version"
if [ -d .git ]; then
tamarin_info "It seems to be a Git repository. Generating version suffix based on Git history..."
release_tag=$(git describe --match "release/*" --abbrev=0 2>/dev/null)
if [ -z "${release_tag}" ]
then
dev_commit_count=$(git rev-list --count --no-merges develop)
else
dev_commit_count=$(git rev-list --count ${release_tag}..master)
fi
if [ ${dev_commit_count} -gt 0 ]
then
build_level=$(tamarin_db get build_level 'dev')
version_suffix="~$build_level+${dev_commit_count}-$(git log -n1 --format=%h)"
else
version_suffix=''
fi
else
tamarin_info "Not a Git project. Fallback to timestamp for suffix generation..."
version_suffix=tamarin$(date +%Y%m%d%H%M)
fi
tamarin_info "Suffixing package version with $version_suffix"
sed -i "0,/(\(.*\))/s/(\(.*\))/(\1${version_suffix})/" debian/changelog
cp debian/changelog /dist/changelog

View File

@ -0,0 +1,276 @@
#!/usr/bin/env bash
cd src
if [ -f debian/changelog ] || [ ! -d .git ]; then
tamarin_info "Not a Git repository or Debian changelog already exists !"
exit
else
tamarin_info "Creating changelog with commits information."
fi
# Get pkg tags as tie points in commit history
pkg_tags="$(git for-each-ref --format '%(refname)' refs/tags | tac)"
# Set starting commit
ceiling_commit=$(git describe --match "build/*" --abbrev=0 2>/dev/null)
if [ -z "$ceiling_commit" ]
then
ceiling_commit="HEAD"
fi
first_commit=$(git rev-list --max-parents=0 HEAD)
# Get commits log as changelog
current_release_tag=$(git describe --match "release/*" --abbrev=0 2>/dev/null)
if [[ -z ${current_release_tag} ]]
then
tamarin_warn "No release tag found, you repo should have a tag like 'release/*'"
tamarin_info "Assuming tag release/0.0.0 on first commit of branch master"
current_release="release/0.0.0"
current_release_tag=${first_commit}
else
current_release=$current_release_tag
fi
touch debian/changelog
project_name=$(tamarin_db get project_name)
distribution=$(tamarin_db get distribution UNRELEASED)
urgency=$(tamarin_db get urgency low)
package_level=$(tamarin_db get package_level dev)
function get_hash {
# Return commit hash from various pointer
pointer="$1"
echo "$(git log -n1 --format=%H ${pointer})"
}
function get_short_hash {
# Return commit short hash from various pointer
pointer="$1"
echo "$(git log -n1 --format=%h ${pointer})"
}
function get_previous_pkg_tag {
# Return previous pkg/* tag or current tag if no previous pkg/* exists.
commit="$1"
echo "$(git describe --abbrev=0 --match='pkg/*' $commit 2>/dev/null)"
}
function parse_tag {
tag="$1"
flavor="${tag%%/*}"
extended_version="${tag##*/}"
if [ "$flavor" = "pkg" ]
then
exploded_version="$(echo $extended_version | sed "s/\([a-z0-9.+]\+\)-\([0-9]\+\)\(-[a-z]\++[0-9]\+\)\?\(-\([0-9]\+\)-\(g[a-z0-9]\+\)\)\?$/version:\1 revision:\2 modification:\3 distance:\5 anchor:\6/")"
elif [ "$flavor" = "release" ]
then
exploded_version="$(echo $extended_version | sed "s/\([a-z0-9.+]\+\)\(-\([0-9]\+\)-\(g[a-z0-9]\+\)\)\?$/version:\1 distance:\3 anchor:\4/")"
fi
echo $exploded_version
}
function get_distance_from_tag {
description_tag="$1"
tag=${description_tag%-*-*}
anchor="$2"
if [[ "$(get_hash $tag)" =~ "$(get_hash $anchor)" ]]
then
echo 0
else
distance="$(parse_tag $description_tag)"
distance="${distance#*distance:}"
distance="${distance%% *}"
echo $distance
fi
}
function get_upstream_version_from_tag {
tag="$1"
upstream="$(parse_tag $tag)"
upstream="${upstream#*version:}"
upstream="${upstream%% *}"
echo "$upstream"
}
function get_package_version_from_tag {
tag="$1"
package="$(parse_tag $tag)"
package="${package#*revision:}"
package="${package%% *}"
echo "$package"
}
function get_distribution_from_tag {
# tag pkg like pkg/<level>/<distrib>/<version>
# <distrib> may be composed
tag="$1"
distribution="${tag#pkg/*/}"
distribution="${distribution%/*}"
distribution="${distribution/\//-}"
echo $distribution
}
function get_previous_release_tag {
# Return previous pkg/* tag or current tag if no previous pkg/* exists.
commit="$1"
echo "$(git describe --abbrev=0 --always --match='release/*' $commit)"
}
function on_pkg_tag {
# Return 1 if current commit is tagged with pkg/* tag.
commit="$1"
nearest_old_pkg_tag="$(get_previous_pkg_tag $commit)"
if [ -n "${nearest_old_pkg_tag}" ] && [ "$(get_hash ${commit})" = "$(get_hash ${nearest_old_pkg_tag})" ]
then
return 0
else
return 1
fi
}
function next_step {
# Return previous pkg/* tag or first commit if no pkg/* tag exists
commit="$1"
if [ "$(get_hash $commit)" = "$(get_hash $first_commit)" ]
then
echo $commit
elif on_pkg_tag $commit
then
nearest_old_pkg_tag="$(get_previous_pkg_tag ${commit}^1)"
else
nearest_old_pkg_tag="$(get_previous_pkg_tag ${commit})"
fi
if [[ "$nearest_old_pkg_tag" =~ 'pkg/' ]]
then
echo $nearest_old_pkg_tag
else
echo $first_commit
fi
}
function date_from_commit {
# Return date suitable for changelog entry signature
commit="$1"
if [ "$(get_hash ${commit})" = "$(get_hash HEAD)" ]
then
package_date=$(date --rfc-2822)
else
maintainer_commit="$(get_previous_pkg_tag $commit)"
package_date="$(git tag -l --format='%(creator)' ${maintainer_commit})"
package_date="${package_date##*> }"
package_date="$(date --rfc-2822 -d @${package_date% *})"
fi
echo "$package_date"
}
function packager_from_commit {
# Return Name <mail> id format, suitable for changelog entry signature
commit="$1"
if on_pkg_tag "${commit}"
then
maintainer_commit="$(get_previous_pkg_tag $commit)"
maintainer="$(git tag -l --format='%(creator)' ${maintainer_commit})"
maintainer="${maintainer%>*}>"
else
maintainer="$(git log -n1 --format='%cn <%ce>')"
fi
maintainer=$(tamarin_db get maintainer "${maintainer}")
echo "$maintainer"
}
function next_version {
set -x
commit="$1"
# upstream version is given by most recent of release or pkg tag
previous_pkg="$(git describe --long --match='pkg/*' $commit 2>/dev/null)"
previous_release="$(git describe --long --match='release/*' $commit 2>/dev/null)"
if [ -n "$previous_release" ] && [ -n "$previous_pkg" ]
then
distance_from_pkg=$(get_distance_from_tag "$previous_pkg" "$commit")
distance_from_release=$(get_distance_from_tag "$previous_release" "$commit")
if [ $distance_from_release -le $distance_from_pkg ]
then
distance=$distance_from_release
version="$(get_upstream_version_from_tag $previous_release)-1"
else
distance=$distance_from_pkg
version="$(get_upstream_version_from_tag $previous_pkg)-$(expr $(get_package_version_from_tag $previous_pkg) + 1)"
fi
elif [ -n "$previous_release" ]
then
distance_from_release=$(get_distance_from_tag "$previous_release" "$commit")
distance=$distance_from_release
version="$(get_upstream_version_from_tag $previous_release)-1"
elif [ -n "$previous_pkg" ]
then
distance_from_pkg=$(get_distance_from_tag "$previous_pkg" "$commit")
distance=$distance_from_pkg
version="$(get_upstream_version_from_tag $previous_pkg)-$(expr $(get_package_version_from_tag $previous_pkg) + 1)"
else
distance=$(git rev-list --no-merges --count ${commit}..${first_commit})
version="0.0.0-1"
fi
if [ "$package_level" = 'dev' ] || [ "$package_level" = 'staging' ]
then
version="${version}~${package_level}+${distance}"
fi
echo $version
set +x
}
function gen_changelog_entry {
ceiling_commit=$1
floor_commit="$(next_step "${ceiling_commit}")"
if [ "$(get_hash ${ceiling_commit})" = "$(get_hash ${floor_commit})" ]
then
return 1
fi
if on_pkg_tag $ceiling_commit
then
ceiling_commit="$(get_previous_pkg_tag $ceiling_commit)"
version="$(get_upstream_version_from_tag $ceiling_commit)-$(get_package_version_from_tag $ceiling_commit)"
distribution="$(get_distribution_from_tag $ceiling_commit)"
else
tamarin_info "current commit $ceiling_commit"
version=$(next_version $ceiling_commit)
distribution="UNRELEASED"
fi
#current_release="$(git describe --abbrev=0 --always --match='release/*' $ceiling_commit)"
tamarin_info "Création de lentrée de changelog entre ${ceiling_commit} et ${floor_commit}"
maintainer="$(packager_from_commit ${ceiling_commit})"
package_date="$(date_from_commit ${ceiling_commit})"
version=${version/_/-}
changelog_entry="${project_name} (${version}) ${distribution}; urgency=${urgency}"
echo "$changelog_entry" >> debian/changelog
echo >> debian/changelog
for commit in $(git log --no-merges --format='%H' ${floor_commit}..${ceiling_commit})
do
subject="$(git log -n1 --format=%s ${commit})"
echo " * ${subject}" >> debian/changelog
#ceiling_commit="$(git log -n1 --format='%H' ${commit}^1)"
done
echo >> debian/changelog
changelog_sign=" -- ${maintainer} ${package_date}"
echo "$changelog_sign" >> debian/changelog
echo >> debian/changelog
ceiling_commit=${floor_commit}
}
function gen_changelog() {
limit=10
while gen_changelog_entry $ceiling_commit
do
limit=`expr $limit - 1`
echo $changelog_entry
if [ "$limit" -le 0 ]
then
break
fi
done
}
gen_changelog
cp debian/changelog /dist/changelog

View File

@ -12,12 +12,18 @@ def run_profile_hooks(profile, step, **kwargs):
hook_path = os.path.join(hooks_dir, trimmed_hook_name)
run([hook_path], **kwargs)
def get_base_dir():
return os.path.realpath(os.path.dirname(os.path.abspath(__file__)) + "/..")
def get_hooks_dir():
return os.path.realpath(os.path.dirname(os.path.abspath(__file__)) + "/../hooks")
def get_lib_dir():
return os.path.realpath(os.path.dirname(os.path.abspath(__file__)) + "/../lib")
def get_utils_dir():
return os.path.realpath(os.path.dirname(os.path.abspath(__file__)) + "/../utils")
def load_profile(profile_name, debug=False):
profile_filename = profile_name+".conf"
for profile_file in get_available_profiles():
@ -52,8 +58,9 @@ def get_workspace_subdir(subdir):
def run(cmd, captureOutput=False, pty=False, debug=False, **kwargs):
"""Execute an arbitrary command on the system"""
if debug:
print(" ".join(cmd))
print(" ".join(cmd) if isinstance(cmd, list) else cmd)
stdin=subprocess.PIPE
kwargs['shell'] = False if isinstance(cmd, list) else True
if pty:
kwargs['stdin'] = sys.stdin
if captureOutput:
@ -62,4 +69,8 @@ def run(cmd, captureOutput=False, pty=False, debug=False, **kwargs):
return subprocess.check_call(cmd, **kwargs)
def run_docker(args, captureOutput=False, **kwargs):
return run(["docker"] + args, captureOutput=captureOutput, **kwargs)
if isinstance(args, list):
cmd = ["docker"] + args
else:
cmd = "docker " + args
return run(cmd, captureOutput=captureOutput, **kwargs)

70
package
View File

@ -21,13 +21,18 @@ def create_args_parser():
parser.add_argument("--rebuild", help="Ignore cache and rebuild container's image", action="store_true", default=False)
parser.add_argument("--debug", help="Will add extra output and start the container in interactive mode", action="store_true", default=False)
parser.add_argument("--cleanup", help="Clear the workspace and remove obsolete Docker images before build", action="store_true", default=False)
parser.add_argument("--override-docker-args", help="Override all 'docker run' arguments. Use '[IMAGE_TAG]', '[PROFILE]' and '[ARCH]' to insert the corresponding values into your command.", default="")
parser.add_argument("--prepare-only", help="Only prepare build environment for the given profile", action="store_true", default=False)
parser.add_argument("--no-lib-mounts", help="Disable Tamarin library volumes mount", action="store_true", default=False)
return parser
def build_image(build_workspace, base_image, profile_name, profile, debug=False, rebuild=False):
shutil.copytree(tamarin.get_base_dir(), os.path.join(build_workspace, '.tamarin'))
with open("{:s}/Dockerfile".format(build_workspace), 'w') as dockerfile:
dockerfile.write("FROM {:s}\n".format(base_image))
dockerfile.write("COPY .tamarin /tamarin\n")
# Configure "containerbuild" hooks environment
hooks_env = os.environ.copy()
@ -36,7 +41,7 @@ def build_image(build_workspace, base_image, profile_name, profile, debug=False,
# Run hooks
tamarin.run_profile_hooks(profile, 'containerbuild', cwd=build_workspace, env=hooks_env, debug=debug)
image_tag = "tamarin:{:s}_{:s}_{:d}".format(profile_name, base_image.replace(':', '_'), os.getpid())
image_tag = "tamarin:{:s}_{:s}_{:d}".format(profile_name, base_image.replace(':', '_').replace('/', '_'), os.getpid())
build_args = [ "build", "-t", image_tag ]
@ -63,8 +68,6 @@ if __name__ == "__main__":
parser = create_args_parser()
args = parser.parse_args()
validate_args(args)
if args.cleanup:
cleanup(debug=args.debug)
@ -80,36 +83,55 @@ if __name__ == "__main__":
pid = os.getpid()
build_workspace = tamarin.get_workspace_subdir('tmp/build_{:d}'.format(pid))
shutil.copytree(tamarin.get_utils_dir(), os.path.join(build_workspace, 'utils'))
base_image = args.base if args.base != '' else profile['profile']['default_image']
image_tag = build_image(build_workspace, base_image, args.profile, profile, debug=args.debug, rebuild=args.rebuild)
# rkt run arguments
docker_args = [
"run",
"--rm",
"-v", "{:s}:/src:ro".format(project_dir),
"-v", "{:s}:/dist".format(output_dir),
"-v", "{:s}:/tamarin/hooks:ro".format(tamarin.get_hooks_dir()),
"-v", "{:s}:/tamarin/lib:ro".format(tamarin.get_lib_dir()),
"-v", "{:s}:/tamarin/profiles:ro".format(tamarin.get_profiles_dir())
]
# Use environment proxy if defined
for proxy_var in ['HTTP_PROXY', 'HTTPS_PROXY', 'http_proxy', 'https_proxy']:
if proxy_var in os.environ:
docker_args += ["-e", "{:s}={:s}".format(proxy_var, os.environ[proxy_var])]
if args.prepare_only:
exit()
kwargs = dict()
kwargs['debug'] = args.debug
if args.debug:
kwargs['pty'] = True
docker_args += ["-it", image_tag, "/bin/sh"]
helper_cmd = " ".join(["/usr/bin/python3", "/tamarin/lib/build.py", args.profile, args.architecture])
print("Executer '{:s}' pour lancer la construction du paquet.".format(helper_cmd))
docker_args = []
# Append custom arguments
if args.override_docker_args != "":
docker_args = args.override_docker_args.replace('[IMAGE_TAG]', image_tag)
docker_args = docker_args.replace('[PROFILE]', args.profile)
docker_args = docker_args.replace('[ARCH]', args.architecture)
else:
docker_args += [image_tag, "/usr/bin/python3", "/tamarin/lib/build.py", args.profile, args.architecture]
docker_args += [ "run", "--rm" ]
# volumes definition
docker_args += [
"-v", "{:s}:/src:ro".format(project_dir),
"-v", "{:s}:/dist".format(output_dir),
]
if not args.no_lib_mounts:
docker_args += [
"-v", "{:s}:/tamarin/hooks:ro".format(tamarin.get_hooks_dir()),
"-v", "{:s}:/tamarin/lib:ro".format(tamarin.get_lib_dir()),
"-v", "{:s}:/tamarin/profiles:ro".format(tamarin.get_profiles_dir()),
"-v", "{:s}:/tamarin/utils:ro".format(tamarin.get_utils_dir())
]
# Use environment proxy if defined
for proxy_var in ['HTTP_PROXY', 'HTTPS_PROXY', 'http_proxy', 'https_proxy']:
if proxy_var in os.environ:
docker_args += ["-e", "{:s}={:s}".format(proxy_var, os.environ[proxy_var])]
if args.debug:
kwargs['pty'] = True
docker_args += ["-it", image_tag, "/bin/sh"]
helper_cmd = " ".join(["/usr/bin/python3", "/tamarin/lib/build.py", args.profile, args.architecture])
print("Executer '{:s}' pour lancer la construction du paquet.".format(helper_cmd))
else:
docker_args += [image_tag, "/usr/bin/python3", "/tamarin/lib/build.py", args.profile, args.architecture]
# Start container
tamarin.run_docker(docker_args, **kwargs)

View File

@ -1,13 +1,14 @@
# Configuration générale du profil
[profile]
# Image Docker par défaut
default_image=debian:jessie
default_image=reg.cadoles.com/proxy_cache/library/debian:stretch
# Configuration de l'étape de pré-construction du conteneur
[containerbuild]
hooks=
containerbuild/debian/install-build-essential,
containerbuild/debian/install-git
containerbuild/debian/install-git,
containerbuild/debian/install-letsencrypt-ca
# Configuration de l'étape de pré-construction du paquet
[prebuild]

30
profiles/eole-2.7.0.conf Normal file
View File

@ -0,0 +1,30 @@
# Configuration générale du profil
[profile]
# Image Docker par défaut
default_image=ubuntu:bionic
# Configuration de l'étape de pré-construction du conteneur
[containerbuild]
hooks=
containerbuild/debian/install-build-essential,
containerbuild/debian/install-git,
# Configuration de l'étape de pré-construction du paquet
[prebuild]
hooks=
prebuild/debian/copy-sources-to-workspace,
prebuild/debian/run-project-hooks,
prebuild/debian/load-project-db,
prebuild/debian/complete-project-db,
prebuild/eole/create-changelog,
prebuild/debian/install-build-depends
# Configuration de l'étape de construction du paquet
[build]
hooks=build/debian/build
# Configuration de l'étape de post-construction du paquet
[postbuild]
hooks=
postbuild/debian/run-project-hooks,
postbuild/debian/export-dist

30
profiles/eole-2.7.1.conf Normal file
View File

@ -0,0 +1,30 @@
# Configuration générale du profil
[profile]
# Image Docker par défaut
default_image=ubuntu:bionic
# Configuration de l'étape de pré-construction du conteneur
[containerbuild]
hooks=
containerbuild/debian/install-build-essential,
containerbuild/debian/install-git,
# Configuration de l'étape de pré-construction du paquet
[prebuild]
hooks=
prebuild/debian/copy-sources-to-workspace,
prebuild/debian/run-project-hooks,
prebuild/debian/load-project-db,
prebuild/debian/complete-project-db,
prebuild/eole/create-changelog,
prebuild/debian/install-build-depends
# Configuration de l'étape de construction du paquet
[build]
hooks=build/debian/build
# Configuration de l'étape de post-construction du paquet
[postbuild]
hooks=
postbuild/debian/run-project-hooks,
postbuild/debian/export-dist

30
profiles/eole-2.7.2.conf Normal file
View File

@ -0,0 +1,30 @@
# Configuration générale du profil
[profile]
# Image Docker par défaut
default_image=ubuntu:bionic
# Configuration de l'étape de pré-construction du conteneur
[containerbuild]
hooks=
containerbuild/debian/install-build-essential,
containerbuild/debian/install-git,
# Configuration de l'étape de pré-construction du paquet
[prebuild]
hooks=
prebuild/debian/copy-sources-to-workspace,
prebuild/debian/run-project-hooks,
prebuild/debian/load-project-db,
prebuild/debian/complete-project-db,
prebuild/eole/create-changelog,
prebuild/debian/install-build-depends
# Configuration de l'étape de construction du paquet
[build]
hooks=build/debian/build
# Configuration de l'étape de post-construction du paquet
[postbuild]
hooks=
postbuild/debian/run-project-hooks,
postbuild/debian/export-dist

30
profiles/eole-2.8.0.conf Normal file
View File

@ -0,0 +1,30 @@
# Configuration générale du profil
[profile]
# Image Docker par défaut
default_image=ubuntu:focal
# Configuration de l'étape de pré-construction du conteneur
[containerbuild]
hooks=
containerbuild/debian/install-build-essential,
containerbuild/debian/install-git,
# Configuration de l'étape de pré-construction du paquet
[prebuild]
hooks=
prebuild/debian/copy-sources-to-workspace,
prebuild/debian/run-project-hooks,
prebuild/debian/load-project-db,
prebuild/debian/complete-project-db,
prebuild/eole/create-changelog,
prebuild/debian/install-build-depends
# Configuration de l'étape de construction du paquet
[build]
hooks=build/debian/build
# Configuration de l'étape de post-construction du paquet
[postbuild]
hooks=
postbuild/debian/run-project-hooks,
postbuild/debian/export-dist

30
profiles/eole-2.8.1.conf Normal file
View File

@ -0,0 +1,30 @@
# Configuration générale du profil
[profile]
# Image Docker par défaut
default_image=ubuntu:focal
# Configuration de l'étape de pré-construction du conteneur
[containerbuild]
hooks=
containerbuild/debian/install-build-essential,
containerbuild/debian/install-git,
# Configuration de l'étape de pré-construction du paquet
[prebuild]
hooks=
prebuild/debian/copy-sources-to-workspace,
prebuild/debian/run-project-hooks,
prebuild/debian/load-project-db,
prebuild/debian/complete-project-db,
prebuild/eole/create-changelog,
prebuild/debian/install-build-depends
# Configuration de l'étape de construction du paquet
[build]
hooks=build/debian/build
# Configuration de l'étape de post-construction du paquet
[postbuild]
hooks=
postbuild/debian/run-project-hooks,
postbuild/debian/export-dist

31
profiles/eole-2.9.0.conf Normal file
View File

@ -0,0 +1,31 @@
# Configuration générale du profil
[profile]
# Image Docker par défaut
default_image=ubuntu:jammy
# Configuration de l'étape de pré-construction du conteneur
[containerbuild]
hooks=
containerbuild/debian/install-build-essential,
containerbuild/debian/install-git,
containerbuild/eole-2.9.0/configure-additional-repository,
# Configuration de l'étape de pré-construction du paquet
[prebuild]
hooks=
prebuild/debian/copy-sources-to-workspace,
prebuild/debian/run-project-hooks,
prebuild/debian/load-project-db,
prebuild/debian/complete-project-db,
prebuild/eole/create-changelog,
prebuild/debian/install-build-depends
# Configuration de l'étape de construction du paquet
[build]
hooks=build/debian/build
# Configuration de l'étape de post-construction du paquet
[postbuild]
hooks=
postbuild/debian/run-project-hooks,
postbuild/debian/export-dist

2
utils/sshForJenkins.sh Normal file
View File

@ -0,0 +1,2 @@
#!/bin/sh
exec ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null "$@"