ci(pm): add project-manager preset
This commit is contained in:
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
PROJECT=puzzlez
|
PROJECT=puzzlez
|
||||||
VERSION=$(grep -m 1 'version' ./package.json | grep -oP '"version"\s*:\s*"\K\d+\.\d+.\d+')
|
#VERSION=$(grep -m 1 'version' ./package.json | grep -oP '"version"\s*:\s*"\K\d+\.\d+.\d+')
|
||||||
SDK_PATH=$HOME/sdk
|
SDK_PATH=$HOME/sdk
|
||||||
PUBLISH_PATH=$HOME/public/$PROJECT
|
PUBLISH_PATH=$HOME/public/$PROJECT
|
||||||
BUILD_PATH=./build
|
BUILD_PATH=./build
|
||||||
@@ -8,7 +8,7 @@ KEY_STORE=<keystore.jks>
|
|||||||
KEY_PASS=<passphrase>
|
KEY_PASS=<passphrase>
|
||||||
|
|
||||||
# publish
|
# publish
|
||||||
REPO=https://git.shmyga.ru/api/packages/InfernalGames
|
PUBLISH_REPO=https://git.shmyga.ru/api/packages/InfernalGames
|
||||||
PUBLISH_USER=<username>
|
PUBLISH_USER=<username>
|
||||||
PUBLISH_PASSWORD=<passphrase>
|
PUBLISH_PASSWORD=<passphrase>
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -1,4 +1,4 @@
|
|||||||
/build/
|
build/
|
||||||
target/
|
target/
|
||||||
src-gen/
|
src-gen/
|
||||||
out/
|
out/
|
||||||
@@ -10,8 +10,8 @@ out/
|
|||||||
.idea/
|
.idea/
|
||||||
.ideaDataSources/
|
.ideaDataSources/
|
||||||
config.json
|
config.json
|
||||||
/node_modules
|
node_modules
|
||||||
/log
|
log
|
||||||
/ansible/*.retry
|
ansible/*.retry
|
||||||
.npmrc
|
.npmrc
|
||||||
.env
|
.env
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
modules = ["."]
|
||||||
|
|
||||||
|
[presets.docker]
|
||||||
|
variables.docker_target = "web"
|
||||||
|
variables.docker_name = "{{ project_name }}-web"
|
||||||
|
|
||||||
|
[presets.docker.tasks.build.compose]
|
||||||
|
priority = 1
|
||||||
|
variables.sdk_path = "{{ 'SDK_PATH' | env('$HOME/sdk') }}"
|
||||||
|
variables.publish_path = "{{ 'PUBLISH_PATH' | env('$HOME/public/' + project_name) }}"
|
||||||
|
variables.build_path = "{{ 'BUILD_PATH' | env('./build') }}"
|
||||||
|
variables.target_path = "{{ 'TARGET_PATH' | env('./target') }}"
|
||||||
|
commands = [
|
||||||
|
"mkdir -p \"{{ sdk_path }}\" \"{{ publish_path }}\" \"{{ build_path }}\" \"{{ target_path }}\" \"src-gen\"",
|
||||||
|
"docker compose run --rm --user $(id -u):$(id -g) --build --remove-orphans builder",
|
||||||
|
]
|
||||||
|
|
||||||
|
[presets.gitea]
|
||||||
|
variables.publish_artefacts.debian = "target/app/debian/{{ project_name }}_{{ project_version }}_all.deb"
|
||||||
|
variables.publish_artefacts.android = "target/app/android/{{ project_name }}_{{ project_version }}.apk"
|
||||||
|
variables.publish_artefacts.archive_linux = "target/app/archive/{{ project_name }}_{{ project_version }}_linux.tar.gz"
|
||||||
|
variables.publish_artefacts.archive_win = "target/app/archive/{{ project_name }}_{{ project_version }}_win.zip"
|
||||||
|
variables.publish_artefacts.installer = "target/app/installer/{{ project_name }}_{{ project_version }}.exe"
|
||||||
+11
-10
@@ -1,10 +1,10 @@
|
|||||||
FROM ubuntu:noble AS base
|
FROM ubuntu:noble AS base
|
||||||
RUN apt update && apt install -y \
|
RUN apt update && apt install -y \
|
||||||
nodejs \
|
nodejs \
|
||||||
npm \
|
npm \
|
||||||
openjdk-11-jre \
|
openjdk-11-jre \
|
||||||
protobuf-compiler \
|
protobuf-compiler \
|
||||||
jq
|
jq
|
||||||
RUN node -v
|
RUN node -v
|
||||||
RUN npm -v
|
RUN npm -v
|
||||||
|
|
||||||
@@ -12,16 +12,17 @@ FROM base AS builder
|
|||||||
ENV GRADLE_USER_HOME=/sdk/gradle
|
ENV GRADLE_USER_HOME=/sdk/gradle
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package.json package-lock.json ./
|
COPY package.json package-lock.json ./
|
||||||
RUN npm ci
|
RUN --mount=type=cache,target=/root/.npm \
|
||||||
|
npm ci
|
||||||
COPY gulpfile.js protohx.json ./
|
COPY gulpfile.js protohx.json ./
|
||||||
COPY tasks ./tasks
|
COPY tasks ./tasks
|
||||||
COPY config.example.json ./config.example.json
|
COPY config.example.json ./config.example.json
|
||||||
RUN --mount=type=secret,id=KEY_STORE \
|
RUN --mount=type=secret,id=KEY_STORE \
|
||||||
cat /run/secrets/KEY_STORE > ./key.jks
|
cat /run/secrets/KEY_STORE > ./key.jks
|
||||||
RUN --mount=type=secret,id=KEY_PASS,env=KEY_PASS \
|
RUN --mount=type=secret,id=KEY_PASS,env=KEY_PASS \
|
||||||
jq --arg key_pass "$KEY_PASS" \
|
jq --arg key_pass "$KEY_PASS" \
|
||||||
'.SdkDir = "/sdk" | .PublishDir = "/app/publish" | .Key.store = "key.jks" | .Key.pass = $key_pass' \
|
'.SdkDir = "/sdk" | .PublishDir = "/app/publish" | .Key.store = "key.jks" | .Key.pass = $key_pass' \
|
||||||
config.example.json > config.json
|
config.example.json > config.json
|
||||||
COPY src ./src
|
COPY src ./src
|
||||||
COPY dependencies ./dependencies
|
COPY dependencies ./dependencies
|
||||||
VOLUME ["/sdk", "/app/build", "/app/target", "/app/publish", "/app/src-gen"]
|
VOLUME ["/sdk", "/app/build", "/app/target", "/app/publish", "/app/src-gen"]
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
[defaults]
|
|
||||||
hash_behaviour = merge
|
|
||||||
host_key_checking = False
|
|
||||||
#callback_whitelist = profile_tasks
|
|
||||||
display_skipped_hosts = False
|
|
||||||
stdout_callback = yaml
|
|
||||||
bin_ansible_callbacks = True
|
|
||||||
|
|
||||||
[ssh_connection]
|
|
||||||
pipelining = True
|
|
||||||
ssh_args = -o ForwardAgent=yes
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
---
|
|
||||||
- hosts: all
|
|
||||||
vars:
|
|
||||||
ansible_user: "{{ deploy_user }}"
|
|
||||||
roles:
|
|
||||||
- ansible-deploy
|
|
||||||
- build
|
|
||||||
post_tasks:
|
|
||||||
- include_role:
|
|
||||||
name: ansible-deploy
|
|
||||||
tasks_from: complete.yml
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
all:
|
|
||||||
hosts: localhost
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
---
|
|
||||||
project_name: puzzlez
|
|
||||||
project_user: holop
|
|
||||||
|
|
||||||
deploy_user: "{{ project_user }}"
|
|
||||||
deploy_project: "{{ project_name }}"
|
|
||||||
deploy_repo_url: "git@bitbucket.org:infernalgames/{{ project_name }}.git"
|
|
||||||
deploy_repo_version: master
|
|
||||||
deploy_npm: yes
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
all:
|
|
||||||
hosts: shmyga.ru
|
|
||||||
vars:
|
|
||||||
config_src: "/home/holop/puzzlez/config.json"
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
- name: ansible-deploy
|
|
||||||
src: git@bitbucket.org:shmyga/ansible-deploy.git
|
|
||||||
version: master
|
|
||||||
scm: git
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
config_src: "{{ deploy_release_dir }}/config.{{ inventory_hostname }}.json"
|
|
||||||
config_dest: "{{ deploy_release_dir }}/config.json"
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
---
|
|
||||||
- name: "Copy config"
|
|
||||||
copy:
|
|
||||||
src: "{{ config_src }}"
|
|
||||||
dest: "{{ config_dest }}"
|
|
||||||
remote_src: true
|
|
||||||
|
|
||||||
- name: "Gulp build"
|
|
||||||
command: "{{ deploy_release_dir }}/node_modules/.bin/gulp default"
|
|
||||||
args:
|
|
||||||
chdir: "{{ deploy_release_dir }}"
|
|
||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"SdkDir": "C:\\sdk",
|
"SdkDir": "$HOME/sdk",
|
||||||
"BuildDir": null,
|
"BuildDir": null,
|
||||||
"PublishDir": "",
|
"PublishDir": "$HOME/public/puzzlez",
|
||||||
"PublishUrl": "https://shmyga.ru/repo/puzzlez",
|
"PublishUrl": "https://shmyga.ru/repo/puzzlez",
|
||||||
"Develop": false,
|
"Develop": false,
|
||||||
"Key": {
|
"Key": {
|
||||||
|
|||||||
+6
-3
@@ -5,17 +5,20 @@ const packageInfo = require("./package.json");
|
|||||||
const { System, Sdk, Haxe, Project } = require("gulp-haxetool");
|
const { System, Sdk, Haxe, Project } = require("gulp-haxetool");
|
||||||
const dateformat = require("dateformat");
|
const dateformat = require("dateformat");
|
||||||
const publish = require("./tasks/gulp-publish");
|
const publish = require("./tasks/gulp-publish");
|
||||||
|
const os = require("os");
|
||||||
|
|
||||||
|
const resolvePath = (path) => path.replace("$HOME", os.homedir());
|
||||||
|
|
||||||
if (packageInfo.haxe) {
|
if (packageInfo.haxe) {
|
||||||
Haxe.VERSION = packageInfo.haxe;
|
Haxe.VERSION = packageInfo.haxe;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.SdkDir) {
|
if (Config.SdkDir) {
|
||||||
Sdk.dir = Config.SdkDir;
|
Sdk.dir = resolvePath(Config.SdkDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config.BuildDir) {
|
if (Config.BuildDir) {
|
||||||
Haxe.buildDir = Config.BuildDir;
|
Haxe.buildDir = resolvePath(Config.BuildDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.clean = function clean() {
|
exports.clean = function clean() {
|
||||||
@@ -104,7 +107,7 @@ const server = new Project(
|
|||||||
module.exports.publish = publish(
|
module.exports.publish = publish(
|
||||||
packageInfo.name,
|
packageInfo.name,
|
||||||
packageInfo.version,
|
packageInfo.version,
|
||||||
Config.PublishDir,
|
resolvePath(Config.PublishDir),
|
||||||
Config.PublishUrl,
|
Config.PublishUrl,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
+4
-1
@@ -1,7 +1,10 @@
|
|||||||
{
|
{
|
||||||
"name": "puzzlez",
|
"name": "puzzlez",
|
||||||
"version": "0.6.1",
|
"version": "0.6.1",
|
||||||
"private": true,
|
"scripts": {
|
||||||
|
"build": "gulp",
|
||||||
|
"dev": "gulp app:flash:test"
|
||||||
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"dateformat": "^3.0.3",
|
"dateformat": "^3.0.3",
|
||||||
"fs-extra": "^10.0.0",
|
"fs-extra": "^10.0.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user