diff options
author | Jonas Ã…dahl <jadahl@gmail.com> | 2020-11-06 18:59:19 +0100 |
---|---|---|
committer | Marge Bot <marge-bot@gnome.org> | 2020-11-17 19:07:42 +0000 |
commit | e026e3bc9fd03b1606d1ad777827825a61890c52 (patch) | |
tree | 24cb70558c3249de83b61050e5cb2c6f4a39bbf8 /.gitlab-ci | |
parent | 51ff9ce44427014989071297e497174c3b5a6b83 (diff) | |
download | gnome-shell-e026e3bc9fd03b1606d1ad777827825a61890c52.tar.gz |
ci: Use ci-templates for building image
This rebuilds the automaticaly whenever the image tag changes. Whenever
something in the image needs to change, alter the installation script
and change the tag to the current date.
This removes the -s (strict) argument from js68, as it doesn't exist in
js78.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1492>
Diffstat (limited to '.gitlab-ci')
-rw-r--r-- | .gitlab-ci/Dockerfile | 24 | ||||
-rwxr-xr-x | .gitlab-ci/install-meson-project.sh | 34 |
2 files changed, 34 insertions, 24 deletions
diff --git a/.gitlab-ci/Dockerfile b/.gitlab-ci/Dockerfile deleted file mode 100644 index fd0eb2a93..000000000 --- a/.gitlab-ci/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ -# Rebuild and push with -# -# cd .gitlab-ci/ -# podman build --format docker --no-cache -t registry.gitlab.gnome.org/gnome/gnome-shell/extension-ci:v2 . -# podman push registry.gitlab.gnome.org/gnome/gnome-shell/extension-ci:v2 -# - -FROM registry.fedoraproject.org/fedora:32 - -RUN dnf -y update && dnf -y upgrade && \ - dnf install -y 'dnf-command(copr)' git && \ - - # For syntax checks with `find . -name '*.js' -exec js68 -c -s '{}' ';'` - dnf install -y findutils mozjs68-devel && \ - - # For static analysis with eslint - dnf install -y nodejs && \ - npm install -g eslint && \ - - # Shameless plug for my own tooling; useful for generating zip - dnf copr enable -y fmuellner/gnome-shell-ci && \ - dnf install -y gnome-extensions-tool meson && \ - - dnf clean all diff --git a/.gitlab-ci/install-meson-project.sh b/.gitlab-ci/install-meson-project.sh new file mode 100755 index 000000000..feea61149 --- /dev/null +++ b/.gitlab-ci/install-meson-project.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +set -e + +if [[ $# -lt 4 ]]; then + echo Usage: $0 [options] [repo-url] [commit] [subdir] + echo Options: + echo -Dkey=val + exit 1 +fi + +MESON_OPTIONS=() + +while [[ $1 =~ ^-D ]]; do + MESON_OPTIONS+=( "$1" ) + shift +done + +REPO_URL="$1" +COMMIT="$2" +SUBDIR="$3" +PREPARE="$4" + +REPO_DIR="$(basename ${REPO_URL%.git})" + +git clone --depth 1 "$REPO_URL" -b "$COMMIT" +pushd "$REPO_DIR" +pushd "$SUBDIR" +sh -c "$PREPARE" +meson --prefix=/usr _build "${MESON_OPTIONS[@]}" +ninja -C _build install +popd +popd +rm -rf "$REPO_DIR" |