Gitlab CI: build all distros if branch has "release" or "testing" in it
This commit is contained in:
@@ -15,8 +15,15 @@ build:
|
|||||||
- pwd
|
- pwd
|
||||||
- apk add bash
|
- apk add bash
|
||||||
- mkdir -p "$GITLAB_SHARED_DIND_DIR" && chmod 777 "$GITLAB_SHARED_DIND_DIR"
|
- mkdir -p "$GITLAB_SHARED_DIND_DIR" && chmod 777 "$GITLAB_SHARED_DIND_DIR"
|
||||||
- bash builder/build-tarball
|
- echo "Build Ubuntu 18 on all branches"
|
||||||
- bash builder/build-deb
|
- bash builder/build-distro ubuntu bionic
|
||||||
|
- if echo "$CI_COMMIT_BRANCH" | grep -Eq '(release|testing)'; then
|
||||||
|
echo "Build all distros";
|
||||||
|
bash builder/build-distro ubuntu focal;
|
||||||
|
bash builder/build-distro debian buster;
|
||||||
|
bash builder/build-distro debian bullseye;
|
||||||
|
bash builder/build-distro kali kali-rolling;
|
||||||
|
fi
|
||||||
- mkdir output
|
- mkdir output
|
||||||
- cp -r builder/build/* output/
|
- cp -r builder/build/* output/
|
||||||
artifacts:
|
artifacts:
|
||||||
|
|||||||
19
builder/build-distro
Executable file
19
builder/build-distro
Executable file
@@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
os="$1"
|
||||||
|
codename="$2"
|
||||||
|
|
||||||
|
detect_package_format() {
|
||||||
|
package_format=rpm
|
||||||
|
if ls builder/dockerfile*"$os"* | grep -q .deb.build; then
|
||||||
|
package_format=deb
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
cd "$(dirname "$0")/.."
|
||||||
|
|
||||||
|
detect_package_format
|
||||||
|
builder/build-tarball "$os" "$codename"
|
||||||
|
builder/build-${package_format} "$os" "$codename"
|
||||||
Reference in New Issue
Block a user