I want to create a build and deploy pipeline for my next js project basically i want to the steps right now i did manual deployment through commands
The steps for this is
- download updated tar
- remove previous tar
- upload new tar
- untar the tar file
- remove old image from docker
- build new image inside code directory
- stop container
- remove container
- build new container
now everytime i did some change i have to run all these commands again again so i what i want is to build a pipeline for my project so when i merge the code pipeline triggers
I try some code in the gitlab-ci.yml file but it does not work. I am expecting to give me the steps for what i need to setup in the gitlab project repo and what i need to do in docker related things please guide as i am first time creating this
here is the code i am trying
stages:
- build
build-qa:
stage: build
when: manual
variables:
IMAGE_NAME: registry.gitlab.com:5000/sop3/soneriwebnext
tags:
- nextjs
- soneri
- web
script:
- echo $CI_JOB_TOKEN
- echo $IMAGE_NAME
- docker login registry.gitlab.com:5000
- docker build -t $IMAGE_NAME .
- docker push $IMAGE_NAME
only:
- QA