Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CircleCI: Do not run build as root. Move to public docker repo. #7588

Merged
merged 1 commit into from
Dec 6, 2018
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
6 changes: 6 additions & 0 deletions .circleci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@ subversion \
time \
wget \
zlib1g-dev \
unzip \
xz-utils \
&& rm -rf /var/lib/apt/lists/*

RUN useradd -c "OpenWrt Builder" -m -d /home/build -s /bin/bash build
USER build
ENV HOME /home/build

# LEDE Build System (LEDE GnuPG key for unattended build jobs)
RUN curl 'https://git.openwrt.org/?p=keyring.git;a=blob_plain;f=gpg/626471F1.asc' | gpg --import \
&& echo '54CC74307A2C6DC9CE618269CD84BCED626471F1:6:' | gpg --import-ownertrust
Expand Down
6 changes: 3 additions & 3 deletions .circleci/README
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Build/update the docker image

docker pull debian:9
docker build --rm .
docker tag <IMAGE ID> docker.io/champtar/openwrtpackagesci:latest
docker push docker.io/champtar/openwrtpackagesci:latest
docker build --rm -t docker.io/openwrtorg/packages-cci:latest .
docker tag <IMAGE ID> docker.io/openwrtorg/packages-cci:<VERSION-TAG>
docker push docker.io/openwrtorg/packages-cci
3 changes: 2 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2.0
jobs:
build:
docker:
- image: docker.io/champtar/openwrtpackagesci@sha256:96ef72edc70cba371ea5676fba15ee25b3a94f538f648a27454b699edce61da0
- image: docker.io/openwrtorg/packages-cci:v1.0.1
champtar marked this conversation as resolved.
Show resolved Hide resolved
environment:
- SDK_BASE_URL: "https://downloads.openwrt.org/snapshots/targets/ar71xx/generic"
- SDK_FILE: "openwrt-sdk-ar71xx-generic_gcc-7.3.0_musl.Linux-x86_64.tar.xz"
Expand Down Expand Up @@ -89,6 +89,7 @@ jobs:
name: Download source/check/compile
working_directory: ~/build_dir
command: |
set +o pipefail
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually pipefail makes package removal fail
#7454 (comment)

Copy link
Member Author

@thess thess Dec 7, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the 7454 PR were to be rebased -, the line you highlighted will "fix" the strange exit failure. However, if the "git diff", etc. finds a Makefile in the PR, it will proceed. We probably need a better check here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, I got confused by bash syntax, + to disable, - to enable

PKGS=$(cd ~/openwrt_packages; git diff --diff-filter=d --name-only "origin/$BRANCH..." | grep 'Makefile$' | grep -v '/files/' | awk -F/ '{ print $(NF-1) }')
if [ -z "$PKGS" ] ; then
echo_blue "WARNING: No new or modified packages found!"
Expand Down