Commit 8a8977a7 authored by cnguyen2's avatar cnguyen2
Browse files

Add .gitlab-ci.yml

parent 874dcc33
Pipeline #155381 passed with stages
in 11 minutes and 38 seconds
image: maven:3.6.3-openjdk-11-slim
variables:
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
cache:
paths:
- .m2/repository
stages:
- build_native
- build_docker
build_native:
stage: build_native
script:
- apt-get update -qq && apt-get install -y -qq build-essential libz-dev zlib1g-dev
- curl -L https://github.com/graalvm/graalvm-ce-builds/releases/download/vm-20.2.0/graalvm-ce-java11-linux-amd64-20.2.0.tar.gz > graalvm-ce-java11-linux-amd64-20.2.0.tar.gz
- tar -zxf graalvm-ce-java11-linux-amd64-20.2.0.tar.gz -C ${CI_PROJECT_DIR}/
- ${CI_PROJECT_DIR}/graalvm-ce-java11-20.2.0/bin/gu install native-image
- export GRAALVM_HOME=${CI_PROJECT_DIR}/graalvm-ce-java11-20.2.0
- mvn clean package -Pnative
only:
- master
- tags
artifacts:
paths:
- ${CI_PROJECT_DIR}/target/*-runner
build_docker:
stage: build_docker
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/src/main/docker/Dockerfile.native --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
only:
- tags
mvnw 100644 → 100755
File mode changed from 100644 to 100755
......@@ -23,8 +23,12 @@ RUN chmod 775 /work /work/application \
&& chown -R 1001 /work \
&& chmod -R "g+rwX" /work \
&& chown -R 1001:root /work
# Comment because of Kaniko's error
# COPY --chown=1001:root target/*-runner /work/application
COPY target/*-runner /work/application
RUN chown 1001:root /work/application
EXPOSE 8080
USER 1001
CMD ["./application", "-Dquarkus.http.host=0.0.0.0"]
\ No newline at end of file
CMD ["./application", "-Dquarkus.http.host=0.0.0.0"]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment