From 082045e305787adfa18cf14611069ceb002c6e45 Mon Sep 17 00:00:00 2001 From: toki Date: Wed, 20 May 2026 08:05:15 +0900 Subject: [PATCH] =?UTF-8?q?=EC=A0=95=EB=A6=AC:=20=EA=B5=AC=ED=98=95=20?= =?UTF-8?q?=EC=98=88=EC=A0=9C=EC=99=80=20=EC=83=98=ED=94=8C=20=EB=AC=B8?= =?UTF-8?q?=EB=B2=95=EC=9D=84=20=EC=A0=95=EB=A6=AC=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 36 +- .../rules/project/domain/command/rules.md | 2 + .../rules/project/domain/sample/rules.md | 8 +- agent-ops/rules/project/rules.md | 10 +- assets/config.xml | 778 ------------------ assets/example.yaml | 93 --- assets/package/oto_update.bat | 2 +- assets/pipeline-test.yaml | 175 ---- assets/pipeline-test2.yaml | 114 --- assets/scheduler.yaml | 105 --- assets/scheduler2.yaml | 20 - assets/templates/mattermost_build_test.yaml | 21 - assets/templates/mattermost_test.yaml | 22 - assets/templates/mattermost_test_json.yaml | 28 - .../templates/mattermost_test_property.yaml | 29 - assets/yaml/example/command/copy.yaml | 40 - assets/yaml/example/foreach.yaml | 59 -- assets/yaml/example/pipeline/foreach.yaml | 59 -- assets/yaml/sample/02_pipeline_if.yaml | 2 + .../yaml/sample/05_pipeline_while_switch.yaml | 8 +- assets/yaml/sample/06_git.yaml | 5 +- assets/yaml/sample/09_network.yaml | 37 +- assets/yaml/sample/14_shell_process.yaml | 16 +- build_osx.yaml | 31 - build_win.yaml | 26 - lib/oto/core/defined_data.dart | 130 +-- lib/oto/pipeline/pipeline.dart | 1 + lib/oto/pipeline/pipeline_condition.dart | 8 +- lib/oto/pipeline/pipeline_wait_until.dart | 12 +- slack_test.yaml | 56 -- 30 files changed, 151 insertions(+), 1782 deletions(-) delete mode 100644 assets/config.xml delete mode 100644 assets/example.yaml delete mode 100644 assets/pipeline-test.yaml delete mode 100644 assets/pipeline-test2.yaml delete mode 100644 assets/scheduler.yaml delete mode 100644 assets/scheduler2.yaml delete mode 100644 assets/templates/mattermost_build_test.yaml delete mode 100644 assets/templates/mattermost_test.yaml delete mode 100644 assets/templates/mattermost_test_json.yaml delete mode 100644 assets/templates/mattermost_test_property.yaml delete mode 100644 assets/yaml/example/command/copy.yaml delete mode 100644 assets/yaml/example/foreach.yaml delete mode 100644 assets/yaml/example/pipeline/foreach.yaml delete mode 100644 build_osx.yaml delete mode 100644 build_win.yaml delete mode 100644 slack_test.yaml diff --git a/README.md b/README.md index ae6ec09..181f953 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,6 @@ pipeline: ```yaml - if: condition-string: " == prod" - type: string on-true: - exe: deployProd on-false: @@ -125,8 +124,7 @@ pipeline: ```yaml - while: - condition-string: " < 3" - type: int + condition-int: < 3 on-do: - exe: checkStatus ``` @@ -135,20 +133,21 @@ pipeline: ```yaml - switch: - value: + condition-string: cases: - prod: - - exe: deployProd - dev: - - exe: deployDev + - value: prod + tasks: + - exe: deployProd + - value: dev + tasks: + - exe: deployDev ``` ### wait-until — 대기 ```yaml -- wait-until-true: - condition-string: " == complete" - interval: 10 +- async: buildStep +- wait-until-string: != complete ``` ### async — 비동기 실행 @@ -175,7 +174,11 @@ pipeline: | `BuildFlutter` | flutter build | | `BuildDart` | dart build | | `BuildDartCompile` | dart compile | +| `BuildDotNet` | dotnet build | | `BuildMSBuild` | MSBuild (.NET) | +| `XcodeprojAddFile` | Xcode 프로젝트 파일 추가 | +| `CodeSign` | macOS codesign | +| `CodeSignVerify` | codesign 검증 | | `ProductBuild` | macOS productbuild | | `Notarize` | macOS 공증 | @@ -227,7 +230,7 @@ pipeline: | `Upload` | FTP 업로드 | | `Download` | FTP 다운로드 | | `WebRequest` | HTTP 요청 | -| `WebFile` | HTTP 파일 다운로드 | +| `WebFile` | HTTP multipart 파일 업로드 | | `URLInfo` | URL 정보 파싱 | ### 문자열 / 유틸 @@ -237,7 +240,6 @@ pipeline: | `Print` | 메시지 출력 | | `SetValue` | property 값 직접 설정 | | `Delay` | 지연 (초) | -| `Timer` | 경과 시간 측정 | | `StringSub` | 문자열 자르기 | | `StringReplace` | 문자열 치환 | | `StringReplacePattern` | 정규식 치환 | @@ -304,8 +306,9 @@ DataBuildiOS extends DataParam { 1. lib/oto/data/*.dart DataParam 상속 모델 정의 + @JsonSerializable 2. lib/oto/commands/command.dart CommandType enum에 값 추가 3. lib/oto/commands/{category}/ Command 상속 클래스 구현 -4. lib/oto/commands/command_registry.dart registerAllCommands()에 등록 -5. dart run build_runner build *.g.dart 생성 +4. Command.register(..., spec: CommandSpec(...))에 구현체/데이터 모델/샘플 경로 등록 +5. lib/oto/commands/command_registry.dart registerAllCommands()에 등록 함수 연결 +6. dart run build_runner build *.g.dart 생성 ``` --- @@ -341,7 +344,6 @@ scheduler: ``` lib/ ├── cli/ # CLI 인자 파싱, 스케줄러 관리 -├── framework/ # 플랫폼 추상화, ProcessExecutor, 로깅 └── oto/ ├── application.dart # 싱글턴 오케스트레이터 ├── commands/ # 커맨드 구현체 (카테고리별) @@ -368,5 +370,5 @@ dart run build_runner build # 데이터 모델 생성 ## 에러 처리 - `Application.build()`는 `catch (e, stacktrace)`로 Exception과 Error 모두 처리 -- 실패 시 `exit(10)` 으로 부모 프로세스에 실패 신호 전달 +- 실패 시 `BuildResult.failure(..., exitCode: 10)`을 반환하고 CLI가 부모 프로세스에 exit code 전달 - `passExitCodes`로 성공으로 간주할 exit code 지정 가능 diff --git a/agent-ops/rules/project/domain/command/rules.md b/agent-ops/rules/project/domain/command/rules.md index 8074d18..95bfe0a 100644 --- a/agent-ops/rules/project/domain/command/rules.md +++ b/agent-ops/rules/project/domain/command/rules.md @@ -18,6 +18,7 @@ ## 주요 구성 요소 - `Command` (`command.dart`) — 커맨드 베이스 클래스, `CommandType` enum +- `CommandSpec` (`command.dart`) — CommandType → category/dataModel/samplePath 메타데이터 - `CommandRegistry` (`command_registry.dart`) — CommandType → Command 매핑 등록소 - `DataParam` (`base_data.dart`) — 모든 커맨드 파라미터의 베이스 - `DataCommand` (`command_data.dart`) — 모든 커맨드에 전달되는 통합 컨테이너 @@ -38,6 +39,7 @@ ## 유지할 패턴 - 새 커맨드는 반드시 `Command` 상속 후 `CommandRegistry`에 등록 +- `Command.register()`에는 `CommandSpec`을 함께 전달해 category, dataModel, samplePath를 기록 - 파라미터 모델은 `DataParam` 상속 + `@JsonSerializable` - `*.g.dart`는 `dart run build_runner build`로 생성한다. 생성 파일 직접 수정은 생성 불가한 긴급 상황에서만 한다 - `getWorkspace()`: workspace 필드 → `property['workspace']` → `commonData.workspace` 순으로 resolve diff --git a/agent-ops/rules/project/domain/sample/rules.md b/agent-ops/rules/project/domain/sample/rules.md index 892f0ae..ad72354 100644 --- a/agent-ops/rules/project/domain/sample/rules.md +++ b/agent-ops/rules/project/domain/sample/rules.md @@ -10,10 +10,14 @@ AI가 파이프라인 YAML을 작성하거나 검토할 때 가장 먼저 읽는 - `assets/yaml/sample/` — 카테고리별 샘플 YAML 파일 +## 제거된 레거시 경로 + +- `assets/yaml/example/` — 기존 실험용 파일. 새 예제 재작성 전 혼선을 줄이기 위해 제거됨 +- `assets/templates/` — 알림 테스트 템플릿. 새 예제 재작성 전 혼선을 줄이기 위해 제거됨 +- 루트/`assets/` 하위의 구형 테스트 YAML/XML (`build_*.yaml`, `slack_test.yaml`, `pipeline-test*.yaml`, `scheduler*.yaml`, `assets/config.xml`, `assets/example.yaml`)은 현재 형상과 맞지 않아 제거됨 + ## 제외 경로 -- `assets/yaml/example/` — 기존 실험용 파일 (샘플 도메인 아님) -- `assets/templates/` — 알림 템플릿 (샘플 도메인 아님) - `lib/oto/data/` — 실제 파라미터 모델은 command 도메인 ## 주요 구성 요소 diff --git a/agent-ops/rules/project/rules.md b/agent-ops/rules/project/rules.md index dab4ec0..a6b27b3 100644 --- a/agent-ops/rules/project/rules.md +++ b/agent-ops/rules/project/rules.md @@ -61,6 +61,7 @@ lib/ - 모든 커맨드 파라미터는 `DataParam` (`lib/oto/data/base_data.dart`) 상속 - JSON 직렬화: `json_annotation` 사용, 생성 파일은 `*.g.dart` +- `CommandSpec` — 커맨드의 category, dataModel, samplePath 메타데이터 - `DataCommon` – Jenkins 환경 데이터 (workspace, job name, build number 등) - `DataCommand` (`command_data.dart`) – 모든 `Command.execute()`에 전달되는 통합 컨테이너 @@ -69,14 +70,15 @@ lib/ 1. `lib/oto/data/*_data.dart`에 데이터 모델 정의 (`DataParam` 상속) 2. `lib/oto/commands/command.dart`의 `CommandType` enum에 값 추가 3. `Command` 상속하여 커맨드 클래스 구현 -4. `lib/oto/commands/command_registry.dart`에 등록 -5. 관련 `assets/yaml/sample/**` 샘플 갱신 필요 여부 확인 -6. `@JsonSerializable` 클래스 추가/변경 시 `dart run build_runner build` 실행 +4. `Command.register(..., spec: CommandSpec(...))`에 구현체/데이터 모델/샘플 경로 등록 +5. `lib/oto/commands/command_registry.dart`의 `registerAllCommands()`에 등록 함수 연결 +6. 관련 `assets/yaml/sample/**` 샘플 갱신 필요 여부 확인 +7. `@JsonSerializable` 클래스 추가/변경 시 `dart run build_runner build` 실행 ## 에러 처리 - `Application.build()`는 `catch (e, stacktrace)` (Exception이 아닌 Error 포함 캐치) -- 에러 시 `exit(10)` 호출로 부모 프로세스에 실패 신호 전달 +- 에러 시 `BuildResult.failure(..., exitCode: 10)`을 반환하고 CLI 진입점이 부모 프로세스에 실패 exit code를 전달 ## 스킬 기반 작업 흐름 diff --git a/assets/config.xml b/assets/config.xml deleted file mode 100644 index 981e3de..0000000 --- a/assets/config.xml +++ /dev/null @@ -1,778 +0,0 @@ - - - - 빌드 가이드 문서 - -https://lgtest.atlassian.net/wiki/spaces/FE/pages/78217452/AOS+Jenkins - false - - - - 15 - -1 - -1 - -1 - false - - - - - - url - LT환경 설정화면이 없이 고정주소 빌드가 필요할때 사용해 주세요. -공백일경우 앱시작시 LT환경 설정이 나옵니다. -(http또는 https를 포함한 주소를 넣어주세요. 공백이 포함되거나, 마지막 /가 포함되면 정상 실행이 되지 않을수 있습니다.) - false - - - modify_app_id - App ID를 변경합니다. 'com.lguplus.mobile.cs' 에서 추가로 값이 추가되어 운영버전의 앱과 중복 설치 가능하게 됩니다. -예를들어 myapp로 설정시 App ID 'com.lguplus.mobile.cs.myapp'으로 빌드되며, 앱이름은 '당신의 U+ (myapp)로 설정됩니다. 앱아이콘은 dev띠를 두릅니다. -공백일경우 운영과 동일한 App ID로 빌드됩니다. -(텍스트내 공백무시, 대문자 무시, 기호불가, 10자 한정, 10자 초과시 자름) - dev - true - - - slack_message - 빌드 완료시 Slack에 메세지를 보낼때, 어떤용도의 빌드인지 알기 위한 판별용 메세지입니다. -등록된 사용자의 경우 멘션(@김아무개) 사용도 가능합니다. - false - - - branch - 빌드할 브런치입니다. 특정 feature 브런치용 빌드를 원하신다면 설정에서 이 항목에 추가해주세요. -(수정권한이 없으면 앱파트에 요청해주세요.) - - - main - develop - release/7.0.6 - release/7.0.7 - release/7.0.10 - release/7.0.11 - release/6.0.38_test - feature/DCBGIT-21704_U+2.0크롬판별_이슈 - feature/DCBGIT-20848_LT빌드-자동화 - feature/DCBGIT-18853_딥링크_이동페이지_변경 - feature/DCBGWBS-6721_가속화002_챗봇 - feature/DCBGQA-6078_용어사전pdf_다운로드이슈 - feature/DCBGIT-24352_디바이스식별자전달 - - - - - slack_channel - 알림을 보낼 Slack 채널을 선택합니다. - - - 디지털fe-앱빌드 - 디지털fe-앱빌드_테스트 - - - - - debuggable - 디버깅 가능한 빌드인지 여부입니다. 체크시 디버깅 가능한 빌드로 빌드 됩니다. - true - - - share - 외부공유용 (Firebase 이용) - false - - - obfuscation - 난독화를 할지 여부 입니다. - false - - - release - 메인 url을 제외한 빌드세팅을 Release환경으로 선택하여 빌드 합니다. (메인 url은 위에 있는 url필드 값을 따라갑니다.) - false - - - BuildData - 빌드용 스크립트입니다. 터치하지 마세요. - --- -############################ Properties ############################ - -property: - workspace: '${WORKSPACE}' - slackChannel: '${slack_channel}' - slackMessage: '${slack_message}' - branch: '${branch}' - url: '${url}' - appID: '${modify_app_id}' - share: '${share}' - obfuscation: '${obfuscation}' - release: '${release}' - urlValue: https://mstg.lguplus.com - fileUrl: http://febuild.uhdcsre.com:8080/job/mcs-aos/${BUILD_NUMBER}/artifact/app/build/outputs/apk/mobileCS/lt/{FILE} - urlMessage: '' - appIDMessage: '' - portValue: '' - enableDevTool: 'true' - gradlePath: <!property.workspace>/app/build.gradle - stringsPath: <!property.workspace>/app/src/main/res/values/strings.xml - manifestPath: <!property.workspace>/app/src/main/AndroidManifest.xml - buildPath: <!property.workspace>/app/build/outputs/apk/mobileCS/lt - config: | - { - "version": "VERSION", - "versionCode": VERSION_CODE, - "gitHash": "GIT_HASH", - "buildDate": "BUILD_DATE" - } - templateLt: | - lt { - debuggable ${debuggable} - signingConfig null - - buildConfigField 'boolean', 'ENABLE_DEVTOOL', "{ENABLE_DEVTOOL}" - buildConfigField 'boolean', 'DEV', "${debuggable}" - buildConfigField 'String', 'DEBUG_LOG_TAG', '"MobileCS_STG"' - buildConfigField 'String', 'HTTP_WEB_URL', '"{HTTP_URL}"' - buildConfigField 'String', 'WEB_URL', '"{URL}"' - buildConfigField 'String', 'PUSH_APPLICATION_ID', '"custm_FCM1"' - buildConfigField 'String', 'PUSH_SERVICE_ID', '"30153"' - buildConfigField 'String', 'PUSH_URL', '"http://222.231.13.33:5556"' - buildConfigField 'String', 'PUSH_AUTH', '"auth=0000002359;C20384A50EBCD4FD2A1B"' - buildConfigField 'String', 'CHATBOT_URL', '"https://chatbot-stg.lguplus.com/?fromChan=APP"' - buildConfigField 'String', 'FIDO_URL', '"https://stg-onps.uplus.co.kr"' - buildConfigField 'String', 'FIDO_BIZ_API_URL', '"https://stg.uplus.co.kr/uhdc/fo/apcm/authbio/v1"' - buildConfigField 'String', 'FIDO_SITE_ID', '"SIT01UPLUS0000000000"' - buildConfigField 'String', 'FIDO_SVC_ID', '"SVC01SIT01UPLUS00000"' - buildConfigField 'String', 'USIM_AGENT_API_KEY', '"a6AwmI2XEWup9MALI/Z/ASzDs87gcNmKifk2iyUUChs="' - buildConfigField 'String', 'SERVER_TYPE', '"STG"' - buildConfigField "java.util.Map<String, String>", "LT_ENVIRONMENT_MAP", "new java.util.HashMap<String, String>() {{ " + - " put(\"QA (https)\", \"https://mstg.lguplus.com\");" + - " put(\"QA\", \"http://mstg.lguplus.com\");" + - " put(\"운영\", \"https://app.lguplus.com\");" + - " put(\"PRE\", \"https://mpre.lguplus.com\");" + - " put(\"DEV\", \"http://mdev.uplus.com\");" + - "}}" - - manifestPlaceholders = [buildType: ""] - } - templateRelease: | - lt { - debuggable ${debuggable} - minifyEnabled false - shrinkResources false - signingConfig null - - buildConfigField 'boolean', 'ENABLE_DEVTOOL', "{ENABLE_DEVTOOL}" - buildConfigField 'boolean', 'DEV', "${debuggable}" - buildConfigField 'String', 'DEBUG_LOG_TAG', '"MobileCS"' - buildConfigField 'String', 'HTTP_WEB_URL', '"{HTTP_URL}"' - buildConfigField 'String', 'WEB_URL', '"{URL}"' - buildConfigField 'String', 'PUSH_APPLICATION_ID', '"custm_FCM1"' - buildConfigField 'String', 'PUSH_SERVICE_ID', '"21016"' - buildConfigField 'String', 'PUSH_URL', '"http://upushgw.uplus.co.kr:5556"' - buildConfigField 'String', 'PUSH_AUTH', '"auth=0000002415;CDAC132152FCB4F4499F"' - buildConfigField 'String', 'CHATBOT_URL', '"https://chatbot.lguplus.com/?fromChan=APP"' - buildConfigField 'String', 'FIDO_URL', '"https://onps.uplus.co.kr"' - buildConfigField 'String', 'FIDO_BIZ_API_URL', '"https://app.lguplus.com/uhdc/fo/apcm/authbio/v1"' - buildConfigField 'String', 'FIDO_SITE_ID', '"SIT01UPLUS0000000000"' - buildConfigField 'String', 'FIDO_SVC_ID', '"SVC01SIT01UPLUS00000"' - buildConfigField 'String', 'USIM_AGENT_API_KEY', '"mV/yWnRgD2wQn5sjzokKGVJZDdVKDnLPkvS4cG+jwZE="' - buildConfigField 'String', 'SERVER_TYPE', '"PROD"' - buildConfigField "java.util.Map<String, String>", "LT_ENVIRONMENT_MAP", "new java.util.HashMap<String, String>()" - - manifestPlaceholders = [buildType: ""] - } - slackMessageAdd: | - "text": "<!property.slackMessage>", - slackMessageJson: | - { - "channel": "<!property.slackChannel>", - {SLACK_MESSAGE} - "attachments": [ - { - "color": "#81CA3F", - "author_name": "Android", - "fields": [ - { - "value": "```Builder: ${BUILD_USER}\nJob URL: ${BUILD_URL}\nBranch: ${GIT_BRANCH}\nGitHash: ${GIT_COMMIT}\nVersion: {VERSION}\nVersion Code: {VERSION_CODE}\nRelease 환경: ${release}\n{URL}DevTool 활성: {DEVTOOL}\n{APPID}Date: {DATE}```" - } - ], - "image_url": "https://api.qrserver.com/v1/create-qr-code/?data={FILE_URL}&size=150x150", - "actions": [ - { - "type": "button", - "name": "build", - "text": "Download", - "url": "{FILE_URL}" - } - ] - } - ] - } - - - -############################# Pipeline ############################# - -pipeline: - id: main - workflow: - # Set app info - - exe: create-app - - # Set envValue - - if: - condition-bool: <!property.release> == true - on-true: - - exe: set-release - on-false: - - exe: set-lt - - # Set urlValue - - contain: - list: <!property.url> - target: '{url}' - on-false: - - exe: parse-url - - if: - condition-string: <!property.port> != 443 - on-true: - - if: - condition-string: <!property.port> != 80 - on-true: - - exe: set-port - - exe: set-url - - # Gradle에 Signing 정보 입력 - - exe: gradle-read - - exe: append-sign - - exe: replace-http-url - - exe: replace-url - - exe: replace-env - - exe: gradle-write - - - contain: - list: <!property.appID> - target: '{modify_app_id}' - on-false: - - exe: set-appid-message - # 앱이름 변경 - - exe: strings-read - - exe: app-rename - - exe: strings-write - - # 파일 권한 및 아이콘 변경 - - exe: manifest-read - - exe: replace-icon - - exe: replace-permission - - exe: manifest-write - - # Listing Files - - exe: files - - foreach: - iterator: <!property.files> - setValue: <@property.file> - on-do: - # Pacckage name replace - - exe: file-read - - exe: replace-package - - exe: file-write - - # Config 작성 - - exe: set-config - - exe: write-config - - # Gradle 빌드 - - exe: build - - # Slack Message가 빈값일때 empty 세팅 - - contain: - list: <!property.slackMessage> - target: '{slack_message}' - on-true: - - exe: set-slack-message-empty - - # Listing Build Files - - exe: files-build - - foreach: - iterator: <!property.files> - setValue: <@property.fileBuild> - on-do: - - contain: - list: <!property.fileBuild> - target: output-metadata.json - on-true: - - exe: read-build-meta - - if: - condition-string: <!property.enableDevTool> == false - on-true: - - exe: replace-file-name - - exe: rename-build-file - - exe: set-file-name - - - - exe: set-slack-message - - exe: slack - -############################# Commands ############################# - -commands: -### Create App Data -- command: CreateAppData - id: create-app - param: - scm: Git - name: mcs - relativeAssetPath: app/src/main/assets - setVersion: <@property.version> - setHash: <@property.hash> - setDate: <@property.date> - -### Set Lt -- command: SetValue - id: set-lt - param: - values-string: - envValue: <!property.templateLt> - -### Set Release -- command: SetValue - id: set-release - param: - values-string: - envValue: <!property.templateRelease> - urlValue: http://app.lguplus.com - -### Parse URL -- command: URLInfo - id: parse-url - param: - url: <!property.url> - setScheme: <@property.scheme> - setHost: <@property.host> - setPort: <@property.port> - -### Set Port Value -- command: SetValue - id: set-port - param: - values-string: - portValue: :<!property.port> - -### Set default url -- command: SetValue - id: set-url - param: - values-string: - urlValue: <!property.scheme>://<!property.host><!property.portValue> - urlMessage: 'URL: <!property.scheme>://<!property.host><!property.portValue>\n' - enableDevTool: 'false' - -### Gradle Read -- command: FileRead - id: gradle-read - param: - showPrint: false - path: <!property.gradlePath> - setContent: <@property.gradle> - -### Set Signing Option -- command: StringReplace - id: append-sign - param: - showPrint: false - text: <!property.gradle> - pair: - - from: android { - to: | - android { - signingConfigs { - Lt { - storeFile file("keystore.dat") - storePassword "123456" - keyAlias "kingkor" - keyPassword "123456" - } - } - setValue: <@property.gradle> - -### Replace http url -- command: StringReplace - id: replace-http-url - param: - showPrint: true - text: <!property.urlValue> - pair: - - from: https:// - to: http:// - setValue: <@property.httpUrlValue> - -### Replace url -- command: StringReplace - id: replace-url - param: - showPrint: true - text: <!property.envValue> - pair: - - from: '{HTTP_URL}' - to: <!property.httpUrlValue> - - from: '{URL}' - to: <!property.urlValue> - - from: '{ENABLE_DEVTOOL}' - to: <!property.enableDevTool> - setValue: <@property.envValue> - -### Replace env -- command: StringReplacePattern - id: replace-env - param: - startAt: 0 - showPrint: true - startPattern: 'lt {' - endPattern: ' }' - text: <!property.gradle> - value: <!property.envValue> - setValue: <@property.gradle> - -### Gradle Write -- command: FileWrite - id: gradle-write - param: - path: <!property.gradlePath> - content: <!property.gradle> - -### App ID Message -- command: SetValue - id: set-appid-message - param: - values-string: - appIDMessage: '변경된 App ID: com.lguplus.mobile.cs.<!property.appID>\n' - -### Strings Read -- command: FileRead - id: strings-read - param: - showPrint: false - path: <!property.stringsPath> - setContent: <@property.strings> - -### Replace App Name -- command: StringReplace - id: app-rename - param: - showPrint: false - text: <!property.strings> - pair: - - from: <string name="app_name">당신의 U+</string> - to: <string name="app_name">당유(<!property.appID>)</string> - setValue: <@property.strings> - -### Strings Write -- command: FileWrite - id: strings-write - param: - path: <!property.stringsPath> - content: <!property.strings> - -### Manifest Read -- command: FileRead - id: manifest-read - param: - showPrint: false - path: <!property.manifestPath> - setContent: <@property.manifest> - -### Replace Icon -- command: StringReplace - id: replace-icon - param: - showPrint: false - text: <!property.manifest> - pair: - - from: android:icon="@drawable/ic_launcher" - to: android:icon="@drawable/ic_launcher_dev" - setValue: <@property.manifest> - -### Replace Permission -- command: StringReplace - id: replace-permission - param: - showPrint: false - text: <!property.manifest> - pair: - - from: </application> - to: | - </application> - - <uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" tools:ignore="ScopedStorage"/> - - setValue: <@property.manifest> - -### Manifest Write -- command: FileWrite - id: manifest-write - param: - path: <!property.manifestPath> - content: <!property.manifest> - -### Files Listing -- command: Files - id: files - param: - path: <!property.workspace>/app - recursive: true - ignoreRegExs: - - ^.*\/\.[a-zA-Z0-9_-]+\/.* # .git .idea etc.. - - ^.*\.(png|jpg|jpeg|gif|bmp)$ # image files - - ^.*\.(txt|so|mk|crt|ttf)$ # ignore ext - - /build/ - - /buildScript/ - - /schemas/ - - /libs/ - - /aars/ - - /mobileCS/ - - /.DS_Store - - /proguard-rules.pro - - /lint.xml - - /.gitignore - setFiles: <@property.files> - -### File Read -- command: FileRead - id: file-read - param: - showPrint: false - path: <!property.file> - setContent: <@property.fileContent> - -### Replace Package -- command: StringReplace - id: replace-package - param: - showPrint: false - text: <!property.fileContent> - pair: - - from: com.lguplus.mobile.cs - to: com.lguplus.mobile.cs.<!property.appID> - setValue: <@property.fileContent> - -### Strings Write -- command: FileWrite - id: file-write - param: - path: <!property.file> - content: <!property.fileContent> - -### Print -- command: Print - id: print - param: - message: 'File: <!property.file>' - -### Set Config -- command: StringReplace - id: set-config - param: - showPrint: false - text: <!property.config> - pair: - - from: GIT_HASH - to: ${GIT_COMMIT} - - from: BUILD_DATE - to: <!property.date> - setValue: <@property.config> - -### Write Config -- command: FileWrite - id: write-config - param: - path: <!property.workspace>/app/src/main/assets/config.json - content: <!property.config> - -### Build Gradle -- command: Shell - id: build - param: - commands: - - ./gradlew clean assembleLt - -### Build Files Listing -- command: Files - id: files-build - param: - path: <!property.workspace>/app/build/outputs/apk/mobileCS/lt - recursive: false - setFiles: <@property.files> - -### Read build meta -- command: JsonReaderFile - id: read-build-meta - param: - path: <!property.fileBuild> - pair: - - from: elements[0].versionCode - setValue: <@property.versionCode> - - from: elements[0].versionName - setValue: <@property.versionName> - - from: elements[0].outputFile - setValue: <@property.fileBuildName> - - from: elements[0].outputFile - setValue: <@property.fileBuildReplacedName> - -### Replace file name -- command: StringReplace - id: replace-file-name - param: - showPrint: false - text: <!property.fileBuildName> - pair: - - from: '_lt_' - to: '_<!property.host>_' - setValue: <@property.fileBuildReplacedName> - -### Rename Build File -- command: Rename - id: rename-build-file - param: - renameMap: - <!property.workspace>/app/build/outputs/apk/mobileCS/lt/<!property.fileBuildName>: <!property.workspace>/app/build/outputs/apk/mobileCS/lt/<!property.fileBuildReplacedName> - -### Set File Name -- command: StringReplace - id: set-file-name - param: - showPrint: false - text: <!property.fileUrl> - pair: - - from: '{FILE}' - to: <!property.fileBuildReplacedName> - setValue: <@property.fileUrl> - -### Set Slack Message -- command: StringReplace - id: set-slack-message - param: - showPrint: false - text: <!property.slackMessageJson> - pair: - - from: '{SLACK_MESSAGE}' - to: <!property.slackMessageAdd> - - from: '{APPID}' - to: <!property.appIDMessage> - - from: '{DATE}' - to: <!property.date> - - from: '{VERSION}' - to: <!property.versionName> - - from: '{VERSION_CODE}' - to: <!property.versionCode> - - from: '{URL}' - to: <!property.urlMessage> - - from: '{DEVTOOL}' - to: <!property.enableDevTool> - - from: '{FILE_URL}' - to: <!property.fileUrl> - setValue: <@property.slackMessageJson> - -### Set Slack Message to empty -- command: SetValue - id: set-slack-message-empty - param: - values-string: - slackMessageAdd: '' - -### Slack -- command: Slack - id: slack - param: - token: xoxb-3457711939825-8629587578534-ysH4Q5R0lM8gdgJ8dx3z6xI7 - messageJson: <!property.slackMessageJson> - idMap: - 박형윤: U03L21XV6LE - 이동명: U05A94D57RS - 심재진: U03L8HZCN75 - 이미영: U04H7HMV4R2 - 김시형: U03LYCJ1XU0 - 김가영: U050BN7EH8W - 김낙운: U05DRP0N295 - 한희경: U03KU1YJUG7 - false - - - - - - 2 - - - https://gitlab.uhdcsre.com/app-developer/lgup-mcs-aos.git - bfd6fb6a-e36e-4d12-87a8-4c6ca93bc28b - - - - - */${branch} - - - false - - - - mac-mini-m2 - false - false - false - false - - false - - - # Load .zprofile if it exists -if [ -f ~/.zprofile ]; then - source ~/.zprofile -fi - -# Load .bash_profile if it exists -if [ -f ~/.bash_profile ]; then - source ~/.bash_profile -fi - -# Load .bashrc if it exists (optional) -if [ -f ~/.bashrc ]; then - source ~/.bashrc -fi - -# Load .zshrc if it exists (optional) -if [ -f ~/.zshrc ]; then - source ~/.zshrc -fi - -echo $PATH -BASEDIR=$(dirname $0) -#echo "===> Script location: ${BASEDIR}" -#cd ${BASEDIR}/../../.. -echo "===> Build Project Path: ${PWD}" - -echo ${BUILD_USER} -echo ${BUILD_USER_ID} - -oto exe -j - - - - - - app/build/outputs/apk/mobileCS/lt/*.apk - false - false - false - true - true - false - - - - - xterm - - - \ No newline at end of file diff --git a/assets/example.yaml b/assets/example.yaml deleted file mode 100644 index 8d57f4d..0000000 --- a/assets/example.yaml +++ /dev/null @@ -1,93 +0,0 @@ ---- -import: - - #외부 정의 파이프라인 로드 - -#전역 변수(), runtime에서 할당, 수정 가능 -properties: - #로 접근 - workspace: ${WORKSPACE} - -#pipeline 사용시에는 커맨드는 무조건 command id로만 사용 -pipeline: - id: main - workflow: - #동기식 실행, 해당 수행이 끝나야만 다음 스텝실행, command일경우 해당 id 기입 - - exe: - - #비동기식 실행, 해당 수행이 완료됨과 관계없이 실행하고 다음 스텝을 실행한다 - - async: - - #외부에서 import한 문서에 선언한 pipeline의 id - - exec: - - #일반적인 if문과 동일 - - if: - #property의 내용은 기본 dynamic(Object)형으로써, 비교시 정확한 캐스팅 필요, 적지 않을시 기본 string - condition: == [int] - #false도 가능, true/false로 선언시 일반적인 else와 동일 - on-true: - - exe: - - #일반적인 while문과 동일 - - while: - condition-bool: - do: - - async: - - exec: - #조건식이 끝날때까지 단순 대기, 비동기 실행의 완료를 잡기위함 - - wait-until: != null - - if: - #version에 대한 비교시, 자릿수는 같아야 한다 0.0.0 or 0.0.0.0 - condition: == 1.0.1 [version] - on-true: - #조건문 내에도 선언 가능, 반대도 가능 - - while: - condition-int: < 10 - do: - - exec: - #일반적인 switch구문과 동일 - - switch: - state: [string] - case: - #case 아이템 하나에 여러 작업을 array형태로 할당 - - : - - exec: - - exec: - - test: - - exec: - - default: - - exec: - -#pipeline에 기록된 command id가 command define list에 없다면 오류를 뱉으며 종료 -commands: -- command: CreateAppData - id: createAppData#1 - param: - scm: Git - relativeAssetPath: assets/data - #결과가 저장되는 command의 경우 선언 - result: - #결과의 경우 무조건 설정하도록 - version: - #property[hash]에 저장 - hash: - -- command: BuildDart - id: buildDart#1 - param: {} - -- command: BuildDartCompile - id: buildDartCompile#1 - param: - targetDartFile: ./bin/main.dart - buildFileName: oto - -- command: Zip - id: zip#1 - param: - zipFile: /release/oto_linux_v.zip - zipList: - - /release/oto - - /release/test - rersult: - zipPath: diff --git a/assets/package/oto_update.bat b/assets/package/oto_update.bat index ae1db98..2ef99e4 100644 --- a/assets/package/oto_update.bat +++ b/assets/package/oto_update.bat @@ -1 +1 @@ -nuget push -ConfigFile "C:\Users\r0bin\AppData\Local\NuGet\NuGet.Config" -Source http://toki-labs.com:5001/v3/index.json -ApiKey a24d504c7fee0df0aea22c16b4bfcbb09701a79d "C:\works\oto\assets\package\chocolatey\oto.0.0.287.nupkg" \ No newline at end of file +nuget push -ConfigFile "C:\Path\To\NuGet.Config" -Source http://toki-labs.com:5001/v3/index.json -ApiKey YOUR_NUGET_API_KEY "C:\Path\To\oto.VERSION.nupkg" diff --git a/assets/pipeline-test.yaml b/assets/pipeline-test.yaml deleted file mode 100644 index 4dd90a3..0000000 --- a/assets/pipeline-test.yaml +++ /dev/null @@ -1,175 +0,0 @@ ---- -property: - workspace: . - revision: 24c9423 - valueTest: 15.3 - -pipeline: - id: main - workflow: - # - async: git - - exe: set-value - - exe: print - - # - exe: buildDart - - # - exe: json-reader - - #동기식 실행, 해당 수행이 끝나야만 다음 스텝실행, command일경우 해당 id 기입 - # - exe: appData - - #비동기식 실행, 해당 수행이 완료됨과 관계없이 실행하고 다음 스텝을 실행한다 - # - exe: buildDart - - # - switch: - # condition-string: - # cases: - # #case 아이템 하나에 여러 작업을 array형태로 할당 - # - value: 0.0.153 - # tasks: - # - exe: git - - # - async: git-count - - # - wait-until-seconds: 10 - # - wait-until-string: != complete - - # - async: git-rev - - # - while: - # condition-string: == null - # on-do: - # - exe: git - # - switch: - # condition-string: - # cases: - # #case 아이템 하나에 여러 작업을 array형태로 할당 - # - value: b6c2d44b2ec8b1a22fd9a88f4779e250b6ddc6b1 - # tasks: - # - exe: git - - #일반적인 if문과 동일 - # - if: - # #property의 내용은 기본 dynamic(Object)형으로써, 비교시 정확한 캐스팅 필요, 적지 않을시 기본 string - # condition-string: != - # on-true: - # - exe: zip - -commands: -### 파이프라인 실행도중 값 세팅 -- command: SetValue - id: set-value - param: - values-string: - stringTest: Test! - values-int: - intTest: 12 - values-float: - floatTest: - values-bool: - boolTest: true - -### Print -- command: Print - id: print - param: - message: this is test message / / / / - -### 콜백이 필요없는 단순 Git 명령 호출 -- command: Git - id: git - param: - commands: - - restore . - - clean -f - - checkout c65a8bb - -### Git 최신 리비전으로 업데이트 -- command: Git - id: git-update - param: - commands: - - fetch origin - - reset --hard origin/master - -### Git 로컬로 체크아웃 -- command: GitCheckout - id: git-checkout - param: - branch: main - execute-pull: true - -### Git Push -- command: GitPush - id: git-push - param: - branch: main - -### 깃 리비전 정보 저장 -- command: GitRev - id: git-rev - param: - result-value: - -### 깃 커밋카운트 저장 -- command: GitCount - id: git-count - param: - result-value: - -### Json value read -- command: JsonReader - id: json-reader - param: - json: - pair: - - from: deleted - setValue: <@property.deleted> - -### Version 쓰기 -- command: CreateAppData - id: appData - param: - scm: Git - name: OTO - relativeAssetPath: assets/data - return-version: "" - return-hash: "" - -### 실행가능한 파일로 빌드 -- command: BuildDart - id: buildDart - param: {} - -### 최종 zip 파일 형태로 저장 -- command: Zip - id: zip - param: - zipFile: "/release/oto_win_v.zip" - zipList: - - "/release/oto.exe" - -- command: AwsCli - id: aws-cli - param: - sub-command: s3api get-object - args: - - --profile vo-stage - - --bucket vo-stage-deploy - - --key stage/webserver/revision/api.jar - - api-0.0.1.jar - -- command: Docker - id: docker - param: - sub-command: stop - args: - - web - -- command: Gradle - id: gradle - param: - args: - - -p backend - - clean - - build \ No newline at end of file diff --git a/assets/pipeline-test2.yaml b/assets/pipeline-test2.yaml deleted file mode 100644 index 4465966..0000000 --- a/assets/pipeline-test2.yaml +++ /dev/null @@ -1,114 +0,0 @@ ---- -property: - workspace: . - os: - - aos - - ios - configAOS: - - C:/Jenkins/jobs/mcs-aos - - C:/Jenkins/jobs/mcs-aos-lt - configiOS: - - C:/Jenkins/jobs/mcs-ios - - C:/Jenkins/jobs/mcs-ios-lt - - -pipeline: - id: main - workflow: - - foreach: - iterator: - setValue: <@property.osValue> - on-do: - - if: - condition-string: == aos - on-true: - - exe: set-aos - on-false: - - exe: set-ios - - exe: print - - foreach: - iterator: - setValue: <@property.configValue> - on-do: - - exe: print-config - - exe: read - - exe: branch - - exe: param-modify - # - exe: write - - - - -commands: -### Set aos -- command: SetValue - id: set-aos - param: - values-string: - repository: C:/works/oto - values-object: - configs: - -### Set ios -- command: SetValue - id: set-ios - param: - values-string: - repository: C:/works/dart_framework - values-object: - configs: - -### Test print -- command: Print - id: print - param: - message: Repository - - -### Test print -- command: Print - id: print-config - param: - message: Config - - -### Strings Read -- command: FileRead - id: read - param: - showPrint: false - path: - setContent: <@property.content> - -### Replace -- command: StringReplace - id: replace - param: - showPrint: true - text: - pair: - - from: - to: - setValue: <@property.content> - -### List up branches -- command: GitBranch - id: branch - param: - path: - startDay: 60 - setBranches: <@property.value> - -### Modify param -- command: JenkinsParameterModify - id: param-modify - param: - content: - name: branch - value: - setContent: <@property.content> - -### Gradle Write -- command: FileWrite - id: write - param: - path: - content: \ No newline at end of file diff --git a/assets/scheduler.yaml b/assets/scheduler.yaml deleted file mode 100644 index 72b1d33..0000000 --- a/assets/scheduler.yaml +++ /dev/null @@ -1,105 +0,0 @@ ---- -scheduler: - alias: darksoulIII - cron: '* * * * *' - # interval: 10000 # ms - enableLog: true # (Optional) default: false - - -property: - workspace: C:/Users/r0bin/AppData/Roaming/DarkSoulsIII - saveFolder: /01100001112a7a14 - savePath: /DS30000.sl2 - -pipeline: - id: main - workflow: - - exe: read-web - - exe: json-read-web - - exe: json-read-local - - exe: diff - - if: - condition-bool: == true - on-true: - - exe: info - - if: - condition-date: < - on-true: - - exe: json-write-local - - exe: upload - - if: - condition-date: > - on-true: - - exe: json-write-web - - exe: download - - -commands: -- command: FileInfo - id: info - param: - path: - setInfo: <@property.info> - -- command: WebRequest - id: read-web - param: - url: https://toki-labs.com/cdn/save/darksoulIII/save.json - setResponse: <@property.web> - -- command: JsonReader - id: json-read-web - param: - json: - pair: - - from: lastSaved - setValue: <@property.lastSavedWeb> - -- command: JsonReaderFile - id: json-read-local - param: - path: /save.json - pair: - - from: lastSaved - setValue: <@property.lastSavedLocal> - -- command: Print - id: print - param: - message: change save file - -- command: FileDiffCheck - id: diff - param: - paths: - - - setDiff: <@property.diff> - -- command: JsonWriterFile - id: json-write-local - param: - path: /save.json - pair: - - from: lastSaved - value: - -- command: Copy - id: upload - param: - copyMap: - : \\192.168.0.97\Macintosh HD\Users\toki\docker\nginx\home\cdn\save\darksoulIII - /save.json : \\192.168.0.97\Macintosh HD\Users\toki\docker\nginx\home\cdn\save\darksoulIII - -- command: JsonWriterFile - id: json-write-web - param: - path: /save.json - pair: - - from: lastSaved - value: - -- command: Copy - id: download - param: - copyMap: - \\192.168.0.97\Macintosh HD\Users\toki\docker\nginx\home\cdn\save\darksoulIII\DS30000.sl2 : \ No newline at end of file diff --git a/assets/scheduler2.yaml b/assets/scheduler2.yaml deleted file mode 100644 index 42cb2ae..0000000 --- a/assets/scheduler2.yaml +++ /dev/null @@ -1,20 +0,0 @@ ---- -scheduler: - alias: test2 - cron: '* * * * *' - enableLog: true # (Optional) default: false - -property: - workspace: . - -pipeline: - id: main - workflow: - - exe: print - -commands: -### Print -- command: Print - id: print - param: - message: test \ No newline at end of file diff --git a/assets/templates/mattermost_build_test.yaml b/assets/templates/mattermost_build_test.yaml deleted file mode 100644 index 4bb32aa..0000000 --- a/assets/templates/mattermost_build_test.yaml +++ /dev/null @@ -1,21 +0,0 @@ ---- -property: - workspace: . - -pipeline: - id: main - workflow: - - exe: mattermost-build - -commands: - - command: MattermostBuild - id: mattermost-build - param: - url: https://mattermost.toki-labs.com/api/v4/posts - token: 3zihstia4frodxgea7i91agbye - channelId: n78a1wrdwjydzdoat6gci8cphe - appName: oto - type: ios - color: ED1458 - version: 1.0.0-test - downloadURL: https://example.com/download/oto.ipa diff --git a/assets/templates/mattermost_test.yaml b/assets/templates/mattermost_test.yaml deleted file mode 100644 index 92fff26..0000000 --- a/assets/templates/mattermost_test.yaml +++ /dev/null @@ -1,22 +0,0 @@ ---- -property: - workspace: . - -pipeline: - id: main - workflow: - - exe: mattermost - -commands: - - command: Mattermost - id: mattermost - param: - url: https://mattermost.toki-labs.com/api/v4/posts - token: 3zihstia4frodxgea7i91agbye - message: - channel_id: n78a1wrdwjydzdoat6gci8cphe - message: 봇 테스트 메시지입니다. - props: - attachments: - - pretext: Mattermost Bot Test - text: 정상적으로 전송되면 이 메시지가 채널에 표시됩니다. diff --git a/assets/templates/mattermost_test_json.yaml b/assets/templates/mattermost_test_json.yaml deleted file mode 100644 index b9b9ab3..0000000 --- a/assets/templates/mattermost_test_json.yaml +++ /dev/null @@ -1,28 +0,0 @@ ---- -property: - workspace: . - -pipeline: - id: main - workflow: - - exe: mattermost - -commands: - - command: Mattermost - id: mattermost - param: - url: https://mattermost.toki-labs.com/api/v4/posts - token: 3zihstia4frodxgea7i91agbye - messageJson: | - { - "channel_id": "n78a1wrdwjydzdoat6gci8cphe", - "message": "봇 테스트 메시지입니다. (messageJson)", - "props": { - "attachments": [ - { - "pretext": "Mattermost Bot Test", - "text": "정상적으로 전송되면 이 메시지가 채널에 표시됩니다. (messageJson)" - } - ] - } - } diff --git a/assets/templates/mattermost_test_property.yaml b/assets/templates/mattermost_test_property.yaml deleted file mode 100644 index 2b8a1ea..0000000 --- a/assets/templates/mattermost_test_property.yaml +++ /dev/null @@ -1,29 +0,0 @@ ---- -property: - workspace: . - -pipeline: - id: main - workflow: - - exe: set-payload - - exe: mattermost - -commands: - - command: SetValue - id: set-payload - param: - values-object: - mattermostPayload: - channel_id: n78a1wrdwjydzdoat6gci8cphe - message: 봇 테스트 메시지입니다. (property) - props: - attachments: - - pretext: Mattermost Bot Test - text: 정상적으로 전송되면 이 메시지가 채널에 표시됩니다. (property) - - - command: Mattermost - id: mattermost - param: - url: https://mattermost.toki-labs.com/api/v4/posts - token: 3zihstia4frodxgea7i91agbye - property: diff --git a/assets/yaml/example/command/copy.yaml b/assets/yaml/example/command/copy.yaml deleted file mode 100644 index 0b13829..0000000 --- a/assets/yaml/example/command/copy.yaml +++ /dev/null @@ -1,40 +0,0 @@ ---- -property: - workspace: C:/jenkins/workspace/VirtualOffice_PlayServer/Server/MetaVServer/Server/Src - deployPath: C:/Server - enviroment: devClient - - -pipeline: - id: main - workflow: - - exe: msbuild - - exe: print - - exe: copy - - -commands: -### MSBuild -- command: BuildMSBuild - id: msbuild - param: - projectFile: Server.sln - config: Release - type: Rebuild - -### Print -- command: Print - id: print - param: - message: build complete - -### Copy -- command: Copy - id: copy - param: - ignorePattern: - - servercfg.ini - - StartServer.bat - - StopServer.bat - copyMap: - "/Release64/*": "/" \ No newline at end of file diff --git a/assets/yaml/example/foreach.yaml b/assets/yaml/example/foreach.yaml deleted file mode 100644 index db0771c..0000000 --- a/assets/yaml/example/foreach.yaml +++ /dev/null @@ -1,59 +0,0 @@ ---- -property: - workspace: . - arr1: - - This is message 1 - - This is message 2 - - This is message 3 - - This is message 4 - map: - test1: This is message 1 - test2: This is message 2 - test3: This is message 3 - test4: This is message 4 - arr2: - - innter arr message 1 - - innter arr message 2 - - innter arr message 3 - - innter arr message 4 - -pipeline: - id: main - workflow: - # list foreach - - foreach: - iterator: - setValue: <@property.element1> - on-do: - - exe: print1 - # innter foreach - - foreach: - iterator: - setValue: <@property.element2> - on-do: - - exe: print2 - - # map foreach - - foreach: - iterator: - # setKey is optional - setKey: <@property.keyName> - setValue: <@property.element> - on-do: - - exe: print3 - -commands: -- command: Print - id: print1 - param: - message: - -- command: Print - id: print2 - param: - message: - -- command: Print - id: print3 - param: - message: - \ No newline at end of file diff --git a/assets/yaml/example/pipeline/foreach.yaml b/assets/yaml/example/pipeline/foreach.yaml deleted file mode 100644 index db0771c..0000000 --- a/assets/yaml/example/pipeline/foreach.yaml +++ /dev/null @@ -1,59 +0,0 @@ ---- -property: - workspace: . - arr1: - - This is message 1 - - This is message 2 - - This is message 3 - - This is message 4 - map: - test1: This is message 1 - test2: This is message 2 - test3: This is message 3 - test4: This is message 4 - arr2: - - innter arr message 1 - - innter arr message 2 - - innter arr message 3 - - innter arr message 4 - -pipeline: - id: main - workflow: - # list foreach - - foreach: - iterator: - setValue: <@property.element1> - on-do: - - exe: print1 - # innter foreach - - foreach: - iterator: - setValue: <@property.element2> - on-do: - - exe: print2 - - # map foreach - - foreach: - iterator: - # setKey is optional - setKey: <@property.keyName> - setValue: <@property.element> - on-do: - - exe: print3 - -commands: -- command: Print - id: print1 - param: - message: - -- command: Print - id: print2 - param: - message: - -- command: Print - id: print3 - param: - message: - \ No newline at end of file diff --git a/assets/yaml/sample/02_pipeline_if.yaml b/assets/yaml/sample/02_pipeline_if.yaml index 3d9157f..a88426b 100644 --- a/assets/yaml/sample/02_pipeline_if.yaml +++ b/assets/yaml/sample/02_pipeline_if.yaml @@ -7,6 +7,8 @@ property: workspace: /path/to/project env: prod + retryCount: 0 + version: 2.1.0 pipeline: id: main diff --git a/assets/yaml/sample/05_pipeline_while_switch.yaml b/assets/yaml/sample/05_pipeline_while_switch.yaml index a462ac4..ac770f6 100644 --- a/assets/yaml/sample/05_pipeline_while_switch.yaml +++ b/assets/yaml/sample/05_pipeline_while_switch.yaml @@ -15,7 +15,7 @@ pipeline: condition-int: < on-do: - exe: check-status - - exe: increment-retry + - exe: mark-retry-complete # switch: 값에 따라 분기 - switch: @@ -33,7 +33,7 @@ pipeline: # wait-until: 비동기 작업 완료 대기 # - async: long-running-task - # - wait-until-string: == complete + # - wait-until-string: != complete # wait-until-seconds: N초 단순 대기 # - wait-until-seconds: 30 @@ -45,10 +45,10 @@ commands: message: "상태 확인 중... (시도: )" - command: SetValue - id: increment-retry + id: mark-retry-complete param: values-int: - retryCount: 1 + retryCount: 3 - command: Print id: notify-success diff --git a/assets/yaml/sample/06_git.yaml b/assets/yaml/sample/06_git.yaml index 1c43cee..560e711 100644 --- a/assets/yaml/sample/06_git.yaml +++ b/assets/yaml/sample/06_git.yaml @@ -5,6 +5,7 @@ property: workspace: /path/to/project branch: main commitMessage: "chore: automated update" + hasChange: false pipeline: id: main @@ -41,13 +42,13 @@ commands: - command: GitRev id: git-rev param: - result-value: <@property.gitRev> + setValue: <@property.gitRev> # 전체 커밋 수 저장 - command: GitCount id: git-count param: - result-value: <@property.gitCount> + setValue: <@property.gitCount> - command: Print id: print-info diff --git a/assets/yaml/sample/09_network.yaml b/assets/yaml/sample/09_network.yaml index f364d4c..01e8255 100644 --- a/assets/yaml/sample/09_network.yaml +++ b/assets/yaml/sample/09_network.yaml @@ -3,6 +3,7 @@ property: workspace: /path/to/project + version: 1.0.0 pipeline: id: main @@ -12,7 +13,7 @@ pipeline: - exe: http-post # HTTP POST - exe: ftp-upload # FTP 업로드 - exe: ftp-download # FTP 다운로드 - - exe: download-file # HTTP 파일 다운로드 + - exe: upload-file # HTTP multipart 파일 업로드 commands: # HTTP GET, 응답 body 저장 @@ -45,36 +46,44 @@ commands: headers: Content-Type: application/json Authorization: Bearer your-token - body: + fields: appId: com.example.app version: setResponse: <@property.deployResponse> -# HTTP 파일 다운로드 +# HTTP multipart 파일 업로드 - command: WebFile - id: download-file + id: upload-file param: - url: https://example.com/tools/tool.zip - savePath: /tools/tool.zip + url: https://api.example.com/files + fields: + appId: com.example.app + filePart: file + fileMimeType: octet-stream + files: + - /release/app.ipa + setResponse: <@property.uploadResponse> -# FTP 업로드 (copyMap: local → remote) +# FTP 업로드 (map: local relative path → remote path) - command: Upload id: ftp-upload param: host: ftp.example.com + sftp: false port: 21 - id: ftp-user + user: ftp-user password: ftp-password - copyMap: - "/release/app.ipa": "/public/releases/app.ipa" + map: + "release/app.ipa": "/public/releases/app.ipa" -# FTP 다운로드 (copyMap: remote → local) +# FTP 다운로드 (map: local relative path → remote path) - command: Download id: ftp-download param: host: ftp.example.com + sftp: false port: 21 - id: ftp-user + user: ftp-user password: ftp-password - copyMap: - "/public/config/app.json": "/config/app.json" + map: + "config/app.json": "/public/config/app.json" diff --git a/assets/yaml/sample/14_shell_process.yaml b/assets/yaml/sample/14_shell_process.yaml index f655b69..bf5bcff 100644 --- a/assets/yaml/sample/14_shell_process.yaml +++ b/assets/yaml/sample/14_shell_process.yaml @@ -10,7 +10,7 @@ pipeline: workflow: - exe: check-port # 포트 사용 중인지 확인 - if: - condition-bool: == true + condition-string: != null on-true: - exe: kill-process # 기존 프로세스 종료 - exe: run-server # 서버 프로세스 실행 @@ -23,23 +23,20 @@ commands: id: check-port param: port: - setPortUse: <@property.portInUse> + setPid: <@property.portPid> # 특정 포트 프로세스 종료 - command: ProcessKill id: kill-process param: - port: + pid: # 프로세스 백그라운드 실행 - command: ProcessRun id: run-server param: - command: ./server - args: - - --port - - - setProcessId: <@property.serverPid> + executable: ./server + param: "--port " # 인라인 셸 명령 (여러 줄) - command: Shell @@ -56,6 +53,3 @@ commands: id: shell-script param: path: /scripts/deploy.sh - args: - - - - prod diff --git a/build_osx.yaml b/build_osx.yaml deleted file mode 100644 index f0253df..0000000 --- a/build_osx.yaml +++ /dev/null @@ -1,31 +0,0 @@ ---- -property: - workspace: "." - -commands: -### Version 쓰기 -- command: CreateAppData - param: - scm: Git - name: OTO - relativeAssetPath: assets/data - return-version: "" - return-hash: "" - -### 프로젝트 패키지 업데이트 -- command: BuildDart - param: {} - -### 실행가능한 파일로 빌드 -- command: BuildDartCompile - param: - targetDartFile: "./bin/main.dart" - buildFileName: oto - - -### 최종 zip 파일 형태로 저장 -- command: Zip - param: - zipFile: "/release/oto_osx_v.zip" - zipList: - - "/release/oto_service_cli" diff --git a/build_win.yaml b/build_win.yaml deleted file mode 100644 index 44a0977..0000000 --- a/build_win.yaml +++ /dev/null @@ -1,26 +0,0 @@ ---- -property: - workspace: "." - -commands: - ### Version 쓰기 -- command: CreateAppData - param: - scm: Git - name: OTO - relativeAssetPath: assets/data - return-version: "" - return-hash: "" - - ### 실행가능한 파일로 빌드 -- command: BuildDartCompile - param: - targetDartFile: "./bin/main.dart" - buildFileName: oto - - ### 최종 zip 파일 형태로 저장 -- command: Zip - param: - zipFile: "/release/oto_win_v.zip" - zipList: - - "/release/oto.exe" diff --git a/lib/oto/core/defined_data.dart b/lib/oto/core/defined_data.dart index 2e386aa..ac68ac2 100644 --- a/lib/oto/core/defined_data.dart +++ b/lib/oto/core/defined_data.dart @@ -66,25 +66,25 @@ commands: #- command: PublishiOS # param: # bundleID: com.tokilabs.tokiplayer -# version: +# version: # appName: TPlayer -# ipaURL: https://toki-labs.com/build/tplayer/ios/tplayer.ipa -# menifestURL: https://toki-labs.com/build/tplayer/ios/menifest.plist -# displayImageURL: https://toki-labs.com/build/tplayer/icon.png -# fullSizeImageURL: https://toki-labs.com/build/tplayer/icon.png +# ipaURL: https://example.com/build/tplayer/ios/tplayer.ipa +# menifestURL: https://example.com/build/tplayer/ios/menifest.plist +# displayImageURL: https://example.com/build/tplayer/icon.png +# fullSizeImageURL: https://example.com/build/tplayer/icon.png # destinationPath: d:/build #- command: ArchiveiOS # param: -# workspacePath: "/ios/Runner.xcworkspace" +# workspacePath: "/ios/Runner.xcworkspace" # scheme: Runner -# archivePath: "/build/ios/TPlayer" +# archivePath: "/build/ios/TPlayer" #- command: ExportiOS # param: -# archivePath: "/build/ios/TPlayer" -# exportOptionPlistPath: "/ExportOptions.plist" -# exportPath: "/build/ios" +# archivePath: "/build/ios/TPlayer" +# exportOptionPlistPath: "/ExportOptions.plist" +# exportPath: "/build/ios" #- command: BuildDartCompile # param: @@ -96,44 +96,44 @@ commands: # ignorePattern: [] # isMove: false # copyMap: -# "/README.md": "/../temp" -# "/bin/*": "/../temp/bin" +# "/README.md": "/../temp" +# "/bin/*": "/../temp/bin" #- command: Rename # param: # renameMap: -# "/../temp/README.md": "README_.md.back" -# "/../temp/bin/main.dart": "main.dart.back" -# "/../temp/test": "test2" +# "/../temp/README.md": "README_.md.back" +# "/../temp/bin/main.dart": "main.dart.back" +# "/../temp/test": "test2" #- command: Copy # param: # isMove: true # copyMap: -# "/../temp/README.md": "/../temp/bin" +# "/../temp/README.md": "/../temp/bin" #- command: Zip # param: -# zipFile: "/test_v_.zip" +# zipFile: "/test_v_.zip" # zipList: -# - "/bin/*" -# - "/README.md" +# - "/bin/*" +# - "/README.md" #- command: Upload # param: # sftp: false -# host: toki-labs.com +# host: ftp.example.com # port: 215 # user: spritex -# password: Na2674126 +# password: ftp-password # uploadMap: # README.md: "/HDD1/WEB/_tmp" # bin/*: "/HDD1/WEB/_tmp/bin" #- command: Shell # param: -# workspace: "" -# path: "/lib/shell/jenkins_env_params.bat" +# workspace: "" +# path: "/lib/shell/jenkins_env_params.bat" #- command: ExecuteApp # param: @@ -145,15 +145,15 @@ commands: # appName: tplayer # type: android # color: ED1458 -# version: -# downloadURL: http://toki-labs.com/build/tplayer/android/tplayer_arm64_.apk +# version: +# downloadURL: https://example.com/build/tplayer/android/tplayer_arm64_.apk # channel: release #- command: Mattermost # param: # url: https://mattermost.example.com/api/v4/posts # token: bot-token -# channelId: n78a1wrdwjydzdoat6gci8cphe +# channelId: mattermost-channel-id # message: # message: Bot test message. # props: @@ -175,8 +175,8 @@ commands: scm: Git name: Build Manager relativeAssetPath: assets/data - return-version: "" - return-hash: "" + setVersion: "<@property.version>" + setHash: "<@property.hash>" #- command: BuildDart # param: @@ -191,31 +191,31 @@ commands: #- command: BuildiOS # param: -# workspacePath: "/ios/Runner.xcworkspace" +# workspacePath: "/ios/Runner.xcworkspace" # scheme: Runner # destination: "generic/platform=iOS build" #- command: ArchiveiOS # param: -# workspacePath: "/ios/Runner.xcworkspace" +# workspacePath: "/ios/Runner.xcworkspace" # scheme: Runner -# archivePath: "/build/ios/TPlayer" +# archivePath: "/build/ios/TPlayer" #- command: ExportiOS # param: -# archivePath: "/build/ios/TPlayer" -# exportOptionPlistPath: "/ExportOptions.plist" -# exportPath: "/build/ios" +# archivePath: "/build/ios/TPlayer" +# exportOptionPlistPath: "/ExportOptions.plist" +# exportPath: "/build/ios" #- command: PublishiOS # param: # bundleID: com.tokilabs.tokiplayer -# version: +# version: # appName: TPlayer -# ipaURL: https://toki-labs.com/build/tplayer/ios/tplayer.ipa -# menifestURL: https://toki-labs.com/build/tplayer/ios/manifest.plist -# displayImageURL: https://toki-labs.com/build/tplayer/icon.png -# fullSizeImageURL: https://toki-labs.com/build/tplayer/icon.png +# ipaURL: https://example.com/build/tplayer/ios/tplayer.ipa +# menifestURL: https://example.com/build/tplayer/ios/manifest.plist +# displayImageURL: https://example.com/build/tplayer/icon.png +# fullSizeImageURL: https://example.com/build/tplayer/icon.png # destinationPath: d:/build #- command: BuildDartCompile @@ -228,44 +228,44 @@ commands: # ignorePattern: [] # isMove: false # copyMap: -# "/README.md": "/../temp" -# "/bin/*": "/../temp/bin" +# "/README.md": "/../temp" +# "/bin/*": "/../temp/bin" #- command: Rename # param: # renameMap: -# "/../temp/README.md": "README_.md.back" -# "/../temp/bin/main.dart": "main.dart.back" -# "/../temp/test": "test2" +# "/../temp/README.md": "README_.md.back" +# "/../temp/bin/main.dart": "main.dart.back" +# "/../temp/test": "test2" #- command: Copy # param: # isMove: true # copyMap: -# "/../temp/README.md": "/../temp/bin" +# "/../temp/README.md": "/../temp/bin" #- command: Zip # param: -# zipFile: "/test_v_.zip" +# zipFile: "/test_v_.zip" # zipList: -# - "/bin/*" -# - "/README.md" +# - "/bin/*" +# - "/README.md" #- command: Upload # param: # sftp: false -# host: toki-labs.com +# host: ftp.example.com # port: 215 # user: spritex -# password: Na2674126 +# password: ftp-password # uploadMap: # README.md: "/HDD1/WEB/_tmp" # bin/*: "/HDD1/WEB/_tmp/bin" #- command: Shell # param: -# workspace: "" -# path: "/lib/shell/jenkins_env_params.bat" +# workspace: "" +# path: "/lib/shell/jenkins_env_params.bat" #- command: ExecuteApp # param: @@ -277,15 +277,15 @@ commands: # appName: tplayer # type: android # color: ED1458 -# version: -# downloadURL: http://toki-labs.com/build/tplayer/android/tplayer_arm64_.apk +# version: +# downloadURL: https://example.com/build/tplayer/android/tplayer_arm64_.apk # channel: release #- command: Mattermost # param: # url: https://mattermost.example.com/api/v4/posts # token: bot-token -# channelId: n78a1wrdwjydzdoat6gci8cphe +# channelId: mattermost-channel-id # message: # message: Bot test message. # props: @@ -305,32 +305,32 @@ commands: map = { "workspace": Directory.current.path, "jenkinsHome": "/var/lib/jenkins", - "jenkinsUrl": "http://toki-labs.com:8083/", - "buildUrl": "http://toki-labs.com:8083/job/toki_os/54/", - "jobUrl": "http://toki-labs.com:8083/job/toki_os/", - "jobName": "toki_os", + "jenkinsUrl": "https://jenkins.example.com/", + "buildUrl": "https://jenkins.example.com/job/sample_job/54/", + "jobUrl": "https://jenkins.example.com/job/sample_job/", + "jobName": "sample_job", "gitCommit": "6087aadcf9f8dbe0d2f024ae32dbcf0f6955d45b", "buildNumber": 54, "buildID": 54, "buildDisplayName": "#54", "gitBranch": "origin/master", - "buildTag": "jenkins-toki_os-54", + "buildTag": "jenkins-sample_job-54", "buildData": buildYaml }; } else if (Platform.isWindows) { map = { "workspace": Directory.current.path, "jenkinsHome": "/var/lib/jenkins", - "jenkinsUrl": "http://toki-labs.com:8083/", - "buildUrl": "http://toki-labs.com:8083/job/toki_system_trading/18/", - "jobUrl": "http://toki-labs.com:8083/job/toki_system_trading/", - "jobName": "toki_system_trading", + "jenkinsUrl": "https://jenkins.example.com/", + "buildUrl": "https://jenkins.example.com/job/sample_windows_job/18/", + "jobUrl": "https://jenkins.example.com/job/sample_windows_job/", + "jobName": "sample_windows_job", "gitCommit": "abef2bc09c1d82e69ebe897ee079135aac9e797a", "buildNumber": 18, "buildID": 18, "buildDisplayName": "#18", "gitBranch": "origin/master", - "buildTag": "jenkins-toki_system_trading-18", + "buildTag": "jenkins-sample_windows_job-18", "buildData": buildYaml }; } diff --git a/lib/oto/pipeline/pipeline.dart b/lib/oto/pipeline/pipeline.dart index 6b28e26..8ca38a2 100644 --- a/lib/oto/pipeline/pipeline.dart +++ b/lib/oto/pipeline/pipeline.dart @@ -18,6 +18,7 @@ class Pipeline { 'while': () => PipelineWhile(), 'foreach': () => PipelineForeach(), 'wait-until-int': () => PipelineWaitUntil('int'), + 'wait-until-float': () => PipelineWaitUntil('float'), 'wait-until-double': () => PipelineWaitUntil('double'), 'wait-until-string': () => PipelineWaitUntil('string'), 'wait-until-seconds': () => PipelineWaitUntilSeconds(), diff --git a/lib/oto/pipeline/pipeline_condition.dart b/lib/oto/pipeline/pipeline_condition.dart index 22f24fe..9f6f67f 100644 --- a/lib/oto/pipeline/pipeline_condition.dart +++ b/lib/oto/pipeline/pipeline_condition.dart @@ -33,7 +33,13 @@ abstract class PipelineCondition extends PipelineExecutor { : (value is String) ? double.parse(value) as double? : value, - 'string': (value) => (value == 'null' || value == null) ? null : value.toString(), + 'double': (value) => (value == 'null' || value == null) + ? null + : (value is String) + ? double.parse(value) as double? + : value, + 'string': (value) => + (value == 'null' || value == null) ? null : value.toString(), 'bool': (value) => (value == 'null' || value == null) ? null : (value is String) diff --git a/lib/oto/pipeline/pipeline_wait_until.dart b/lib/oto/pipeline/pipeline_wait_until.dart index df75552..8c780b3 100644 --- a/lib/oto/pipeline/pipeline_wait_until.dart +++ b/lib/oto/pipeline/pipeline_wait_until.dart @@ -5,12 +5,12 @@ import 'package:oto/oto/pipeline/pipeline_condition.dart'; import 'package:oto/oto/pipeline/pipeline_exe.dart'; /// Polls every 200ms and blocks until the condition becomes false. -/// Use wait-until-int / wait-until-double / wait-until-string depending on type. +/// Use wait-until-int / wait-until-float / wait-until-double / +/// wait-until-string depending on type. /// /// Example YAML: /// ```yaml -/// - wait-until-bool: "" # waits while true -/// - wait-until-string: " == done" # waits while condition holds +/// - wait-until-string: " != complete" # waits while condition holds /// ``` class PipelineWaitUntil extends PipelineCondition { PipelineWaitUntil(String type) { @@ -28,12 +28,14 @@ class PipelineWaitUntil extends PipelineCondition { Future execute() async { var condition = data.condition!; var result = checkCondition(condition); - await PipelineExecutor.printCondition('Wait-Until', condition, 'Start wait.', result); + await PipelineExecutor.printCondition( + 'Wait-Until', condition, 'Start wait.', result); while (result.result) { await Future.delayed(const Duration(milliseconds: 200)); result = checkCondition(data.condition!); } - await PipelineExecutor.printCondition('Wait-Until', condition, 'Loop escape.', result); + await PipelineExecutor.printCondition( + 'Wait-Until', condition, 'Loop escape.', result); return simpleFuture; } } diff --git a/slack_test.yaml b/slack_test.yaml deleted file mode 100644 index abb9306..0000000 --- a/slack_test.yaml +++ /dev/null @@ -1,56 +0,0 @@ ---- -property: - workspace: . - -pipeline: - id: main - workflow: - - exe: jira - - if: - condition-object: != null - on-true: - - exe: slackUser - - exe: slackChannel - -commands: -- command: Jira - id: jira - param: - id: leedongmyung@lguplus.co.kr - token: ATATT3xFfGF0mklis_51fqVtxqIatXsuUoOsgu6HXdWXh6nTnQOE964iSZnh0QhgUFZejaljlqsZVBA6OlG8hg74lnmyYKPB7M2Et2mAq3TsvvQskT6VwnG4mGXQ1ff-KIhPvfMvGmGzrQ7UeefC5muJusEcmy1nknxZC8CK4OhYQjAc07GnRmg=B6CBDA6F - domain: lgu-cto.atlassian.net - issue: M3-27 - sub-channel: jira-noti - users: - - mail: leedongmyung@lguplus.co.kr - slackID: U05A94D57RS - - mail: sunmikk@lguplus.co.kr - slackID: U03SNLHMMAB - - mail: rlfrmsdh@lguplus.co.kr - slackID: U042W5NCXK5 - - mail: somyoung@lguplus.co.kr - slackID: U03SNLHBZF1 - - mail: bjkim01@lguplus.co.kr - slackID: U03SWKGJFKQ - - mail: ruin8452@lguplus.co.kr - slackID: U05MZ8GJVS7 - - mail: song0258@lguplus.co.kr - slackID: U047RUK30RY - - mail: wiznine@lguplus.co.kr - slackID: U03T3801W3C - - mail: sheon@lguplus.co.kr - slackID: U03T08SMS93 - - mail: dooyeon@lguplus.co.kr - slackID: U03SNLH637Z - return-slack-data: - return-slack-channel: -- command: Slack - id: slackUser - param: - token: xoxb-3923712524596-5927868822833-amGkCRXlwX33LmgVF1dmeMZ5 - property: -- command: Slack - id: slackChannel - param: - token: xoxb-3923712524596-5927868822833-amGkCRXlwX33LmgVF1dmeMZ5 - property: \ No newline at end of file