From 606e9be03da097d0cd7da35d453f58328cf532eb Mon Sep 17 00:00:00 2001 From: Eric Date: Sat, 10 Dec 2022 10:37:45 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20modification=20Jenkinsfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jenkins => Jenkinsfile | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) rename Jenkins => Jenkinsfile (59%) diff --git a/Jenkins b/Jenkinsfile similarity index 59% rename from Jenkins rename to Jenkinsfile index 1ad0dfd..09123e7 100644 --- a/Jenkins +++ b/Jenkinsfile @@ -1,41 +1,41 @@ -rm -rf $WORKSPACE/my-nextjs-project -git clone git@gitlab.com:me/my-nextjs-project.git $WORKSPACE/my-nextjs-project +rm -rf $WORKSPACE/the_tip_top +git clone git@172.17.0.3:cedric/The_Tip_Top.git $WORKSPACE/the_tip_top -cd $WORKSPACE/my-nextjs-project +cd $WORKSPACE/the_tip_top git checkout master yarn install yarn build -mkdir my-nextjs-project +mkdir the_tip_top -mv public/ my-nextjs-project/ +mv public/ the_tip_top/ NEXT_BUILD_ID=$(cat build/BUILD_ID) LAST_COMMIT=$(git rev-parse HEAD) # That's just for debugging purposes -echo "{git: ${LAST_COMMIT}, ci: ${BUILD_ID}, next: ${NEXT_BUILD_ID}}" > my-nextjs-project/CI +echo "{git: ${LAST_COMMIT}, ci: ${BUILD_ID}, next: ${NEXT_BUILD_ID}}" > the_tip_top/CI # trim package.json and leave only things that you need in production -cat package.json | jq '. | {name: .name, private: true, version: .version, scripts: {start: .scripts.start}, dependencies: .dependencies}' > my-nextjs-project/package.json +cat package.json | jq '. | {name: .name, private: true, version: .version, scripts: {start: .scripts.start}, dependencies: .dependencies}' > the_tip_top/package.json # I'm using next-compose-plugins, so here we need to dump config. If you have next.config.js as an object then just copy config file NEXT_CONFIG=$(node -e 'var configFile = require("./next.config.js"); var config = configFile([], {}); delete config.webpack; console.log(JSON.stringify(config));') -echo "module.exports = ${NEXT_CONFIG}" > my-nextjs-project/next.config.js # result => {distDir: "build", poweredByHeader: false} +echo "module.exports = ${NEXT_CONFIG}" > the_tip_top/next.config.js # result => {distDir: "build", poweredByHeader: false} -mv build my-nextjs-project/ +mv build the_tip_top/ -cd my-nextjs-project +cd the_tip_top yarn install -cd $WORKSPACE/my-nextjs-project +cd $WORKSPACE/the_tip_top # dump folder tree structure just for Jenkins console output logs tree -h -L 1 build/ -tar czf $WORKSPACE/my-nextjs-project.tar.gz my-nextjs-project +tar czf $WORKSPACE/the_tip_top.tar.gz the_tip_top cd $WORKSPACE -rm -rf $WORKSPACE/my-nextjs-project \ No newline at end of file +rm -rf $WORKSPACE/the_tip_top \ No newline at end of file