Skip to content

Commit

Permalink
chore: Dockerfile/ci fixes
Browse files Browse the repository at this point in the history
- fix the final RUN command, cache directives
- include ssl for rusoto/reqwest and upgrade to latest rust
- possibly fix branch triggers (or is circleci just acting up)?
- remove unnecessary WITH_RUST to travis
  • Loading branch information
pjenvey committed Jun 6, 2018
1 parent 0bbbd25 commit b4f3f91
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
5 changes: 4 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
- run:
name: Install Docker build dependencies
command: apk add --no-cache openssh-client git

- checkout
- setup_remote_docker

Expand All @@ -28,6 +29,7 @@ jobs:
"$CIRCLE_PROJECT_USERNAME" \
"$CIRCLE_PROJECT_REPONAME" \
"$CIRCLE_BUILD_URL" > version.json
- run:
name: Build Docker image
command: docker build -t app:build .
Expand Down Expand Up @@ -69,6 +71,7 @@ jobs:
docker images
docker push "${DOCKERHUB_REPO}:${CIRCLE_TAG}"
fi
workflows:
version: 2
build-test-deploy:
Expand All @@ -85,4 +88,4 @@ workflows:
tags:
only: /.*/
branches:
only: master
only: master
12 changes: 6 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ language: python
python:
- "2.7"
cache:
- cargo
- pip
pip: true
directories:
- $HOME/.cargo
- $TRAVIS_BUILD_DIR/target
sudo: required
dist: trusty

Expand All @@ -12,13 +14,11 @@ install:
- pip install --upgrade pip
- pip install -r requirements.txt
- pip install -r test-requirements.txt
- WITH_RUST=false pip install -e git+https://github.com/mozilla-services/autopush.git#egg=autopush
- pip install -e git+https://github.com/mozilla-services/autopush.git#egg=autopush
- |
curl https://sh.rustup.rs | sh -s -- -y || travis_terminate 1;
export PATH=$PATH:$HOME/.cargo/bin
# Build here instead of within tox's pip install -e. It hides the output
# which can kill the job on slower travis runs
if [ ${WITH_RUST} == "release" ]; then
if [ "${WITH_RUST}" == "release" ]; then
cargo build --release || travis_terminate 1
else
cargo build || travis_terminate 1
Expand Down
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM rust:1.26.0-stretch as builder
FROM rust:1.26.2-stretch as builder

ADD . /app
WORKDIR /app
Expand All @@ -8,8 +8,7 @@ RUN \
cargo --version && \
rustc --version && \
mkdir -m 755 bin && \
cargo build --release && \
cp /app/target/release/autopush_rs /app/bin
cargo install --root /app


FROM debian:stretch-slim
Expand All @@ -18,6 +17,10 @@ MAINTAINER <[email protected]>
RUN \
groupadd --gid 10001 app && \
useradd --uid 10001 --gid 10001 --home /app --create-home app && \
\
apt-get -qq update && \
apt-get -qq install -y libssl-dev && \
rm -rf /var/lib/apt/lists

COPY --from=builder /app/bin /app/bin

Expand Down

0 comments on commit b4f3f91

Please sign in to comment.