Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

Commit

Permalink
Build on RHEL (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmelis authored and aslakknutsen committed Apr 27, 2018
1 parent c3ca6b9 commit c16a254
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 10 deletions.
21 changes: 21 additions & 0 deletions Dockerfile.deploy.rhel
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM prod.registry.devshift.net/osio-prod/base/pcp:latest
LABEL maintainer "Devtools <[email protected]>"
LABEL author "Devtools <[email protected]>"
ENV LANG=en_US.utf8
ENV INSTALL_PREFIX=/usr/local/fabric8-osoproxy

# Create a non-root user and a group with the same name: "fabric8"
ENV F8_USER_NAME=fabric8
RUN useradd --no-create-home -s /bin/bash ${F8_USER_NAME}

COPY dist/traefik ${INSTALL_PREFIX}/bin/fabric8-osoproxy
COPY ./osoproxy+pmcd.sh /osoproxy+pmcd.sh
EXPOSE 44321

# From here onwards, any RUN, CMD, or ENTRYPOINT will be run under the following user
USER ${F8_USER_NAME}

WORKDIR ${INSTALL_PREFIX}
ENTRYPOINT [ "/osoproxy+pmcd.sh" ]

EXPOSE 8080
16 changes: 11 additions & 5 deletions cico_build_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@

./cico_run_tests.sh

docker build -t f8osoproxy-deploy -f Dockerfile.deploy .

login
tag_push ${REGISTRY}/fabric8-services/fabric8-oso-proxy:$TAG
tag_push ${REGISTRY}/fabric8-services/fabric8-oso-proxy:latest

echo 'CICO: Image pushed, ready to update deployed app'
docker build -t f8osoproxy-deploy -f "${DOCKERFILE_DEPLOY}" .

if [ "$TARGET" = "rhel" ]; then
tag_push ${REGISTRY}/osio-prod/fabric8-services/fabric8-oso-proxy:$TAG
tag_push ${REGISTRY}/osio-prod/fabric8-services/fabric8-oso-proxy:latest
else
tag_push ${REGISTRY}/fabric8-services/fabric8-oso-proxy:$TAG
tag_push ${REGISTRY}/fabric8-services/fabric8-oso-proxy:latest
fi

echo 'CICO: Image pushed, ready to update deployed app'
15 changes: 11 additions & 4 deletions cico_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@

REGISTRY="push.registry.devshift.net"

if [ "$TARGET" = "rhel" ]; then
DOCKERFILE_DEPLOY="Dockerfile.deploy.rhel"
else
DOCKERFILE_DEPLOY="Dockerfile.deploy"
fi

function tag_push() {
TARGET=$1
docker tag f8osoproxy-deploy $TARGET
docker push $TARGET
local tag=$1

docker tag f8osoproxy-deploy $tag
docker push $tag
}

# Source environment variables of the jenkins slave
Expand Down Expand Up @@ -35,7 +42,7 @@ set -x
set -e

# We need to disable selinux for now, XXX
/usr/sbin/setenforce 0
/usr/sbin/setenforce 0 || :

# Get all the deps in
yum -y install \
Expand Down
4 changes: 3 additions & 1 deletion openshift/OpenShiftTemplate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ objects:
configMapKeyRef:
name: f8osoproxy
key: auth.url
image: registry.devshift.net/fabric8-services/fabric8-oso-proxy:${IMAGE_TAG}
image: ${IMAGE}:${IMAGE_TAG}
name: f8osoproxy
imagePullPolicy: Always
ports:
Expand Down Expand Up @@ -100,5 +100,7 @@ objects:
selector:
deploymentconfig: f8osoproxy
parameters:
- name: IMAGE
value: registry.devshift.net/fabric8-services/fabric8-oso-proxy
- name: IMAGE_TAG
value: latest

0 comments on commit c16a254

Please sign in to comment.