Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function die() {
}

function logmust() {
echo Running: "$@"
[[ "$LOGGING" == "false" ]] || echo Running: "$@" >&2
"$@" || die "failed command '$*'"
}

Expand Down
57 changes: 57 additions & 0 deletions packages/masking/config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/bin/bash
#
# Copyright 2021 Delphix
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# shellcheck disable=SC2034

DEFAULT_PACKAGE_GIT_URL="https://gitlab.delphix.com/masking/dms-core-gate.git"
PACKAGE_DEPENDENCIES="adoptopenjdk"

function prepare() {
logmust install_pkgs "$DEPDIR"/adoptopenjdk/*.deb
}

function build() {
export JAVA_HOME
JAVA_HOME=$(cat "$DEPDIR/adoptopenjdk/JDK_PATH") ||
die "Failed to read $DEPDIR/adoptopenjdk/JDK_PATH"

logmust cd "$WORKDIR/repo"

#
# The "appliance-build-stage0" Jenkins job consumes this file,
# along with various other files (e.g. licensing metadata).
# Thus, if we don't generate it here, the Jenkins job that
# builds the appliance will fail.
#
# shellcheck disable=SC2016
logmust jq -n \
--arg h "$(git rev-parse HEAD)" \
--arg d "$(date --utc --iso-8601=seconds)" \
'{ "dms-core-gate" : { "git-hash" : $h, "date": $d }}' \
>"$WORKDIR/artifacts/metadata.json"

logmust ./gradlew --no-daemon --stacktrace \
-Porg.gradle.configureondemand=false \
-PenvironmentName=linuxappliance \
clean \
generateLicenseReport \
:dist:distDeb \
:dist:distLicenseReport

logmust rsync -av dist/build/distributions/ "$WORKDIR/artifacts/"
logmust cp -v \
dist/build/reports/dependency-license/* "$WORKDIR/artifacts/"
}
6 changes: 6 additions & 0 deletions query-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ cd "$(dirname "${BASH_SOURCE[0]}")" || exit 1
TOP="$PWD"
source "$TOP/lib/common.sh"

#
# Disable "logmust" output as that is unnecessary here, and actually
# trips up some of our testing (e.g. verify-query-packages.sh).
#
export LOGGING=false

ALL_OUTPUT_FIELDS=(name git-url dependencies can-update)

function usage() {
Expand Down
4 changes: 3 additions & 1 deletion setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,14 @@ logmust sudo apt-get update
# build dependencies from a control file.
# - install_shfmt and shellcheck are needed for - make check - to be able to
# make sure style checks are fine.
# - jq is used to generate a JSON formatted metadata file by some packages.
#
logmust install_pkgs \
debhelper \
devscripts \
equivs \
shellcheck
shellcheck \
jq

logmust install_shfmt

Expand Down