Skip to content
Snippets Groups Projects
Commit c2b0175b authored by s80984's avatar s80984
Browse files

Update build pipeline

parent f43a2b3f
No related branches found
No related tags found
No related merge requests found
Pipeline #14135 failed
...@@ -11,11 +11,26 @@ variables: ...@@ -11,11 +11,26 @@ variables:
k8sVersion: '1.20.5' k8sVersion: '1.20.5'
stages: stages:
- npm
- build - build
- test - test
- deploy - deploy
- release - release
# job_install-npm:
# stage: npm
# script:
# - npm config set registry ${CI_NPM_REGISTRY}
# - npm install
# cache:
# paths:
# - node_modules/
# artifacts:
# expire_in: 1 days
# when: on_success
# paths:
# - node_modules/
job_build-image: job_build-image:
stage: build stage: build
tags: tags:
...@@ -28,17 +43,16 @@ job_build-image: ...@@ -28,17 +43,16 @@ job_build-image:
# - docker info # - docker info
# - docker-compose --version # - docker-compose --version
script: script:
# - docker-compose up #--tag "${CI_REGISTRY_IMAGE}:${CI_PIPELINE_IID}-${CI_COMMIT_SHORT_SHA}" ps - docker-compose up -d --build
# - docker-compose up -d --build
- docker build -t "${CI_REGISTRY_IMAGE}:${CI_PIPELINE_IID}-${CI_COMMIT_SHORT_SHA}"
# # - docker ps # # - docker ps
# # - docker network list # # - docker network list
# # NOTE: push image to local registry so that it can be accessed in subsequent jobs # # NOTE: push image to local registry so that it can be accessed in subsequent jobs
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY} # - docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
- docker push "${CI_REGISTRY_IMAGE}:${CI_PIPELINE_IID}-${CI_COMMIT_SHORT_SHA}" # - docker push "${CI_REGISTRY_IMAGE}:${CI_PIPELINE_IID}-${CI_COMMIT_SHORT_SHA}"
after_script: after_script:
- docker-compose logs || true # - docker-compose logs || true
- docker-compose down || true - docker-compose down || true
# - docker-compose rm --force "${CI_REGISTRY_IMAGE}:${CI_PIPELINE_IID}-${CI_COMMIT_SHORT_SHA}" # - docker-compose rm --force "${CI_REGISTRY_IMAGE}:${CI_PIPELINE_IID}-${CI_COMMIT_SHORT_SHA}"
...@@ -54,10 +68,11 @@ job_test-image: ...@@ -54,10 +68,11 @@ job_test-image:
# NOTE: some random port that hopefully is free on the runner # NOTE: some random port that hopefully is free on the runner
outerPort: '38080' outerPort: '38080'
before_script: before_script:
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY} # - docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY}
- docker pull "${CI_REGISTRY_IMAGE}:${CI_PIPELINE_IID}-${CI_COMMIT_SHORT_SHA}" # - docker pull "${CI_REGISTRY_IMAGE}:${CI_PIPELINE_IID}-${CI_COMMIT_SHORT_SHA}"
script: script:
- docker-compose up - docker-compose up
- npm run test
# - docker run # - docker run
# --detach # --detach
# --publish "${outerPort}:8080" # --publish "${outerPort}:8080"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment