mirror of
https://github.com/hcengineering/platform.git
synced 2024-12-22 11:01:54 +03:00
Enable hardcoreeng docker hub (#1048)
Signed-off-by: Andrey Sobolev <haiodo@gmail.com>
This commit is contained in:
parent
3e4188dac3
commit
1b9a5e0395
59
.github/workflows/main.yml
vendored
59
.github/workflows/main.yml
vendored
@ -9,6 +9,9 @@ on:
|
||||
branches: [ main, develop ]
|
||||
pull_request:
|
||||
branches: [ main, develop ]
|
||||
create:
|
||||
tags:
|
||||
- v*
|
||||
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
workflow_dispatch:
|
||||
@ -239,4 +242,58 @@ jobs:
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: playwright-results
|
||||
path: ./tests/sanity/playwright-report/
|
||||
path: ./tests/sanity/playwright-report/
|
||||
docker-build:
|
||||
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v') }}
|
||||
needs: [ build, uitest, test, linting, svelte-check ]
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Cache build results
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cache-build-results
|
||||
with:
|
||||
path: |
|
||||
cloud
|
||||
common
|
||||
deploy
|
||||
dev
|
||||
models
|
||||
packages
|
||||
plugins
|
||||
pods
|
||||
server
|
||||
server-plugins
|
||||
templates
|
||||
tests
|
||||
rush.json
|
||||
.prettierrc
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }}
|
||||
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-${{ github.sha }}
|
||||
|
||||
- name: Installing...
|
||||
run: node common/scripts/install-run-rush.js install
|
||||
- name: Setting model version from git release...
|
||||
run: node common/scripts/install-run-rush.js bump-model-version
|
||||
- name: Bundle
|
||||
run: node common/scripts/install-run-rush.js bundle
|
||||
- name: Docker build
|
||||
run: node common/scripts/install-run-rush.js docker:build
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v1
|
||||
with:
|
||||
username: hardcoreeng
|
||||
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
|
||||
|
||||
- name: Docker push staging
|
||||
if: ${{ github.ref == 'refs/heads/main' }}
|
||||
run: node common/scripts/install-run-rush.js docker:staging
|
||||
- name: Docker push tag
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
||||
run: |
|
||||
echo Pushing release of tag ${{ github.ref }}
|
||||
node common/scripts/install-run-rush.js docker:push
|
||||
|
@ -228,6 +228,16 @@
|
||||
"ignoreDependencyOrder": false,
|
||||
"ignoreMissingScript": true
|
||||
},
|
||||
{
|
||||
"commandKind": "bulk",
|
||||
"name": "docker:staging",
|
||||
"summary": "docker:staging",
|
||||
"description": "Push docker staging images",
|
||||
"enableParallelism": true,
|
||||
"incremental": true,
|
||||
"ignoreDependencyOrder": false,
|
||||
"ignoreMissingScript": true
|
||||
},
|
||||
{
|
||||
"commandKind": "bulk",
|
||||
"name": "bundle",
|
||||
|
18
common/scripts/docker_tag.sh
Executable file
18
common/scripts/docker_tag.sh
Executable file
@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
version=$(git describe --tags --abbrev=0)
|
||||
|
||||
if [ "x$2" = "xstaging" ]
|
||||
then
|
||||
a=( ${version//./ } )
|
||||
((a[2]++))
|
||||
version="${a[0]}.${a[1]}.${a[2]}-staging"
|
||||
echo "Tagging stating $1 with version ${version}"
|
||||
docker tag "$1" "$1:$version"
|
||||
docker push "$1:$version"
|
||||
else
|
||||
echo "Tagging release $1 with version ${version}"
|
||||
docker tag "$1" "$1:$version"
|
||||
docker push "$1:$version"
|
||||
docker push "$1:latest"
|
||||
fi
|
@ -40,7 +40,7 @@ services:
|
||||
retries: 10
|
||||
test: curl -s http://localhost:9200/_cluster/health | grep -vq '"status":"red"'
|
||||
account:
|
||||
image: anticrm/account
|
||||
image: hardcoreeng/account
|
||||
links:
|
||||
- mongodb
|
||||
- minio
|
||||
@ -55,7 +55,7 @@ services:
|
||||
- MINIO_ACCESS_KEY=minioadmin
|
||||
- MINIO_SECRET_KEY=minioadmin
|
||||
front:
|
||||
image: anticrm/front
|
||||
image: hardcoreeng/front
|
||||
links:
|
||||
- mongodb
|
||||
- minio
|
||||
@ -73,7 +73,7 @@ services:
|
||||
- MINIO_ACCESS_KEY=minioadmin
|
||||
- MINIO_SECRET_KEY=minioadmin
|
||||
transactor:
|
||||
image: anticrm/transactor
|
||||
image: hardcoreeng/transactor
|
||||
links:
|
||||
- mongodb
|
||||
- elastic
|
||||
|
@ -10,10 +10,10 @@
|
||||
"lint:fix": "eslint --fix src",
|
||||
"start": "ts-node src/index.ts",
|
||||
"bundle": "esbuild src/index.ts --bundle --minify --platform=node > bundle.js",
|
||||
"docker:build": "docker build -t anticrm/tool .",
|
||||
"docker:push": "docker push anticrm/tool",
|
||||
"docker:build": "docker build -t hardcoreeng/tool .",
|
||||
"docker:staging": "../../common/scripts/docker_tag.sh hardcoreeng/tool staging",
|
||||
"docker:push": "../../common/scripts/docker_tag.sh hardcoreeng/tool",
|
||||
"run-local": "cross-env MINIO_ACCESS_KEY=minioadmin MINIO_SECRET_KEY=minioadmin MINIO_ENDPOINT=localhost MONGO_URL=mongodb://localhost:27017 TRANSACTOR_URL=ws:/localhost:3333 TELEGRAM_DATABASE=telegram-service ELASTIC_URL=http://localhost:9200 REKONI_URL=http://localhost:4004 ts-node ./src/index.ts",
|
||||
"run-local-node": "cross-env MINIO_ACCESS_KEY=minioadmin MINIO_SECRET_KEY=minioadmin MINIO_ENDPOINT=localhost MONGO_URL=mongodb://localhost:27017 TRANSACTOR_URL=ws:/localhost:3333 TELEGRAM_DATABASE=telegram-service ELASTIC_URL=http://localhost:9200 node ./bundle.js",
|
||||
"lint": "eslint src",
|
||||
"format": "prettier --write src && eslint --fix src"
|
||||
},
|
||||
|
@ -27,7 +27,7 @@ exec('git describe --tags --abbrev=0', (err, stdout, stderr) => {
|
||||
const version = {
|
||||
major: parseInt(rawVersion[0]),
|
||||
minor: parseInt(rawVersion[1]),
|
||||
patch: parseInt(rawVersion[2]) + 1 // Always use +1 version from released already.
|
||||
patch: parseInt(rawVersion[2])
|
||||
}
|
||||
const newVersion = JSON.stringify(version)
|
||||
if (JSON.stringify(currentVersion) !== newVersion) {
|
||||
|
@ -13,5 +13,5 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import { version } from '.'
|
||||
import version from './version.json'
|
||||
console.log(`"${version.major}.${version.minor}.${version.patch}"`)
|
||||
|
@ -1 +1 @@
|
||||
{"major":0,"minor":6,"patch":0}
|
||||
{"major":0,"minor":6,"patch":4}
|
@ -14,7 +14,7 @@ spec:
|
||||
spec:
|
||||
containers:
|
||||
- name: app
|
||||
image: anticrm/account
|
||||
image: hardcoreeng/account
|
||||
ports:
|
||||
- containerPort: 3000
|
||||
imagePullPolicy: Always
|
||||
|
@ -10,8 +10,9 @@
|
||||
"build:watch": "tsc",
|
||||
"lint:fix": "eslint --fix src",
|
||||
"bundle": "esbuild src/index.ts --bundle --minify --platform=node > bundle.js",
|
||||
"docker:build": "docker build -t anticrm/account .",
|
||||
"docker:push": "docker push anticrm/account",
|
||||
"docker:build": "docker build -t hardcoreeng/account .",
|
||||
"docker:staging": "../../common/scripts/docker_tag.sh hardcoreeng/account staging",
|
||||
"docker:push": "../../common/scripts/docker_tag.sh hardcoreeng/account",
|
||||
"run-local": "cross-env MONGO_URL=mongodb://localhost:27017 MINIO_ACCESS_KEY=minioadmin MINIO_SECRET_KEY=minioadmin MINIO_ENDPOINT=localhost TRANSACTOR_URL=ws:/localhost:3333 ts-node src/index.ts",
|
||||
"lint": "eslint src",
|
||||
"format": "prettier --write src && eslint --fix src"
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM node:14
|
||||
FROM node:16
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
|
@ -15,7 +15,7 @@ spec:
|
||||
spec:
|
||||
containers:
|
||||
- name: app
|
||||
image: anticrm/front
|
||||
image: hardcoreeng/front
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
imagePullPolicy: Always
|
||||
|
@ -8,9 +8,10 @@
|
||||
"build": "heft build",
|
||||
"build:watch": "tsc",
|
||||
"lint:fix": "eslint --fix src",
|
||||
"bundle": "esbuild src/__start.ts --define:process.env.MODEL_VERSION=$(rush model-version | tail -1) --bundle --minify --platform=node > bundle.js & rm -rf ./dist && cp -r ../../dev/prod/dist . && cp -r ../../dev/prod/public/* ./dist/ && rm ./dist/config.json",
|
||||
"docker:build": "docker build -t anticrm/front .",
|
||||
"docker:push": "docker push anticrm/front",
|
||||
"bundle": "esbuild src/__start.ts --define:process.env.MODEL_VERSION=$(node ../../models/all/lib/__showversion.js) --bundle --minify --platform=node > bundle.js & rm -rf ./dist && cp -r ../../dev/prod/dist . && cp -r ../../dev/prod/public/* ./dist/ && rm ./dist/config.json",
|
||||
"docker:build": "docker build -t hardcoreeng/front .",
|
||||
"docker:staging": "../../common/scripts/docker_tag.sh hardcoreeng/front staging",
|
||||
"docker:push": "../../common/scripts/docker_tag.sh hardcoreeng/front",
|
||||
"lint": "eslint src",
|
||||
"format": "prettier --write src && eslint --fix src"
|
||||
},
|
||||
|
@ -1,4 +1,4 @@
|
||||
FROM node
|
||||
FROM node:16
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
|
@ -15,7 +15,7 @@ spec:
|
||||
spec:
|
||||
containers:
|
||||
- name: app
|
||||
image: anticrm/transactor
|
||||
image: hardcoreeng/transactor
|
||||
ports:
|
||||
- containerPort: 3333
|
||||
imagePullPolicy: Always
|
||||
|
@ -9,8 +9,9 @@
|
||||
"build": "heft build",
|
||||
"lint:fix": "eslint --fix src",
|
||||
"bundle": "esbuild src/__start.ts --bundle --platform=node > bundle.js",
|
||||
"docker:build": "docker build -t anticrm/transactor .",
|
||||
"docker:push": "docker push anticrm/transactor",
|
||||
"docker:build": "docker build -t hardcoreeng/transactor .",
|
||||
"docker:staging": "../../common/scripts/docker_tag.sh hardcoreeng/transactor staging",
|
||||
"docker:push": "../../common/scripts/docker_tag.sh hardcoreeng/transactor",
|
||||
"build:watch": "tsc",
|
||||
"lint": "eslint src",
|
||||
"format": "prettier --write src && eslint --fix src"
|
||||
|
@ -35,7 +35,7 @@ services:
|
||||
retries: 10
|
||||
test: curl -s http://localhost:9200/_cluster/health | grep -vq '"status":"red"'
|
||||
account:
|
||||
image: anticrm/account
|
||||
image: hardcoreeng/account
|
||||
links:
|
||||
- mongodb
|
||||
- minio
|
||||
@ -51,7 +51,7 @@ services:
|
||||
- MINIO_ACCESS_KEY=minioadmin
|
||||
- MINIO_SECRET_KEY=minioadmin
|
||||
front:
|
||||
image: anticrm/front
|
||||
image: hardcoreeng/front
|
||||
links:
|
||||
- account
|
||||
- mongodb
|
||||
@ -70,7 +70,7 @@ services:
|
||||
- MINIO_ACCESS_KEY=minioadmin
|
||||
- MINIO_SECRET_KEY=minioadmin
|
||||
transactor:
|
||||
image: anticrm/transactor
|
||||
image: hardcoreeng/transactor
|
||||
links:
|
||||
- mongodb
|
||||
- elastic
|
||||
|
Loading…
Reference in New Issue
Block a user