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 image: node:16
stages:
- build
- test
- publish
- deploy
npm: npm:
stage: build stage: build
artifacts: artifacts:
@ -38,7 +32,6 @@ audit:
- package.json - package.json
paths: paths:
- node_modules - node_modules
- package-lock.json
policy: pull policy: pull
script: script:
- AUDIT=$(npm audit) - AUDIT=$(npm audit)
@ -53,7 +46,7 @@ audit:
- if: $CI_COMMIT_BRANCH - if: $CI_COMMIT_BRANCH
registry: registry:
stage: publish stage: deploy
image: docker image: docker
cache: cache:
- key: $CI_PIPELINE_ID - key: $CI_PIPELINE_ID
@ -70,13 +63,13 @@ registry:
- if: $CI_COMMIT_BRANCH - if: $CI_COMMIT_BRANCH
tag: tag:
stage: publish stage: deploy
image: image:
name: alpine/git name: alpine/git
entrypoint: [ "" ] entrypoint: [ "" ]
cache: [ ] cache: [ ]
before_script: 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: script:
- VERSION=$(cat package.json | grep version | grep -Eo ':.+' | grep -Eo '[[:alnum:]\.\/\-]+') - VERSION=$(cat package.json | grep version | grep -Eo ':.+' | grep -Eo '[[:alnum:]\.\/\-]+')
- git tag -f $VERSION $CI_COMMIT_SHA - git tag -f $VERSION $CI_COMMIT_SHA
@ -84,15 +77,3 @@ tag:
rules: rules:
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
allow_failure: true 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'