2 # SPDX-License-Identifier: EPL-1.0
3 ##############################################################################
4 # Copyright (c) 2018 The Linux Foundation and others.
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Eclipse Public License v1.0
8 # which accompanies this distribution, and is available at
9 # http://www.eclipse.org/legal/epl-v10.html
10 ##############################################################################
11 echo "---> sigul-sign-dir.sh"
13 # Ensure we fail the job if any steps fail.
16 # shellcheck disable=SC1090
19 lf-activate-venv --python python3 lftools
21 OS=$(facter operatingsystem | tr '[:upper:]' '[:lower:]')
22 OS_RELEASE=$(facter lsbdistrelease | tr '[:upper:]' '[:lower:]')
23 if [[ "$OS_RELEASE" == "8" && "$OS" == 'centos' ]]; then
24 # Get Dockerfile and the enterpoint to build the docker image.
25 wget -O "${WORKSPACE}/sigul-sign.sh" "https://raw.githubusercontent.com/"\
26 "lfit/releng-global-jjb/master/shell/sigul-sign.sh"
27 wget -O "${WORKSPACE}/Dockerfile" "https://raw.githubusercontent.com/"\
28 "lfit/releng-global-jjb/master/docker/Dockerfile"
30 # Setup the docker environment for jenkins user
31 docker build -f ${WORKSPACE}/Dockerfile \
32 --build-arg SIGN_DIR=${SIGN_DIR} \
35 docker volume create --driver local \
37 --opt device=/w/workspace \
41 docker volume inspect wrkspc_vol
43 docker run -e SIGUL_KEY="${SIGUL_KEY}" \
44 -e SIGUL_PASSWORD="${SIGUL_PASSWORD}" \
45 -e SIGUL_CONFIG=${SIGUL_CONFIG} \
46 -e SIGN_DIR=${SIGN_DIR} \
47 -e WORKSPACE=${WORKSPACE} \
49 --security-opt label:disable \
50 --mount type=bind,source="/w/workspace",target="/w/workspace" \
51 --mount type=bind,source="/home/jenkins",target="/home/jenkins" \
52 -u root:root -w $(pwd) sigul-sign
54 # change the .asc files owner permissions back to jenkins
55 sudo chown -R jenkins:jenkins "${SIGN_DIR}"
57 lftools sign sigul -m "${SIGN_MODE}" "${SIGN_DIR}"