Skip to content

Instantly share code, notes, and snippets.

@hacktivist123
Last active February 16, 2021 11:11
Show Gist options
  • Save hacktivist123/840168caac69fb56a8e7340678ba968e to your computer and use it in GitHub Desktop.
Save hacktivist123/840168caac69fb56a8e7340678ba968e to your computer and use it in GitHub Desktop.
Config file for Gitlab CI
stages:
- build
- deploy
build:
image: node:14
stage: build
script:
- npm install
- npm audit fix
only:
- master
.login:
image: node:14
before_script:
- apt-get update
- apt-get install -y ca-certificates jq
- echo "deb [trusted=yes] https://packages.cloudfoundry.org/debian stable main" > /etc/apt/sources.list.d/cloudfoundry-cli.list
- apt-get update
- apt-get install cf7-cli
- cf --version
- cf api --skip-ssl-validation "$CF_API"
- cf auth "$CF_USERNAME" "$CF_Password"
only:
- master
deploy:
extends: .login
stage: deploy
script:
- cf target -o "foo" -s "gitlab-test"
- ls -la
- echo "Deployment starting....."
- cf push exchange-rate-spa
only:
- master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment