Merge branch '1-add-docker-build-pipeline' into 'master'
Resolve "Add (docker) build pipeline" Closes #1 See merge request openappstack/admin-frontend!1
This commit is contained in:
commit
42407e1d0f
1 changed files with 40 additions and 0 deletions
40
.gitlab-ci.yml
Normal file
40
.gitlab-ci.yml
Normal file
|
@ -0,0 +1,40 @@
|
|||
stages:
|
||||
- build-project
|
||||
- build-container
|
||||
|
||||
image: node:14-alpine
|
||||
|
||||
variables:
|
||||
KANIKO_BUILD_IMAGENAME: admin-backend
|
||||
|
||||
build-project:
|
||||
stage: build-project
|
||||
before_script: []
|
||||
script:
|
||||
- echo "Building app"
|
||||
- yarn install
|
||||
# - echo "REACT_APP_API_URL=https://oas-api.initdevelopment.com/api/v1" > .env
|
||||
# - echo "EXTEND_ESLINT=true" >> .env
|
||||
- yarn build
|
||||
- mv build web-build
|
||||
- echo "Build successful"
|
||||
artifacts:
|
||||
expire_in: 1 hour
|
||||
name: web-build
|
||||
paths:
|
||||
- web-build
|
||||
|
||||
build-container:
|
||||
stage: build-container
|
||||
image:
|
||||
# We need a shell to provide the registry credentials, so we need to use the
|
||||
# kaniko debug image (https://github.com/GoogleContainerTools/kaniko#debug-image)
|
||||
name: gcr.io/kaniko-project/executor:debug
|
||||
entrypoint: [""]
|
||||
script:
|
||||
- cp deployment/Dockerfile web-build
|
||||
- cp deployment/nginx.conf web-build
|
||||
- cd web-build
|
||||
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
|
||||
- /kaniko/executor --cache=true --context ${CI_PROJECT_DIR}/web-build --destination ${CI_REGISTRY_IMAGE}/${KANIKO_BUILD_IMAGENAME}:${CI_COMMIT_REF_NAME}
|
||||
|
Loading…
Reference in a new issue