Migrating from bower to yarn
* Works with the Docker development image * Requires an upgrade to Node 8 * Using bower-away and yarn for simplicity Change-Id: I353fb2f01f50f88707341369221d32ac9de513b1
This commit is contained in:
parent
0f55b39a6b
commit
902d0362c7
@ -14,9 +14,9 @@ Install API dependencies
|
|||||||
|
|
||||||
Install RefStack UI dependencies
|
Install RefStack UI dependencies
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
``curl -sL https://deb.nodesource.com/setup_4.x | sudo bash -``
|
``curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -``
|
||||||
|
``echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list``
|
||||||
``sudo apt-get install nodejs``
|
``sudo apt-get update && sudo apt-get install yarn``
|
||||||
|
|
||||||
Setup the RefStack database
|
Setup the RefStack database
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
@ -86,7 +86,7 @@ Install RefStack application
|
|||||||
Install needed RefStack UI library dependencies
|
Install needed RefStack UI library dependencies
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
``npm install``
|
``yarn``
|
||||||
|
|
||||||
API configuration file preparation
|
API configuration file preparation
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
@ -1,45 +1,49 @@
|
|||||||
FROM ubuntu:16.04
|
FROM ubuntu:16.04
|
||||||
|
EXPOSE 443
|
||||||
RUN apt update -y && apt install -y sudo
|
|
||||||
|
|
||||||
RUN \
|
|
||||||
groupadd dev && \
|
|
||||||
useradd -g dev -s /bin/bash -d /home/dev -m dev && \
|
|
||||||
( umask 226 && echo "dev ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/50_dev )
|
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND noninteractive
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
|
ENV PYTHONPATH=/home/dev/refstack \
|
||||||
RUN \
|
SQL_DIR=/home/dev/mysql
|
||||||
apt -y install \
|
ENV REFSTACK_MYSQL_URL="mysql+pymysql://root@localhost/refstack?unix_socket=${SQL_DIR}/mysql.socket&charset=utf8"
|
||||||
sudo git vim wget \
|
|
||||||
nginx \
|
|
||||||
python-dev python3-dev python-pip \
|
|
||||||
libmysqlclient-dev mysql-client mysql-server libffi-dev\
|
|
||||||
npm && \
|
|
||||||
rm -rf /var/lib/apt/lists/* && \
|
|
||||||
rm -rf /var/lib/mysql/* && \
|
|
||||||
rm -rf /etc/nginx/sites-enabled/default
|
|
||||||
|
|
||||||
RUN \
|
|
||||||
pip install virtualenv tox httpie && \
|
|
||||||
ln -s /usr/bin/nodejs /usr/bin/node
|
|
||||||
|
|
||||||
ADD /docker/scripts/* /usr/bin/
|
ADD /docker/scripts/* /usr/bin/
|
||||||
ADD . /refstack
|
ADD . /refstack
|
||||||
|
|
||||||
ENV PYTHONPATH=/home/dev/refstack \
|
RUN apt update -y \
|
||||||
SQL_DIR=/home/dev/mysql
|
&& apt upgrade -y
|
||||||
|
|
||||||
ENV REFSTACK_MYSQL_URL="mysql+pymysql://root@localhost/refstack?unix_socket=${SQL_DIR}/mysql.socket&charset=utf8"
|
RUN apt install -y curl \
|
||||||
|
sudo \
|
||||||
|
&& groupadd dev \
|
||||||
|
&& useradd -g dev -s /bin/bash -d /home/dev -m dev \
|
||||||
|
&& ( umask 226 && echo "dev ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/50_dev ) \
|
||||||
|
&& curl -sL https://deb.nodesource.com/setup_8.x -o /tmp/setup_8.x.sh \
|
||||||
|
&& sudo bash /tmp/setup_8.x.sh \
|
||||||
|
&& apt install -y git \
|
||||||
|
libffi-dev \
|
||||||
|
libmysqlclient-dev \
|
||||||
|
mysql-client \
|
||||||
|
mysql-server \
|
||||||
|
nginx \
|
||||||
|
nodejs \
|
||||||
|
python-dev \
|
||||||
|
python-pip \
|
||||||
|
python3-dev \
|
||||||
|
sudo \
|
||||||
|
vim \
|
||||||
|
wget \
|
||||||
|
&& rm -rf /var/lib/apt/lists/* \
|
||||||
|
&& rm -rf /var/lib/mysql/* \
|
||||||
|
&& rm -rf /etc/nginx/sites-enabled/default \
|
||||||
|
&& npm install -g yarn \
|
||||||
|
&& pip install virtualenv tox httpie
|
||||||
|
|
||||||
USER dev
|
USER dev
|
||||||
|
|
||||||
RUN \
|
RUN echo "cd /home/dev/refstack" >> /home/dev/.bashrc \
|
||||||
echo "cd /home/dev/refstack" >> /home/dev/.bashrc &&\
|
&& echo "alias activate='source /home/dev/refstack/.venv/bin/activate'" >> /home/dev/.bashrc \
|
||||||
echo "alias activate='source /home/dev/refstack/.venv/bin/activate'" >> /home/dev/.bashrc &&\
|
&& echo "alias mysql='mysql --no-defaults -S ${SQL_DIR}/mysql.socket'" >> /home/dev/.bashrc \
|
||||||
echo "alias mysql='mysql --no-defaults -S ${SQL_DIR}/mysql.socket'" >> /home/dev/.bashrc &&\
|
&& start.sh \
|
||||||
start.sh &&\
|
&& api-init-db
|
||||||
api-init-db
|
|
||||||
|
|
||||||
CMD start.sh -s
|
CMD start.sh -s
|
||||||
EXPOSE 443
|
|
||||||
|
@ -41,8 +41,7 @@ build_refstack_env () {
|
|||||||
#Install some dev tools
|
#Install some dev tools
|
||||||
.venv/bin/pip install pymysql httpie
|
.venv/bin/pip install pymysql httpie
|
||||||
cd /home/dev/refstack
|
cd /home/dev/refstack
|
||||||
npm install
|
yarn
|
||||||
# bower install --config.interactive=false
|
|
||||||
|
|
||||||
build_tmpl /refstack/docker/templates/config.json.tmpl /home/dev/refstack/refstack-ui/app/config.json
|
build_tmpl /refstack/docker/templates/config.json.tmpl /home/dev/refstack/refstack-ui/app/config.json
|
||||||
build_tmpl /refstack/docker/templates/refstack.conf.tmpl /home/dev/refstack.conf
|
build_tmpl /refstack/docker/templates/refstack.conf.tmpl /home/dev/refstack.conf
|
||||||
|
30
package.json
30
package.json
@ -1,11 +1,10 @@
|
|||||||
{
|
{
|
||||||
"version": "0.0.1",
|
"version": "0.5.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"name": "refstack-ui",
|
"name": "refstack-ui",
|
||||||
"description": "A user interface for RefStack",
|
"description": "A user interface for RefStack",
|
||||||
"license": "Apache2",
|
"license": "Apache2",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"bower": "1.7.5",
|
|
||||||
"eslint": "^3.0.0",
|
"eslint": "^3.0.0",
|
||||||
"eslint-config-openstack": "4.0.1",
|
"eslint-config-openstack": "4.0.1",
|
||||||
"eslint-plugin-angular": "1.4.0",
|
"eslint-plugin-angular": "1.4.0",
|
||||||
@ -13,14 +12,31 @@
|
|||||||
"karma": "^1.7.1",
|
"karma": "^1.7.1",
|
||||||
"karma-chrome-launcher": "^2.2.0",
|
"karma-chrome-launcher": "^2.2.0",
|
||||||
"karma-cli": "1.0.1",
|
"karma-cli": "1.0.1",
|
||||||
"karma-jasmine": "^1.1.0"
|
"karma-jasmine": "^1.1.0",
|
||||||
|
"angular-mocks": "^1.3.15"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"postinstall": "bower install --config.interactive=false",
|
"prestart": "yarn",
|
||||||
"prestart": "npm install",
|
"pretest": "yarn",
|
||||||
"pretest": "npm install",
|
|
||||||
"test": "if [ -z $CHROME_BIN ];then export CHROME_BIN=/usr/bin/chromium-browser;fi && karma start ./refstack-ui/tests/karma.conf.js --single-run",
|
"test": "if [ -z $CHROME_BIN ];then export CHROME_BIN=/usr/bin/chromium-browser;fi && karma start ./refstack-ui/tests/karma.conf.js --single-run",
|
||||||
"test-auto-watch": "if [ -z $CHROME_BIN ];then export CHROME_BIN=/usr/bin/chromium-browser;fi && karma start ./refstack-ui/tests/karma.conf.js --auto-watch",
|
"test-auto-watch": "if [ -z $CHROME_BIN ];then export CHROME_BIN=/usr/bin/chromium-browser;fi && karma start ./refstack-ui/tests/karma.conf.js --auto-watch",
|
||||||
"lint": "eslint -c ./.eslintrc --no-color ./refstack-ui"
|
"lint": "eslint -c ./.eslintrc --no-color ./refstack-ui",
|
||||||
|
"postinstall": "node -e \"try { require('fs').symlinkSync(require('path').resolve('node_modules/@bower_components'), 'refstack-ui/app/assets/lib', 'junction') } catch (e) { }\""
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"bower-away": "^1.1.2",
|
||||||
|
"@bower_components/angular": "angular/bower-angular#1.3.15",
|
||||||
|
"@bower_components/angular-animate": "angular/bower-angular-animate#~1.3",
|
||||||
|
"@bower_components/angular-bootstrap": "angular-ui/bootstrap-bower#0.14.3",
|
||||||
|
"@bower_components/angular-busy": "cgross/angular-busy#4.1.3",
|
||||||
|
"@bower_components/angular-confirm-modal": "Schlogen/angular-confirm#1.2.3",
|
||||||
|
"@bower_components/angular-mocks": "angular/bower-angular-mocks#1.3.15",
|
||||||
|
"@bower_components/angular-resource": "angular/bower-angular-resource#1.3.15",
|
||||||
|
"@bower_components/angular-ui-router": "angular-ui/angular-ui-router-bower#0.2.13",
|
||||||
|
"@bower_components/bootstrap": "twbs/bootstrap#3.3.2",
|
||||||
|
"@bower_components/jquery": "jquery/jquery-dist#>= 1.9.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"yarn": ">= 1.0.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user