Skip to content

Instantly share code, notes, and snippets.

@duxor
Created January 20, 2020 18:25
Show Gist options
  • Select an option

  • Save duxor/d48f6726287976d5345cefc7f8c86e13 to your computer and use it in GitHub Desktop.

Select an option

Save duxor/d48f6726287976d5345cefc7f8c86e13 to your computer and use it in GitHub Desktop.
Basic Angular continuous deployment config (GitlabCI)
# startupkin.com basic test config
image: trion/ng-cli-e2e:latest
stages:
- build
- deploy
build_stage:
stage: build
script:
- npm install
- node_modules/.bin/ng lint
- node_modules/.bin/ng build --configuration=stage
# Selenium IDE tests
- npm install -g selenium-side-runner
- npm install -g chromedriver --unsafe-perm=true --allow-root
- selenium-side-runner startupkin.com.side
except:
- production
artifacts:
paths:
- dist/
deploy_to_develop:
stage: deploy
only:
- develop
script:
- which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
- mkdir -p ~/.ssh
- ssh-keyscan -H $HOST_IP >> ~/.ssh/known_hosts
- '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config'
- ssh -o StrictHostKeyChecking=no $SSH_USER@$HOST_IP "rm -rf $PROJECT_DIRECTORY/*"
- scp -r dist/* $SSH_USER@$HOST_IP:$PROJECT_DIRECTORY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment