I have a node.js on gitlab repo and I am trying to push it into AWS EC2 Ubntu server using CI pipeline.
I am trying to implement a CI pipeline between my gitlab repo and the EC2 instance in a way that every time I push a new code the pipeline gets triggered and the code goes to EC2 server automatically.
I have added environment with name and the url to yaml file. (the url is the AWS server address with git installed on it)
My current .gitlab-ci.yml file looks like below:
image: node:6.10.3
stages:
- ver
- init
- tests
- deploy
ver:
stage: ver
script:
- node --version
- whoami
init:
stage: init
script:
- npm cache clean
- rm -rf node-modules
- npm install
run_tests:
stage: tests
before_script:
- chmod 0777 ./node_modules/.bin/_mocha
script:
- npm test
deploy_staging:
stage: deploy
script:
- echo "Going to deploy to staging server"
environment:
name: staging
url: http://EC2DNS_Address.amazonaws.com/test/ci-test
only:
- master
when I commit a new changes I can see the pipeline gets triggers but I don't see any changes applied to the server.
How can I push these changes into my ubuntu server? do I need something more than the environment tag?