Fixed build pipeline

This commit is contained in:
Zakary Timson 2022-09-22 22:14:08 -04:00
parent cec1336258
commit 018a17a445

View File

@ -1,11 +1,5 @@
image: node:16
stages:
- build
- test
- publish
- deploy
npm:
stage: build
artifacts:
@ -38,7 +32,6 @@ audit:
- package.json
paths:
- node_modules
- package-lock.json
policy: pull
script:
- AUDIT=$(npm audit)
@ -53,7 +46,7 @@ audit:
- if: $CI_COMMIT_BRANCH
registry:
stage: publish
stage: deploy
image: docker
cache:
- key: $CI_PIPELINE_ID
@ -70,13 +63,13 @@ registry:
- if: $CI_COMMIT_BRANCH
tag:
stage: publish
stage: deploy
image:
name: alpine/git
entrypoint: [ "" ]
cache: [ ]
before_script:
- git remote set-url origin http://gitlab-ci-token:$DEPLOY_TOKEN@gitlab.zakscode.com/$CI_PROJECT_PATH.git
- git remote set-url origin "https://Tagger:$DEPLOY_TOKEN@$CI_SERVER_HOST/$CI_PROJECT_PATH.git"
script:
- VERSION=$(cat package.json | grep version | grep -Eo ':.+' | grep -Eo '[[:alnum:]\.\/\-]+')
- git tag -f $VERSION $CI_COMMIT_SHA
@ -84,15 +77,3 @@ tag:
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
allow_failure: true
production:
stage: deploy
image: node:16
cache: [ ]
script:
- curl -X POST https://portainer.zakscode.com/api/webhooks/9fcc5dce-a884-4063-8666-34c0acf0aec5
environment:
name: Production
url: https://zakscode.com
rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_DEPLOY_FREEZE == null'