diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5ed66462149e8bd5a3660105d0586ecbe0a8be09..38aef42fdedaeb3f5e41ec45ee1af9755f5eb4a2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,21 +1,21 @@ variables: GIT_SUBMODULE_STRATEGY: recursive - CONTAINER_IMAGE: registry.gitlab.e.foundation/e/devices/easy-installer CONTAINER_TAG: stable + ARCH_CONTAINER_TAG: stable stages: -- test -- prepare -- build -- publish + - test + - prepare + - build + - publish check-version: - image: registry.gitlab.e.foundation/e/devices/easy-installer:stable + image: $CI_REGISTRY_IMAGE:$CONTAINER_TAG stage: test script: - ./version.sh check rules: - - if: '$CI_COMMIT_TAG' + - if: "$CI_COMMIT_TAG" when: always build-docker: @@ -28,10 +28,10 @@ build-docker: variables: DOCKER_DRIVER: overlay2 script: - - docker pull $CONTAINER_IMAGE:$CONTAINER_TAG || true + - docker pull $CI_REGISTRY_IMAGE:$CONTAINER_TAG || true - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN registry.gitlab.e.foundation - - docker build --cache-from $CONTAINER_IMAGE:$CONTAINER_TAG -t $CONTAINER_IMAGE:$CONTAINER_TAG . - - docker push $CONTAINER_IMAGE:$CONTAINER_TAG + - docker build --cache-from $CI_REGISTRY_IMAGE:$CONTAINER_TAG -t $CI_REGISTRY_IMAGE:$CONTAINER_TAG . + - docker push $CI_REGISTRY_IMAGE:$CONTAINER_TAG rules: - if: $CI_PIPELINE_SOURCE == "merge_request_event" changes: @@ -39,10 +39,6 @@ build-docker: when: manual build-aur-docker: -# build AUR docker image -# the image is different from the build-docker (which using docker:19) step as -# archlinux/archlinux docker image fails with -# error: failed to initialize alpm library: image: docker:20 stage: prepare services: @@ -52,10 +48,10 @@ build-aur-docker: variables: DOCKER_DRIVER: overlay2 script: - - docker pull $CONTAINER_IMAGE/aur:$CONTAINER_TAG || true + - docker pull $CI_REGISTRY_IMAGE/aur:$CONTAINER_TAG || true - docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY - - cd docker && docker build --cache-from $CONTAINER_IMAGE/aur:$CONTAINER_TAG -f Dockerfile.arch -t $CONTAINER_IMAGE/aur:$CONTAINER_TAG . - - docker push $CONTAINER_IMAGE/aur:$CONTAINER_TAG + - cd docker && docker build --cache-from $CI_REGISTRY_IMAGE/aur:$CONTAINER_TAG -f Dockerfile.arch -t $CI_REGISTRY_IMAGE/aur:$CONTAINER_TAG . + - docker push $CI_REGISTRY_IMAGE/aur:$CONTAINER_TAG rules: - if: $CI_PIPELINE_SOURCE == "merge_request_event" changes: @@ -63,7 +59,7 @@ build-aur-docker: when: manual build-snap: - image: registry.gitlab.e.foundation/e/devices/easy-installer:stable + image: $CI_REGISTRY_IMAGE:$CONTAINER_TAG stage: build variables: GIT_SUBMODULE_STRATEGY: recursive @@ -76,7 +72,7 @@ build-snap: - easy-installer*.snap build-linux-x64: - image: registry.gitlab.e.foundation/e/devices/easy-installer:stable + image: $CI_REGISTRY_IMAGE:$CONTAINER_TAG stage: build variables: GIT_SUBMODULE_STRATEGY: recursive @@ -90,7 +86,7 @@ build-linux-x64: - if: $CI_COMMIT_TAG build-windows: - image: registry.gitlab.e.foundation/e/devices/easy-installer:stable + image: $CI_REGISTRY_IMAGE:$CONTAINER_TAG stage: build variables: GIT_SUBMODULE_STRATEGY: recursive @@ -105,7 +101,7 @@ build-windows: - Easy-installer-setup.exe.sha256sum build-macos: - image: registry.gitlab.e.foundation/e/devices/easy-installer:stable + image: $CI_REGISTRY_IMAGE:$CONTAINER_TAG tags: - generic_privileged stage: build @@ -123,7 +119,7 @@ build-macos: - Mac-build/EasyInstaller.dmg.sha256sum build-aur: - image: $CONTAINER_IMAGE/aur:$CONTAINER_TAG + image: $CI_REGISTRY_IMAGE/aur:$ARCH_CONTAINER_TAG stage: build before_script: - mkdir dist && cp -a pkg/arch/. dist @@ -135,7 +131,7 @@ build-aur: - dist/*.pkg.tar.zst publish-ubuntu: - image: registry.gitlab.e.foundation/e/devices/easy-installer:stable + image: $CI_REGISTRY_IMAGE:$CONTAINER_TAG stage: publish needs: ["build-snap"] variables: @@ -145,18 +141,17 @@ publish-ubuntu: - snapcraft upload *.snap --release $RELEASE_TYPE - snapcraft logout && rm snapcraft.login rules: - - if: '$CI_COMMIT_TAG' + - if: "$CI_COMMIT_TAG" when: manual - publish-macos: - image: registry.gitlab.e.foundation/e/devices/easy-installer:stable + image: $CI_REGISTRY_IMAGE:$CONTAINER_TAG stage: publish needs: ["build-macos"] variables: RELEASE_TYPE: beta before_script: - - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' + - "which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )" - eval $(ssh-agent -s) - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null - mkdir -p ~/.ssh @@ -167,17 +162,17 @@ publish-macos: - "rsync -avz Mac-build/EasyInstaller.dmg* $PUBLISH_USER@$PUBLISH_URL:$PUBLISH_DEST" - ssh $PUBLISH_USER@$PUBLISH_URL "mv $PUBLISH_DEST/* $RELEASE_DEST/" rules: - - if: '$CI_COMMIT_TAG' + - if: "$CI_COMMIT_TAG" when: manual publish-windows: - image: registry.gitlab.e.foundation/e/devices/easy-installer:stable + image: $CI_REGISTRY_IMAGE:$CONTAINER_TAG stage: publish needs: ["build-windows"] variables: RELEASE_TYPE: beta before_script: - - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' + - "which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )" - eval $(ssh-agent -s) - echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null - mkdir -p ~/.ssh @@ -188,11 +183,11 @@ publish-windows: - "rsync -avz Easy-installer-setup.exe* $PUBLISH_USER@$PUBLISH_URL:$PUBLISH_DEST" - ssh $PUBLISH_USER@$PUBLISH_URL "mv $PUBLISH_DEST/* $RELEASE_DEST/" rules: - - if: '$CI_COMMIT_TAG' + - if: "$CI_COMMIT_TAG" when: manual .publish-aur: - image: $CONTAINER_IMAGE/aur:$CONTAINER_TAG + image: $CI_REGISTRY_IMAGE/aur:$CONTAINER_TAG stage: publish needs: ["build-aur"] variables: @@ -227,7 +222,7 @@ publish-aur: environment: name: aur-repo rules: - - if: '$CI_COMMIT_TAG' + - if: "$CI_COMMIT_TAG" when: manual publish-linux-x64: @@ -239,4 +234,4 @@ publish-linux-x64: script: - 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file "${CI_PROJECT_DIR}/build/distributions/easyInstaller-linux-x64.zip" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/easy-installer/$CI_COMMIT_TAG/$PKG_NAME"' rules: - - if: '$CI_COMMIT_TAG' + - if: "$CI_COMMIT_TAG" diff --git a/Dockerfile b/Dockerfile index d6b726fa837234f869df1dffc7f154536e15c6ab..ffa122c71b357b765b5e6c10450a97c692147bb8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,18 @@ FROM snapcore/snapcraft:stable as builder FROM ubuntu:bionic + COPY --from=builder /snap/core /snap/core COPY --from=builder /snap/core18 /snap/core18 COPY --from=builder /snap/snapcraft /snap/snapcraft COPY --from=builder /snap/bin/snapcraft /snap/bin/snapcraft +# Install necessary packages +RUN apt-get update && apt-get dist-upgrade --yes && \ + apt-get install --yes snapd sudo locales wget unzip gcc nsis rsync hfsprogs hfsplus && \ + locale-gen en_US.UTF-8 -# Generate locale. -RUN apt-get update && apt-get dist-upgrade --yes && apt-get install --yes snapd sudo locales && locale-gen en_US.UTF-8 - -# Set the proper environment. +# Set the proper environment ENV LANG="en_US.UTF-8" ENV LANGUAGE="en_US:en" ENV LC_ALL="en_US.UTF-8" @@ -19,8 +21,18 @@ ENV SNAP="/snap/snapcraft/current" ENV SNAP_NAME="snapcraft" ENV SNAP_ARCH="amd64" -RUN apt-get install -y nsis rsync hfsprogs hfsplus - -# install jvm +# Install JVM COPY buildSrc/linux/jdk-11.0.2 /usr/lib/jdk/jdk-11.0.2 ENV JAVA_HOME=/usr/lib/jdk/jdk-11.0.2 + +# Download Gradle ZIP file into the container +ADD https://github.com/gradle/gradle-distributions/releases/download/v4.10.2/gradle-4.10.2-bin.zip /tmp/ + +# Extract Gradle +RUN mkdir -p /usr/local/gradle && \ + unzip /tmp/gradle-4.10.2-bin.zip -d /usr/local/gradle && \ + rm /tmp/gradle-4.10.2-bin.zip + +# Set Gradle environment variables +ENV GRADLE_HOME=/usr/local/gradle/gradle-4.10.2 +ENV PATH=$GRADLE_HOME/bin:$PATH diff --git a/gradle.properties b/gradle.properties index 735f57b49a59fa6018a8b16a3e414cb81661aa9b..f919820ecaa7b3ccb3fb0f5b385f0fb274e98e16 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,22 +5,6 @@ # local Maven project. version=1.0 -# Configure allowed TLS protocols for secure HTTPS connections -Dhttps.protocols=TLSv1,TLSv1.1,TLSv1.2 - -# Specify Java system property to enforce TLSv1.2 protocol for HTTPS connections -JAVA_TOOL_OPTIONS=-Dhttps.protocols=TLSv1.2 - -# Configure HTTP proxy settings -systemProp.http.proxyHost=fodev.org -systemProp.http.proxyPort=8118 -systemProp.http.nonProxyHosts=*.jitpack.io, *.maven.org - -# Configure HTTPS proxy settings -systemProp.https.proxyHost=fodev.org -systemProp.https.proxyPort=8118 -systemProp.https.nonProxyHosts=*.jitpack.io, *.maven.org - # Increase HTTP connection timeout to 10 minutes systemProp.http.connectionTimeout=600000 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e0b3fb8d70b1bbf790f6f8ed1c928ddf09f54628..ddb9820bee6a4ac027f8365e7a2208803a5f4619 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-bin.zip +distributionUrl=https\://github.com/gradle/gradle-distributions/releases/download/v4.10.2/gradle-4.10.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists