본문 바로가기
[AWS]/GITLAB

52. 빌드 단계: Gitlab CI로 Java 애플리케이션 빌드

by SAMSUNG CLOUD-OKY 2022. 2. 22.
반응형

 

## IntelliJ 에서 .gitlab-ci.yml 생성 후, 빌드 -> Jar 파일 생성

 

 

 

 

 

 

 

## .gitlab-ci.yml

stages:
  - build

build:
  stage: build
  image: openjdk:12-alpine
  script:
    - ./gradlew build
  artifacts:
    paths:
      - ./build/libs/

 

 

 

=====================================================

 

Now that we know which command is responsible for building this type of project, it's not time to start

building the catalepsy pipeline.

So what I'm going to do is to create the catalepsy file.

I'm going to add this to get as well, because you wanted to be part of the repository, so the first

step is to define the stages.

Now, at this point, we only have to build stage, but after that, we're going to add more stages.

So it's a good idea to start with that.

Now, let's define the job and I'm going to simply call him build.

And this will be part of the build stage.

Next, because this is a double project, I wouldn't need a darker image that has to be installed and

I'm going to use the open JDK Alpine version 12 image.

And going to the main aspect of this bill step is to script, the commission will be exactly the same

as we had locally.

So we will be the Gradle Cradle rapper.

Hang on, a run to build Clement.

I you want to specify the artifacts so that this bill job will save the artifact after completion.

So not as that as I'm typing, intelligence knows that this is a Clepsydra file and already suggests

what I need to put in, and this makes it from this point of view, a better editor, it's much easier

to work with additionally helps you make less errors, especially if you're right.

In the beginning, the bulk of it will be inside build.

Lipps.

As I remember locally, we had the exact same path and build Lipps.

So this is all we need in order to build a project, let's committees and see how it looks and get the.

If you haven't managed to follow along, it is absolutely the same process if you're using the get lap

web interface in order to create this configuration file, you do not need anything else.

So if we wait a minute for the jump to complete, you'll see that everything has been executed successfully

to build successful artifacts were uploaded.

And if we go here on the right side and the job artifacts will be able to browse them and you will see

the path to default will build Lib's.

Inside, you'll find a cast API zha.

 

 

 

 

반응형

댓글