๐ŸŒCoding/๐ŸŒŸWEB 9

[SpringBoot] LocalDate : Month์™€ ์ผ์น˜ํ•˜๋Š” ๊ฐ’ ์ฐพ๊ธฐ

๐Ÿ’ก๊ตฌํ•˜๋ ค๋Š” ๋‹ฌ์˜ ์ฒซ๋‚ ๊ณผ ๋งˆ์ง€๋ง‰ ๋‚  ๊ตฌํ•˜๊ธฐLocalDate start=date.withDayOfMonth(1);LocalDate end=date.withDayOfMonth(date.lengthOfMonth());List lists=๋ฆฌํฌ์ง€ํ† ๋ฆฌ.findBy์ปฌ๋Ÿผ๋ช…Between(start, end); ๐Ÿ’กRepositoryList findBy์ปฌ๋Ÿผ๋ช…Between(LocalDate start, LocalDate end);

[Jenkins] Jenkins ์„ค์น˜

๐Ÿ’กAWS์— Jenkins ์„ค์น˜ aws์— docker ์„ค์น˜ํ•˜๊ธฐ ์œ„ํ•ด ๋จผ์ € docker ๋กœ๊ทธ์ธ์„ ํ•ด์ค๋‹ˆ๋‹ค. sudo docker login ๋„์ปค๋กœ jenkins๋ฅผ ์„ค์น˜ํ•ฉ๋‹ˆ๋‹ค. sudo docker pull jenkins/jenkins:jdk11 jenkins๋ฅผ ์‹คํ–‰ํ•  ๋•Œ ๋„์ปค์˜ ์†Œ์ผ“ ํŒŒ์ผ์„ ๋งˆ์šดํŠธ ํ•ด์ค๋‹ˆ๋‹ค. sudo docker run -d -p [ํฌํŠธ ๋ฒˆํ˜ธ]:8080 -v /jenkins:/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock --name jenkins -u root jenkins/jenkins:jdk11 https://[๋„๋ฉ”์ธ]:[ํฌํŠธ๋ฒˆํ˜ธ]๋กœ ์ ‘์†ํ•˜๋ฉด ์  ํ‚จ์Šค์— ์—ฐ๊ฒฐ๋œ ๊ฒƒ์„ ํ™•์ธํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

[Jenkins] Jenkins๋ž€?

๐Ÿ’ก Jenkins๋ž€? ์†Œํ”„ํŠธ์›จ์–ด ๊ฐœ๋ฐœ ์‹œ ์ง€์†์  ํ†ตํ•ฉ ์„œ๋น„์Šค๋ฅผ ์ œ๊ณตํ•˜๋Š” ํˆด์ด๋‹ค. ์ง€์†์ ์ธ ํ†ตํ•ฉ(CI)๊ณผ ์ง€์†์ ์ธ ๋ฐฐํฌ(CD) ํ™˜๊ฒฝ์„ ๊ตฌ์ถ•ํ•˜๊ธฐ ์œ„ํ•œ ๋„๊ตฌ์ด๋‹ค. ๐Ÿ’ก CI/CD๋ž€? ์ง€์†์ ์ธ ํ†ตํ•ฉ(CI) : ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์˜ ์†Œ์Šค ๋ณ€๊ฒฝ ์‚ฌํ•ญ์ด ์ •๊ธฐ์ ์œผ๋กœ ๋นŒ๋“œ ๋ฐ ํ…Œ์ŠคํŠธ๋˜์–ด ๊ณต์œ  ๋ ˆํฌ์ง€ํ† ๋ฆฌ์— ํ†ตํ•ฉํ•˜๋Š” ๊ฒƒ์ด๋‹ค. ์ง€์†์ ์ธ ๋ฐฐํฌ(CD) : ๊ณต์œ  ๋ ˆํฌ์ง€ํ† ๋ฆฌ๋กœ ์ž๋™์œผ๋กœ Release ํ•˜๋Š” ๊ฒƒ์„ ์˜๋ฏธํ•˜๋ฉฐ, ์ง€์†์ ์ธ ์„œ๋น„์Šค๋ฅผ ์ œ๊ณตํ•œ๋‹ค. : Production ๋ ˆ๋ฒ ๋ž˜๊นŒ์ง€ ์ž๋™์œผ๋กœ deploy ํ•˜๋Š” ๊ฒƒ์„ ์˜๋ฏธํ•˜๋ฉฐ ๊ณ ๊ฐ์—๊ฒŒ ๋ฐฐํฌํ•˜๋Š” ๊ฒƒ์ด๋‹ค. => ์ด ๊ณผ์ •์„ ์ž๋™ํ™”ํ•˜๋„๋ก ๋„์™€์ฃผ๋Š” ๊ฒƒ์ด Jenkins!

