Skip to content

Commit

Permalink
Pass in http(s)_proxy variables
Browse files Browse the repository at this point in the history
Before we were passing in PROXY and always
assigning https_proxy and http_proxy based on these values,
but then when no proxy is used, these are still passed in.

This change makes it so that docker builds will
pass with our without a proxy.
  • Loading branch information
Jesse Olsen committed Jul 25, 2017
1 parent ca6a8c0 commit 2ffc78c
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 22 deletions.
24 changes: 20 additions & 4 deletions .travis.yml
@@ -1,9 +1,25 @@
udo: true
dist: trusty
language: node_js
node_js:
- "6"
- "7"
- '6'
- '7'
before_script:
- npm install
- npm install
script:
- npm test
- npm test
after_success: npm run coverage
jobs:
include:
- stage: build docker image
script:
- docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
- docker build --build-arg=PROXY=$PROXY -t docker.io/jesseolsen/hpe-oneview-hubot:latest
.
- docker images
- docker tag jesseolsen/hpe-oneview-hubot docker.io/jesseolsen/hpe-oneview-hubot:latest
- docker push docker.io/jesseolsen/hpe-oneview-hubot:latest
env:
global:
- secure: Ped3qjbSgh20mSM7CX3qVgNQZyAtJLZzrk1jEwIWKKVK+/8JuP2HJIa4avrjK8Ds/YjHteT8/+dFanwq2HGC3fVZemhf23BA4duw4k8Ty5vjIxXNJWg9c2t+OwlJ562AShGmWiqX7xMzdNgKb9vvy9OYSYu8YCq8xYV3TMagcFoHXWk2bClpO2qikDnIdNdw7eTsSTHQJAXyeWCzkhvRpI3bA3KnHCLreKZM7QBlL0q+ixSxaugCOVOVjztuQVK+Wc/toL8CHyQEL9Pf4XrMoHOt5ctjq/PcX+TPj603gvCutbceDJClBF48CVzhIHfELcFeaH+v+8tKHu0P36D2uxNpG3H5kQR2x0iq1oMNMvVXNj5W+seNRV5CTQ5Pqy1Rnub3Eo2Z7LvZ38iIEpNGmKLpEGQ5zi/jHI5RVgnd4IltgZzGZ8VIEpMvLxNffGuHDRsuiDKo0L9doESxslFWlRa0uT1lWTHaVZ6zPxvcYRDFzzaq5NdL6xq5lIWDDKEB3c/7t8urYAh//giC9HDAleb+x3HDy5UZmwNPPFCTuPFoW7JrswmSLEnkugYJmFVHqx54ywff8kuCVk2FmCPruCNCuLfbEW2mqOnrDfLgWRojYCui84Lptqc5uczub/GqlnFChV0Fo55OcY41HW3cu19tvd3K6xzGfT+9vtaG6H4=
- secure: YWEywMuBWP1xQSQjwfWfUUaQz4/2Zrh+0p0sBMmHAjCabAEspqk8A/eDYjWJN2oEgq8q0hON4QDDpVGy1KSoaWCvayEuQ4Fuqmqe0Yqf211v9hYHnxk72naF2HVeWYGHY3eCehGqM7X/d83wcsPKmqQIrcj17v44YqymTMdO0GMFqTpzW0kWUdkSk1zbvfH678hqKJi552qgvTJAs/Wl8JAAJEgbw72dQzbnP9uIr5m2MltcUVGMr17uqAbgu2qbRQUxQ01arEbaeMnKj+epc7LaL81Ie6c3MuzHpareRYlRh3WJU/tYNcBoyWuXT6FW/lK2ZvRxEtWmPNbwlUFeUNlb5bqCnvLEdyC03u4z1zTbBcjLXGj8GKCUY0L9HGtxDkPw2S6yKKHALkPF/ujtQAz+NDCEpCOwThCkgQh0s9JXG5sGHjtiE0iVFk1pHaGvAqs1RSBfhi9y1thAncJEUh1cy7/3fvUdfT3zEHFTZkNe4fhmBdnt2foCZZ+UeyE/fFxXv6DKZs9FGU6KaMentKT1WXnzL7DYjJGa5xPcjFCV5HlGWFJfmEdz7uxf/HTtc4HS+dusaSJHglpsAOhnIBfT0W7hXQVfAvyt3s9nPLfpAZ+KUYTd+vn4ut0G9cmYld74pVT3EosFTJlsFbv1m3BintYTwJhCsO8RAA+8CGA=
2 changes: 0 additions & 2 deletions Dockerfile
Expand Up @@ -3,8 +3,6 @@

FROM jesseolsen/core-hubot:latest

ARG PROXY

COPY docker_entry.sh /usr/local/bin/
COPY docker_go.sh /go.sh
COPY . /home/docker/hubot-org/
Expand Down
17 changes: 2 additions & 15 deletions Dockerfile-core
Expand Up @@ -22,11 +22,8 @@ USER root
#http://askubuntu.com/questions/506158/unable-to-initialize-frontend-dialog-when-using-ssh
ENV DEBIAN_FRONTEND=noninteractive

ARG PROXY
ENV http_proxy http://$PROXY
ENV https_proxy http://$PROXY
ENV HTTP_PROXY http://$PROXY
ENV HTTPS_PROXY http://$PROXY
ARG http_proxy
ARG https_proxy

# Steps from:
# https://github.com/HewlettPackard/hpe-oneview-hubot/wiki/Getting-Started
Expand Down Expand Up @@ -58,11 +55,6 @@ RUN npm install -g yo generator-hubot
###############################################################################
USER docker

ENV http_proxy http://$PROXY
ENV https_proxy http://$PROXY
ENV HTTP_PROXY http://$PROXY
ENV HTTPS_PROXY http://$PROXY

RUN npm config set proxy $http_proxy
RUN npm config set http-proxy $http_proxy
RUN npm config set https-proxy $http_proxy
Expand Down Expand Up @@ -112,11 +104,6 @@ USER root

WORKDIR /home/docker/hubot-core-org

ENV http_proxy http://$PROXY
ENV https_proxy http://$PROXY
ENV HTTP_PROXY http://$PROXY
ENV HTTPS_PROXY http://$PROXY

# To install avoid cross-device link not permitted...
RUN cd /usr/lib/node_modules/npm; npm install fs-extra; \
sed -i -e s/graceful-fs/fs-extra/ -e s/fs.rename/fs.move/ ./lib/utils/rename.js
Expand Down
2 changes: 1 addition & 1 deletion core_docker_build.sh
@@ -1,2 +1,2 @@
#!/bin/bash
docker build -f Dockerfile-core --build-arg=PROXY=$PROXY -t docker.io/jesseolsen/core-hubot:latest .
docker build -f Dockerfile-core --build-arg=http_proxy=$http_proxy --build-arg=https_proxy=$https_proxy -t docker.io/jesseolsen/core-hubot:latest .

0 comments on commit 2ffc78c

Please sign in to comment.