refs #4036 run command: code fixes, dockerfiles renamed

This commit is contained in:
Juan Ferrer 2022-12-16 00:54:23 +01:00
parent 8475a93e82
commit 578190458f
7 changed files with 63 additions and 63 deletions

View File

@ -66,7 +66,7 @@ class Run {
if (!isEqual) {
const fd = await fs.open(`${dumpDir}/.changes`, 'w+');
for (const change of changes)
fs.write(fd, change.mark + change.path + '\n');
await fs.write(fd, change.mark + change.path + '\n');
await fs.close(fd);
}
}
@ -75,10 +75,10 @@ class Run {
let serverDockerfile = path.join(dumpDir, 'Dockerfile');
if (!await fs.pathExists(serverDockerfile))
serverDockerfile = path.join(serverDir, 'Dockerfile.server');
serverDockerfile = path.join(serverDir, 'Dockerfile.base');
await docker.build(__dirname, {
tag: 'myvc/server-base',
tag: 'myvc/base',
file: serverDockerfile
}, opts.debug);
@ -86,7 +86,7 @@ class Run {
await docker.build(__dirname, {
tag: 'myvc/server',
file: path.join(serverDir, 'Dockerfile')
file: path.join(serverDir, 'Dockerfile.server')
}, opts.debug);
// Build dump image

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "myvc",
"version": "1.4.18",
"version": "1.4.19",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "myvc",
"version": "1.4.18",
"version": "1.4.19",
"license": "GPL-3.0",
"dependencies": {
"@sqltools/formatter": "^1.2.3",

View File

@ -1,6 +1,6 @@
{
"name": "myvc",
"version": "1.4.18",
"version": "1.4.19",
"author": "Verdnatura Levante SL",
"description": "MySQL Version Control",
"license": "GPL-3.0",

View File

@ -1,54 +0,0 @@
FROM myvc/server-base
USER root
ENV MYSQL_ROOT_PASSWORD root
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
&& curl -sL https://deb.nodesource.com/setup_14.x | bash - \
&& apt-get install -y --no-install-recommends \
nodejs \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir /mysql-data \
&& chown -R mysql:mysql /mysql-data
WORKDIR /myvc
COPY \
package.json \
./
RUN npm install --only=prod
COPY \
structure.sql \
myvc.js \
myvc-push.js \
lib.js \
docker.js \
myvc.default.yml \
db.ini \
./
COPY exporters exporters
RUN ln -s /myvc/myvc.js /usr/local/bin/myvc
WORKDIR /workspace
COPY server/docker.cnf /etc/mysql/conf.d/
COPY \
server/docker-init.sh \
server/docker-push.sh \
server/docker-dump.sh \
server/docker-start.sh \
/usr/local/bin/
USER mysql
ENTRYPOINT ["docker-start.sh"]
CMD ["mysqld"]
HEALTHCHECK --interval=2s --timeout=10s --retries=200 \
CMD mysqladmin ping -h 127.0.0.1 -u root --password=root || exit 1

1
server/Dockerfile.base Normal file
View File

@ -0,0 +1 @@
FROM mysql:5.6

View File

@ -1 +1,54 @@
FROM mysql:5.6
FROM myvc/base
USER root
ENV MYSQL_ROOT_PASSWORD root
ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
&& curl -sL https://deb.nodesource.com/setup_14.x | bash - \
&& apt-get install -y --no-install-recommends \
nodejs \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir /mysql-data \
&& chown -R mysql:mysql /mysql-data
WORKDIR /myvc
COPY \
package.json \
./
RUN npm install --only=prod
COPY \
structure.sql \
myvc.js \
myvc-push.js \
lib.js \
docker.js \
myvc.default.yml \
db.ini \
./
COPY exporters exporters
RUN ln -s /myvc/myvc.js /usr/local/bin/myvc
WORKDIR /workspace
COPY server/docker.cnf /etc/mysql/conf.d/
COPY \
server/docker-init.sh \
server/docker-push.sh \
server/docker-dump.sh \
server/docker-start.sh \
/usr/local/bin/
USER mysql
ENTRYPOINT ["docker-start.sh"]
CMD ["mysqld"]
HEALTHCHECK --interval=2s --timeout=10s --retries=200 \
CMD mysqladmin ping -h 127.0.0.1 -u root --password=root || exit 1

View File

@ -8,6 +8,6 @@
"type": "git"
},
"dependencies": {
"myvc": "^1.4.15"
"myvc": "^1.4.19"
}
}