diff --git a/.gitignore b/.gitignore index 3c3629e..ed7e429 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,4 @@ node_modules + +# ai +CLAUDE.md diff --git a/build/ci/Dockerfile b/build/ci/Dockerfile index be56b63..71b70e4 100644 --- a/build/ci/Dockerfile +++ b/build/ci/Dockerfile @@ -26,6 +26,7 @@ RUN npm config set //repositories.mrf.io/nexus/repository/npm-internal/:_authTok RUN npm config set strict-ssl false RUN npm install lerna@3.19.0 -g +RUN npm install -g @anthropic-ai/claude-code RUN lerna bootstrap --hoist FROM node:lts-buster @@ -35,6 +36,8 @@ WORKDIR /app COPY --from=dependencies /root/.npmrc /root/.npmrc COPY --from=dependencies /app/node_modules /app/node_modules COPY --from=dependencies /app/packages /app/packages +COPY --from=dependencies /usr/local/lib/node_modules /usr/local/lib/node_modules +COPY --from=dependencies /usr/local/bin /usr/local/bin COPY . . ENTRYPOINT ["npm"] diff --git a/build/ci/Jenkinsfile b/build/ci/Jenkinsfile index ffd1254..5e4922c 100644 --- a/build/ci/Jenkinsfile +++ b/build/ci/Jenkinsfile @@ -10,6 +10,7 @@ pipeline { environment { NPM_NEXUS_AUTH = credentials('NPM_NEXUS_AUTH') SSH_KEY = credentials('JENKINS_SSH_PRIVATE_KEY') + CLAUDE_TOKEN = credentials('CLAUDE_AUTH_TOKEN') TAG = "marfeel-coding-standards:${env.BUILD_NUMBER}" } @@ -30,29 +31,40 @@ pipeline { sh """docker build -f build/ci/Dockerfile -t $TAG --build-arg NPM_NEXUS_AUTH="$NPM_NEXUS_AUTH" .""" } } - stage('Lint') { - when { - expression { - return env.GIT_BRANCH != "origin/master" - } - } - steps { - sh 'docker run --rm $TAG run lint' - } - } - stage('Publish') { - when { - expression { - return env.GIT_BRANCH == "origin/master" - } - } + // stage('Lint') { + // when { + // expression { + // return env.GIT_BRANCH != "origin/master" + // } + // } + // steps { + // sh 'docker run --rm $TAG run lint' + // } + // } + stage('Claude') { steps { - withCredentials([string(credentialsId: 'NEXUS_BASIC_AUTH_BASE64', variable: 'nexusAuth')]) { - sh """ - docker run --rm --entrypoint /bin/bash $TAG -c 'build/ci/publish ${nexusAuth}' - """ - } + sh """ + docker run --rm \\ + --entrypoint /bin/bash \\ + $TAG \\ + -c 'export CLAUDE_CODE_OAUTH_TOKEN="$CLAUDE_TOKEN" \\ + && claude -p "write relase notes for the changes on this branch compared to master. Be direct and concise avoiding repetition and fostering clear thinking aiming final non-tech users"' + """ } } + // stage('Publish') { + // when { + // expression { + // return env.GIT_BRANCH == "origin/master" + // } + // } + // steps { + // withCredentials([string(credentialsId: 'NEXUS_BASIC_AUTH_BASE64', variable: 'nexusAuth')]) { + // sh """ + // docker run --rm --entrypoint /bin/bash $TAG -c 'build/ci/publish ${nexusAuth}' + // """ + // } + // } + // } } } diff --git a/seh.txt b/seh.txt new file mode 100644 index 0000000..c8b5619 --- /dev/null +++ b/seh.txt @@ -0,0 +1,96 @@ +diff --git a/.gitignore b/.gitignore +index 3c3629e..ed7e429 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -1 +1,4 @@ + node_modules ++ ++# ai ++CLAUDE.md +diff --git a/build/ci/Dockerfile b/build/ci/Dockerfile +index be56b63..320b4d2 100644 +--- a/build/ci/Dockerfile ++++ b/build/ci/Dockerfile +@@ -26,6 +26,7 @@ RUN npm config set //repositories.mrf.io/nexus/repository/npm-internal/:_authTok + RUN npm config set strict-ssl false + + RUN npm install lerna@3.19.0 -g ++RUN npm install -g @anthropic-ai/claude-code + RUN lerna bootstrap --hoist + + FROM node:lts-buster +diff --git a/build/ci/Jenkinsfile b/build/ci/Jenkinsfile +index ffd1254..ca81444 100644 +--- a/build/ci/Jenkinsfile ++++ b/build/ci/Jenkinsfile +@@ -25,34 +25,44 @@ pipeline { + ''' + } + } +- stage('Build') { ++ // stage('Build') { ++ // steps { ++ // sh """docker build -f build/ci/Dockerfile -t $TAG --build-arg NPM_NEXUS_AUTH="$NPM_NEXUS_AUTH" .""" ++ // } ++ // } ++ // stage('Lint') { ++ // when { ++ // expression { ++ // return env.GIT_BRANCH != "origin/master" ++ // } ++ // } ++ // steps { ++ // sh 'docker run --rm $TAG run lint' ++ // } ++ // } ++ stage('Claude') { + steps { +- sh """docker build -f build/ci/Dockerfile -t $TAG --build-arg NPM_NEXUS_AUTH="$NPM_NEXUS_AUTH" .""" +- } +- } +- stage('Lint') { +- when { +- expression { +- return env.GIT_BRANCH != "origin/master" +- } +- } +- steps { +- sh 'docker run --rm $TAG run lint' +- } +- } +- stage('Publish') { +- when { +- expression { +- return env.GIT_BRANCH == "origin/master" +- } +- } +- steps { +- withCredentials([string(credentialsId: 'NEXUS_BASIC_AUTH_BASE64', variable: 'nexusAuth')]) { +- sh """ +- docker run --rm --entrypoint /bin/bash $TAG -c 'build/ci/publish ${nexusAuth}' +- """ +- } ++ sh """ ++ docker run --rm \\ ++ --entrypoint /bin/bash \\ ++ $TAG \\ ++ -c 'echo "$CLAUDE_AUTH_TOKEN" | claude config set token && claude --print "run a git diff master, and give me a little text summary of the changes"' ++ """ + } + } ++ // stage('Publish') { ++ // when { ++ // expression { ++ // return env.GIT_BRANCH == "origin/master" ++ // } ++ // } ++ // steps { ++ // withCredentials([string(credentialsId: 'NEXUS_BASIC_AUTH_BASE64', variable: 'nexusAuth')]) { ++ // sh """ ++ // docker run --rm --entrypoint /bin/bash $TAG -c 'build/ci/publish ${nexusAuth}' ++ // """ ++ // } ++ // } ++ // } + } + }