Skip to content

Instantly share code, notes, and snippets.

@tuanpembual
Created October 20, 2022 08:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tuanpembual/972a76f81516fe4d904a58b434b6d992 to your computer and use it in GitHub Desktop.
Save tuanpembual/972a76f81516fe4d904a58b434b6d992 to your computer and use it in GitHub Desktop.

Estu Fardani | @tuanpembual kulikabel | kubernetes di gcp pake terraform

  • docker

  • linux

  • gitlab-ci

  • jira - trello

  • remote | wfa

Kode

  • bahasa java, golang, rails, python.

  • gitserver | gitlab | git workflow

  • branch -- master, main ---> staging

  • tags: x.y.z -- production x mayor y minor z bugfix, hotfix

development

feature/fe-124

  • koding dengan menangis
  • koding sampe kebawa mimpi
  • kodieg sampe tipes MR ke main/master
  • CI/CD MERGED
  • deploy to staging Bikin tags dari last commit di master(after merged)
  • kasih keterangan | CHANGELOG.md | release noted
  • deploy to production

========================================================== fe, nuxjs

  • npm run | run as developers
  • npm run build + .env nginx + index.html dalam folder build deploy
  • samain isi folder build
  • reload nginx

be, rails 7, ruby 3.1.2

  • rails -s | run as developers
  • puma + port | vm
  • nginx + reverse proxy deploy
  • stop puma
  • samakan isi folder, git pull
  • db migrate
  • start puma

cara pasang di server

CICD daftar pekerjaan fe

  • npm run install
  • npm run build
  • simpan folder build
  • kirim folder ke server | rsync build user@server:/var/www/html
  • reload nginx

daftar pekerjaan be

  • pull repo
  • bundle install
  • bundle exec rake db:migrate

.gitlab-ci.yml

stages:
  - build
  - deploy

build:
  stage: build
  image: node:18
  tags:
    - docker
  script:
    - npm run install
    - npm run build

deploy:
  stage: deploy
  image: ubuntu:22.04
  tags:
    - docker
  script:
    - rsync build user@server:/var/www/html
    - ssh -o StrictHostKeyChecking=no $STAGING_USERNAME@$STAGING_HOST "sudo systemctl reload nginx"
stages:
  - build
  - deploy

build:
  stage: build
  image: ruby:3.1.2
  tags:
    - docker
  script:
    - bundle install

deploy:
  stage: deploy
  image: ubuntu:22.04
  tags:
    - docker
  script:
    - ssh -o StrictHostKeyChecking=no $STAGING_USERNAME@$STAGING_HOST "bundle install && RAILS_ENV=prod bundle exec rake db:migrate && sudo systemctl start apps"
stages:
  - build

build:
  stage: build
  image: jangrewe/gitlab-ci-android:32
  tags:
    - docker
  script:
    - ./gradle build --max-workers=6 --stacktrace -Dorg.gradle.jvmargs="-Xmx5g -XX:MaxPermSize=1g"
    - kirim apk ke discord
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment