Browse Source

Remove some now unnecessary path fallbacks

master
Travis Burtrum 2 years ago
parent
commit
10412743e9
  1. 2
      Dockerfile
  2. 4
      build-ci.sh
  3. 4
      c/build.sh
  4. 3
      java/Dockerfile
  5. 1
      java/build.sh
  6. 2
      java/readme.md
  7. 8
      run.sh
  8. 1
      rust/build.sh

2
Dockerfile

@ -15,7 +15,7 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone & @@ -15,7 +15,7 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone &
echo -e "Server = $PACMAN_MIRROR/\$repo/os/\$arch" > /etc/pacman.d/mirrorlist && \
echo "TZ=$TZ" > /etc/environment && \
pacman -Syu --noconfirm --needed sed grep gawk sudo git which jq && \
echo 'jenkins ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/jenkins
echo 'ci ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/ci
COPY ./run.sh ./ci-release-helper.sh /usr/bin/

4
build-ci.sh

@ -15,10 +15,6 @@ RELEASE_SCRIPT='.ci/release.sh' @@ -15,10 +15,6 @@ RELEASE_SCRIPT='.ci/release.sh'
BUILD_SCRIPT='.ci/build.sh'
DEFAULT_RELEASE_DIR='release'
# compat with alternative directory name
[ ! -f "$RELEASE_SCRIPT" ] && [ -f '.jenkins/release.sh' ] && RELEASE_SCRIPT='.jenkins/release.sh'
[ ! -f "$BUILD_SCRIPT" ] && [ -f '.jenkins/build.sh' ] && BUILD_SCRIPT='.jenkins/build.sh'
function usage {
echo "$@"
echo

4
c/build.sh

@ -4,8 +4,6 @@ set -euxo pipefail @@ -4,8 +4,6 @@ set -euxo pipefail
BUILD_SCRIPT="$1"
shift
[ "" == "$BUILD_SCRIPT" ] && [ -f '.ci/build.sh' ] && BUILD_SCRIPT='.ci/build.sh'
[ "" == "$BUILD_SCRIPT" ] && [ -f '.jenkins/build.sh' ] && BUILD_SCRIPT='.jenkins/build.sh'
# this assists in cleanup, ie if a job was terminated, to be run in a jenkins finally {} or similar
if [ "$BUILD_SCRIPT" == "docker-chown" ]
@ -22,7 +20,7 @@ docker_build() { @@ -22,7 +20,7 @@ docker_build() {
shift
# run it, but after, chown anything left in /tmp to *this* uid/gid, otherwise we can't delete them later...
docker run --rm -e ARCH -e BRANCH_NAME -e BUILD_UID="$UID" -e BUILD_GID="$(id -g)" -v "$(pwd)":/tmp -w /tmp "$DOCKER_IMAGE" sh -c "\"\$@\"; exit=\$?; chown -R '$UID:$(id -g)' /tmp; exit \$exit" -- "$@"
docker run --rm -e ARCH -e BRANCH_NAME -e BUILD_UID="$UID" -e BUILD_GID="$(id -g)" -v "$(pwd)":/tmp -w /tmp "$DOCKER_IMAGE" sh -c "umask a=rwx; \"\$@\"; exit=\$?; chown -R '$UID:$(id -g)' /tmp; exit \$exit" -- "$@"
}
docker_build 'amd64' 'alpine' "$BUILD_SCRIPT" "$@"

3
java/Dockerfile

@ -23,10 +23,9 @@ RUN mkdir /m2 /npm && ln -sf /m2/ /root/.m2 && ln -sf /npm/ /root/.npm && \ @@ -23,10 +23,9 @@ RUN mkdir /m2 /npm && ln -sf /m2/ /root/.m2 && ln -sf /npm/ /root/.npm && \
mv /usr/lib/jvm/java-se-9-ri/jdk-9 /usr/lib/jvm/ && rm -rf java-se-9-ri && chmod +x /usr/lib/jvm/jdk-9/bin/*
COPY ./run-java-all ./run-java /usr/bin/
RUN ln -sf /usr/bin/run-java-all /usr/bin/build.sh
VOLUME [ "/build", "/m2", "/npm", "/root/.netrc" ]
WORKDIR /build
ENTRYPOINT ["/usr/bin/run.sh"]
CMD ["/usr/bin/run-java-all", "./.jenkins/build.sh"]
CMD ["/usr/bin/run-java-all", "./.ci/build.sh"]

1
java/build.sh

@ -4,6 +4,5 @@ set -euo pipefail @@ -4,6 +4,5 @@ set -euo pipefail
BUILD_SCRIPT="$1"
shift
[ "" == "$BUILD_SCRIPT" ] && [ -f '.ci/build.sh' ] && BUILD_SCRIPT='.ci/build.sh'
[ "" == "$BUILD_SCRIPT" ] && [ -f '.jenkins/build.sh' ] && BUILD_SCRIPT='.jenkins/build.sh'
docker run --rm -v "$HOME/.netrc:/root/.netrc:ro" -v "$HOME/.m2:/m2" -v "$HOME/.npm:/npm" -v "$PWD:/build" -e BRANCH_NAME -e BUILD_UID=$UID -e BUILD_GID=$(id -g) moparisthebest/self-ci-java:latest /usr/bin/run-java-all "$BUILD_SCRIPT" "$@"

2
java/readme.md

@ -16,7 +16,7 @@ curl --compressed -sL https://code.moparisthebest.com/moparisthebest/self-ci/raw @@ -16,7 +16,7 @@ curl --compressed -sL https://code.moparisthebest.com/moparisthebest/self-ci/raw
curl --compressed -sL https://raw.githubusercontent.com/moparisthebest/self-ci/master/build-ci.sh | sed 's@https://code.moparisthebest.com/moparisthebest/self-ci/raw/branch/master@https://raw.githubusercontent.com/moparisthebest/self-ci/master@g' | bash -s -- java
```
Without arguments it will execute `.jenkins/build.sh` once for each version of Java installed, setting the env variables JAVA_VERSION (a number), JAVA_HOME, M2_HOME, and PATH appropriately so invocations of `mvn` and `java` *just work*. If you want to call another script each time:
Without arguments it will execute `.ci/build.sh` once for each version of Java installed, setting the env variables JAVA_VERSION (a number), JAVA_HOME, M2_HOME, and PATH appropriately so invocations of `mvn` and `java` *just work*. If you want to call another script each time:
```sh
docker run --rm -v "$HOME/.m2:/m2" -v "$PWD:/build" -e BRANCH_NAME -e BUILD_UID=$UID -e BUILD_GID=$(id -g) moparisthebest/self-ci-java:latest run-java-all ./path/to/your/script.sh

8
run.sh

@ -6,11 +6,11 @@ @@ -6,11 +6,11 @@
if [ ! -z "${BUILD_UID:-}" ]
then
BUILD_GID="${BUILD_GID:-$BUILD_UID}"
groupadd -r -g "$BUILD_GID" jenkins
useradd -r -u "$BUILD_UID" -g "$BUILD_GID" -s /bin/bash -m -d /root jenkins
groupadd -r -g "$BUILD_GID" ci
useradd -r -u "$BUILD_UID" -g "$BUILD_GID" -s /bin/bash -m -d /root ci
chown "$BUILD_UID":"$BUILD_GID" /root
#exec runuser -m jenkins -- "$@"
exec sudo -E -u jenkins -- "$@"
#exec runuser -m ci -- "$@"
exec sudo -E -u ci -- "$@"
fi
# otherwise just run as root

1
rust/build.sh

@ -4,7 +4,6 @@ set -euo pipefail @@ -4,7 +4,6 @@ set -euo pipefail
BUILD_SCRIPT="$1"
shift
[ "" == "$BUILD_SCRIPT" ] && [ -f '.ci/build.sh' ] && BUILD_SCRIPT='.ci/build.sh'
[ "" == "$BUILD_SCRIPT" ] && [ -f '.jenkins/build.sh' ] && BUILD_SCRIPT='.jenkins/build.sh'
export CROSS_VERSION=0.2.1

Loading…
Cancel
Save