Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/id1945/angular-gitlab-cicd-nginx
Angular Gitlab CICD, Shell, Bash, Command basic, Deploy Nginx, Linux
https://github.com/id1945/angular-gitlab-cicd-nginx
angular bash cicd command deployment gitlab linux nginx shell
Last synced: 6 days ago
JSON representation
Angular Gitlab CICD, Shell, Bash, Command basic, Deploy Nginx, Linux
- Host: GitHub
- URL: https://github.com/id1945/angular-gitlab-cicd-nginx
- Owner: id1945
- Created: 2022-01-04T08:49:19.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-01-04T09:21:06.000Z (about 3 years ago)
- Last Synced: 2024-11-19T21:34:41.751Z (2 months ago)
- Topics: angular, bash, cicd, command, deployment, gitlab, linux, nginx, shell
- Language: HTML
- Homepage:
- Size: 193 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ஜ۩ Install a runner - Linux ۩ஜ
![Logo](https://raw.githubusercontent.com/id1945/angular-gitlab-cicd-nginx/master/runner-token.png)
![Logo](https://raw.githubusercontent.com/id1945/angular-gitlab-cicd-nginx/master/pieline.png)### .gitlab-ci.yml
```yml
stages: # List of stages for jobs, and their order of execution
- build
- deploybuild-job: # This job runs in the build stage, which runs first.
stage: build
tags:
- angularci
script:
- echo "Compiling the code..."
- npm i
- npm run build
- echo "Compile complete."
artifacts:
expire_in: 1 hour
paths:
- dist
only:
- masterdeploy-job: # This job runs in the deploy stage.
stage: deploy # It only runs when *both* jobs in the test stage complete successfully.
tags:
- angularci
script:
- echo "Deploying application..."
- chmod +x deploy.sh
- bash deploy.sh
#- sudo rm -rf /usr/share/nginx/html/*
#- sudo cp -rv dist/angular-ci/* /usr/share/nginx/html
- echo "Application successfully deployed."
only:
- master
```### ⌛ [1] Download the binary for your system
```bash
sudo curl -L --output /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64
```### ⌛ [2] Give it permissions to execute
```bash
sudo chmod +x /usr/local/bin/gitlab-runner
```### ⌛ [3] Create a GitLab CI user
```bash
sudo useradd --comment 'GitLab Runner' --create-home gitlab-runner --shell /bin/bash
```### ⌛ [4] Install and run as service
```bash
sudo gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner
sudo gitlab-runner start
```### ⌛ [5] Command to register runner
```bash
sudo gitlab-runner register --url https://gitlab.com/ --registration-token $REGISTRATION_TOKEN
```### ⌛ [6] Preparing the "shell" executor
```bash
sudo gitlab-runner run
```## ✍ Setup sudo password
```bash
$ sudo usermod -a -G sudo gitlab-runner
$ sudo visudo
gitlab-runner ALL=(ALL) NOPASSWD: ALL
```