-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
526949c
commit 3eeadcf
Showing
12 changed files
with
297 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Ignore everything | ||
* | ||
|
||
# But not the conf and public directories | ||
!public | ||
!conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,5 @@ | |
|
||
yarn-error.log | ||
|
||
creds.js | ||
|
||
node_modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
ARG NGINX_IMAGE_VERSION=1.15.8 | ||
|
||
FROM nginx:${NGINX_IMAGE_VERSION} | ||
|
||
EXPOSE 8383 | ||
|
||
COPY conf/zenko-ui-nginx.conf /etc/nginx/conf.d/default.conf | ||
|
||
RUN rm -rf /usr/share/nginx/html/* | ||
|
||
COPY public/assets/ /usr/share/nginx/html/ | ||
|
||
CMD ["nginx", "-g", "daemon off;"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
server { | ||
listen 8383; | ||
server_name localhost; | ||
|
||
root /usr/share/nginx/html; | ||
index index.html index.htm; | ||
|
||
location / { | ||
try_files $uri $uri/ /index.html; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
--- | ||
version: 0.2 | ||
|
||
branches: | ||
feature/*, documentation/*, improvement/*, bugfix/*, w/*, q/*, hotfix/*: | ||
stage: pre-merge | ||
development/*: | ||
stage: post-merge | ||
|
||
models: | ||
- env: &deploy-env | ||
SCALITY_OCI_REPO: registry.scality.com/scality/zenko-ui | ||
- Git: &clone | ||
name: fetch source | ||
repourl: '%(prop:git_reference)s' | ||
shallow: true | ||
retryFetch: true | ||
haltOnFailure: true | ||
- ShellCommand: &yarn-install | ||
name: install dependencies | ||
command: yarn install --frozen-lockfile | ||
haltOnFailure: true | ||
- ShellCommand: &yarn-build | ||
name: build assets | ||
command: yarn build | ||
haltOnFailure: true | ||
- ShellCommand: &docker-build | ||
name: build docker image | ||
command: >- | ||
set -exu; | ||
docker build --pull -t ${SCALITY_OCI_REPO}:%(prop:commit_short_revision)s .; | ||
haltOnFailure: True | ||
env: *deploy-env | ||
|
||
stages: | ||
pre-merge: | ||
worker: &worker | ||
type: kube_pod | ||
path: eve/workers/worker.yaml | ||
images: | ||
build: eve/workers/build | ||
steps: | ||
- Git: *clone | ||
- ShellCommand: *yarn-install | ||
# TODO: run tests | ||
# - ShellCommand: | ||
# name: run test suite | ||
# command: yarn test | ||
# haltOnFailure: True | ||
- ShellCommand: *yarn-build | ||
- ShellCommand: *docker-build | ||
post-merge: | ||
worker: *worker | ||
steps: | ||
- Git: *clone | ||
- ShellCommand: *yarn-install | ||
- ShellCommand: *yarn-build | ||
- ShellCommand: *docker-build | ||
- ShellCommand: | ||
name: publish docker image to Scality OCI registry | ||
command: >- | ||
set -exu; | ||
docker login --username "%(secret:harbor_login)s" --password "%(secret:harbor_password)s" ${SCALITY_OCI_REPO}; | ||
docker push ${SCALITY_OCI_REPO}:%(prop:commit_short_revision)s; | ||
haltOnFailure: True | ||
env: *deploy-env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
FROM ubuntu:18.04 | ||
|
||
# | ||
# Install packages needed by the buildchain | ||
# | ||
ENV LANG C.UTF-8 | ||
RUN apt update && apt install -y curl apt-transport-https gnupg | ||
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - | ||
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list | ||
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - | ||
|
||
COPY ./pensieve_packages.list ./buildbot_worker_packages.list /tmp/ | ||
RUN apt-get update \ | ||
&& cat /tmp/*packages.list | xargs apt-get install -y | ||
|
||
# Install docker | ||
ARG DOCKER_VERSION=18.06.1~ce~3-0~ubuntu | ||
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - \ | ||
&& echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" \ | ||
| tee -a /etc/apt/sources.list.d/docker-ce.list \ | ||
&& apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \ | ||
docker-ce=${DOCKER_VERSION} \ | ||
&& rm -rf /var/lib/apt/lists/* /var/cache/apt \ | ||
&& rm -f /tmp/packages.list | ||
|
||
# | ||
# Add user eve | ||
# | ||
RUN adduser -u 1042 --home /home/eve --disabled-password --gecos "" eve \ | ||
&& adduser eve sudo \ | ||
&& sed -ri 's/(%sudo.*)ALL$/\1NOPASSWD:ALL/' /etc/sudoers | ||
|
||
# | ||
# Run buildbot-worker on startup | ||
# | ||
ARG BUILDBOT_VERSION | ||
RUN pip install buildbot-worker==$BUILDBOT_VERSION | ||
|
||
WORKDIR /home/eve/workspace | ||
CMD buildbot-worker create-worker . "$BUILDMASTER:$BUILDMASTER_PORT" "$WORKERNAME" "$WORKERPASS" \ | ||
&& buildbot-worker start --nodaemon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
ca-certificates | ||
git | ||
libffi-dev | ||
libssl-dev | ||
python2.7 | ||
python2.7-dev | ||
python-pip | ||
software-properties-common | ||
sudo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
nodejs | ||
yarn=1.9.4-1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: "zenko-ui-worker" | ||
spec: | ||
containers: | ||
- name: build | ||
image: {{ images.build }} | ||
resources: | ||
requests: | ||
cpu: "1" | ||
memory: 1Gi | ||
limits: | ||
cpu: "1" | ||
memory: 1Gi | ||
env: | ||
- name: DOCKER_HOST | ||
value: localhost | ||
volumeMounts: | ||
- name: workspace | ||
mountPath: /home/eve/workspace | ||
- name: dind-daemon | ||
image: docker:18.09.2-dind | ||
resources: | ||
requests: | ||
cpu: "1" | ||
memory: 2Gi | ||
limits: | ||
cpu: "1" | ||
memory: 2Gi | ||
securityContext: | ||
privileged: true | ||
volumeMounts: | ||
- name: docker-storage | ||
mountPath: /var/lib/docker | ||
- name: workspace | ||
mountPath: /home/eve/workspace | ||
volumes: | ||
- name: workspace | ||
emptyDir: {} | ||
- name: docker-storage | ||
emptyDir: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,7 @@ | ||
const webpack = require('webpack'); | ||
const merge = require('webpack-merge'); | ||
const common = require('./webpack.common'); | ||
|
||
module.exports = merge(common, { | ||
mode: 'production', | ||
devtool: 'hidden-source-map', | ||
plugins: [ | ||
new webpack.DefinePlugin({ | ||
'process.env.NODE_ENV': JSON.stringify('production'), | ||
}), | ||
], | ||
}); |
Oops, something went wrong.