[Docker] Docker ์ด๋ฏธ์ง€

๐Ÿ’ก Dockerfile JAVA Dockerfile ์˜ˆ์‹œ FROM openjdk:11-jdk ARG JAR_FILE=build/libs/*.jar COPY ${JAR_FILE} app.jar EXPOSE 8080 ENTRYPOINT ["java", "-jar", "/app.jar"] ๐Ÿ’ก Docker Imgae ๋„์ปค ์ด๋ฏธ์ง€ ๋งŒ๋“ค๊ธฐ docker build -f Dockerfile -t [user name]/[repository]:[tag] . ๋„์ปค ๋กœ๊ทธ์ธ docker login ๋„์ปค ํ—ˆ๋ธŒ์— ์ด๋ฏธ์ง€ ์˜ฌ๋ฆฌ๊ธฐ docker push [user name]/[repository]:[tag] ๐Ÿ’ก Docker Image ์‹คํ–‰ docker run -p 8080:8080 [user name]/[repository]:[tag]

[Docker] Docker๋ž€?

๐Ÿ’ก Docker๋ž€? ๋ฆฌ๋ˆ…์Šค์˜ ์‘์šฉ ํ”„๋กœ๊ทธ๋žจ๋“ค์„ ํ”„๋กœ์„ธ์Šค ๊ฒฉ๋ฆฌ ๊ธฐ์ˆ ๋“ค์„ ์‚ฌ์šฉํ•ด ์ปจํ…Œ์ด๋„ˆ๋กœ ์‹คํ–‰ํ•˜๊ณ  ๊ด€๋ฆฌํ•˜๋Š” ์˜คํ”ˆ ์†Œ์Šค ํ”„๋กœ์ ํŠธ์ด๋‹ค. ๐Ÿ’ก Docker๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ์ด์œ ? ๋ฐฐํฌ, ์šด์˜์„ ํšจ๊ณผ์ ์œผ๋กœ ๋„์™€์ค€๋‹ค '์ปจํ…Œ์ด๋„ˆ'์— '์ด๋ฏธ์ง€'๋ฅผ ๋‹ด์•„์„œ ๊ตฌ๋™์‹œํ‚ค๋Š” ๋ฐฉ์‹์ด๋‹ค. ์ด๋ฏธ์ง€๋ฅผ ํ™œ์šฉํ•˜์—ฌ ํ†ต์ผ๋œ ํ™˜๊ฒฝ์œผ๋กœ ๋ฐฐํฌ ๊ฐ€๋Šฅํ•˜๋„๋ก ๋„์™€์ค€๋‹ค. => Docker๋Š” ๋ฆฌ๋ˆ…์Šค ์ปจํ…Œ์ด๋„ˆ ๊ธฐ์ˆ ์„ ๊ธฐ๋ฐ˜์œผ๋กœ ํ•ด์„œ ๋งŒ๋“ค์–ด์ง„ ๋ฐฐํฌ ๋„๊ตฌ์ด๋‹ค.