Skip to content

Commit

Permalink
update build travis process and openshift templates
Browse files Browse the repository at this point in the history
  • Loading branch information
startxfr committed Mar 3, 2018
1 parent 238e6b7 commit ac61a7e
Show file tree
Hide file tree
Showing 6 changed files with 774 additions and 85 deletions.
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ services:
- docker

before_install:
- 'echo "{ \"experimental\": true, \"storage-driver\": \"overlay2\", \"max-concurrent-downloads\": 50, \"max-concurrent-uploads\": 50 }" | sudo tee /etc/docker/daemon.json'
- sudo service docker restart
- docker pull node:8-alpine
- docker images
- docker login -u $DOCKER_USER -p $DOCKER_PASS

script: ./travis.sh
- "docker build --squash -t $REPO ."
- "docker run -d --name sxapi $REPO"

after_success:
- docker login -u $DOCKER_USER -p $DOCKER_PASS
- export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; elif [ "$TRAVIS_BRANCH" == "testing" ]; then echo "testing"; else echo $RELEASE ; fi`
- docker build -f Dockerfile --squash -t $REPO:$TAG .
- docker push $REPO
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@ LABEL name="startx/sxapi-$SXAPI_VERSION" \
io.openshift.s2i.scripts-url="image:///s2i" \
fr.startx.component="$SX_ID:$SX_VERSION"

RUN mkdir -p $APP_PATH && \
mkdir -p $CONF_PATH && \
apk update && apk upgrade && apk add git
COPY .s2i /s2i
COPY ./core $APP_PATH/core
COPY ./test $APP_PATH/test
COPY ./*.j* $APP_PATH/
COPY ./sxapi.json $CONF_PATH/sxapi.json

RUN cd $APP_PATH \
RUN apk update && apk upgrade && apk add git python make gcc g++ \
&& mkdir -p $APP_PATH \
&& mkdir -p $CONF_PATH \
&& mkdir -p $DATA_PATH \
&& cd $APP_PATH \
&& npm install \
&& npm dedupe \
&& npm cache verify \
&& npm cache clean --force \
&& mkdir -p $CONF_PATH \
&& mkdir -p $DATA_PATH \
&& apk del make gcc g++ \
&& chgrp -R 0 $APP_PATH $CONF_PATH $DATA_PATH /s2i \
&& chown -R 1001:0 $APP_PATH $CONF_PATH $DATA_PATH /s2i \
&& chmod -R g=u $APP_PATH $CONF_PATH $DATA_PATH /s2i
Expand Down
157 changes: 86 additions & 71 deletions openshift-imageStreams.json
Original file line number Diff line number Diff line change
@@ -1,75 +1,90 @@
{
"kind": "ImageStreamList",
"apiVersion": "v1",
"metadata": {},
"items": [
{
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "sxapi",
"creationTimestamp": null
},
"spec": {
"tags": [
{
"name": "latest",
"annotations": {
"description": "Simple and extensible API framework",
"iconClass": "icon-nodejs",
"tags": "nodejs,sxapi-latest",
"supports":"sxapi:latest,nodejs",
"sampleRepo": "https://github.com/startxfr/sxapi-sample.git"
"kind": "ImageStreamList",
"apiVersion": "v1",
"metadata": {},
"items": [
{
"kind": "ImageStream",
"apiVersion": "v1",
"metadata": {
"name": "sxapi",
"annotations": {
"openshift.io/display-name": "Startx SXAPI framework (S2I)",
"openshift.io/generated-by": "STARTX"
},
"labels": {
"base-image": "sxapi",
"provider": "startx"
}
},
"from": {
"kind": "DockerImage",
"name": "startx/sxapi:latest"
"spec": {
"tags": [
{
"name": "latest",
"annotations": {
"openshift.io/display-name": "S2I Startx SXAPI framework (latest)",
"description": "Builder for Simple and eXtensible API framework based on alpine (latest)",
"iconClass": "icon-nodejs",
"tags": "builder,startx,alpine,nodejs,sxapi-latest",
"supports": "sxapi:latest,nodejs,http",
"version": "latest",
"sampleRepo": "https://github.com/startxfr/sxapi-example.git"
},
"from": {
"kind": "DockerImage",
"name": "startx/sxapi:latest"
}
},
{
"name": "testing",
"annotations": {
"openshift.io/display-name": "S2I Startx SXAPI framework (testing)",
"description": "Simple and extensible API framework based on alpine (test environement)",
"iconClass": "icon-nodejs",
"tags": "builder,startx,alpine,nodejs,sxapi-testing",
"supports": "sxapi:testing,nodejs,http",
"version": "testing",
"sampleRepo": "https://github.com/startxfr/sxapi-example.git"
},
"from": {
"kind": "DockerImage",
"name": "startx/sxapi:testing"
}
},
{
"name": "0.1.9",
"annotations": {
"openshift.io/display-name": "S2I Startx SXAPI framework (0.1.9)",
"description": "Simple and extensible API framework based on alpine (v0.1.9)",
"iconClass": "icon-nodejs",
"tags": "builder,startx,alpine,nodejs,sxapi-0.1.9",
"supports": "sxapi:0.1.9,nodejs,http",
"version": "0.1.9",
"sampleRepo": "https://github.com/startxfr/sxapi-example.git"
},
"from": {
"kind": "DockerImage",
"name": "startx/sxapi:0.1.9"
}
},
{
"name": "0.1.0",
"annotations": {
"openshift.io/display-name": "S2I Startx SXAPI framework (0.1.0)",
"description": "Simple and extensible API framework based on alpine (v0.1.0)",
"iconClass": "icon-nodejs",
"tags": "builder,startx,alpine,nodejs,sxapi-0.1.0",
"supports": "sxapi:0.1.0,nodejs,http",
"version": "0.1.0",
"sampleRepo": "https://github.com/startxfr/sxapi-example.git"
},
"from": {
"kind": "DockerImage",
"name": "startx/sxapi:0.1.0"
}
}
]
}
},
{
"name": "testing",
"annotations": {
"description": "Simple and extensible API framework",
"iconClass": "icon-nodejs",
"tags": "nodejs,sxapi-testing",
"supports":"sxapi:testing,nodejs",
"sampleRepo": "https://github.com/startxfr/sxapi-sample.git"
},
"from": {
"kind": "DockerImage",
"name": "startx/sxapi:testing"
}
},
{
"name": "0.1.9",
"annotations": {
"description": "Simple and extensible API framework",
"iconClass": "icon-nodejs",
"tags": "nodejs,sxapi-v0.1.9",
"supports":"sxapi:0.1.9,nodejs",
"sampleRepo": "https://github.com/startxfr/sxapi-sample.git"
},
"from": {
"kind": "DockerImage",
"name": "startx/sxapi:0.1.9"
}
},
{
"name": "0.1.0",
"annotations": {
"description": "Simple and extensible API framework",
"iconClass": "icon-nodejs",
"tags": "nodejs,sxapi-v0.1.0",
"supports":"sxapi:0.1.0,nodejs",
"sampleRepo": "https://github.com/startxfr/sxapi-sample.git"
},
"from": {
"kind": "DockerImage",
"name": "startx/sxapi:0.1.0"
}
}
]
}
}
]
}
]
}

0 comments on commit ac61a7e

Please sign in to comment.