Skip to content

Instantly share code, notes, and snippets.

@spacemud
Forked from Southclaws/.gitlab-ci.yml
Created January 12, 2019 21:19
Show Gist options
  • Save spacemud/7d35bde15e003ad066364765d33a8d83 to your computer and use it in GitHub Desktop.
Save spacemud/7d35bde15e003ad066364765d33a8d83 to your computer and use it in GitHub Desktop.
sampctl+gitlab=ci/cd πŸŽ‰
build:
image:
name: southclaws/sampctl:latest
entrypoint: [""]
tags: [pawn]
artifacts:
paths:
- gamemodes/barp.amx
cache:
paths:
- /root/.samp
- dependencies/
script:
- pwd && ls -la
- sampctl package ensure
- ls -la dependencies
- sampctl package build
- ls -la gamemodes
# deploy only if on one of the main branches
# - master is the latest public/live/production version
# - staging is the next stable public/live/production version
# - develop is the rolling development release version
deploy-branch:
image: docker:stable
tags: [pawn]
only: [master, staging, develop]
script:
- echo "$DOCKER_PASSWORD" | docker login -u bayarearoleplay --password-stdin
- docker build -t temp .
- docker tag temp "bayarearoleplay/gamemode:$CI_COMMIT_REF_NAME"
- docker push "bayarearoleplay/gamemode:$CI_COMMIT_REF_NAME"
deploy-tag:
image: docker:stable
tags: [pawn]
only: [tags]
script:
- echo "$DOCKER_PASSWORD" | docker login -u bayarearoleplay --password-stdin
- docker build -t temp .
- docker tag temp "bayarearoleplay/gamemode:$CI_COMMIT_REF_NAME"
- docker push "bayarearoleplay/gamemode:$CI_COMMIT_REF_NAME"
version: "3"
networks:
# default network is external for better integration with existing services.
default:
external:
name: gateway
# internal database for service communication
# external communication must use `default` network
databases:
driver: bridge
internal: true
services:
# statup:
# image: hunterlong/statup
# environment:
# VIRTUAL_HOST: localhost
# VIRTUAL_PORT: 8080
# DB_CONN: mysql
# DB_HOST: mysql
# DB_USER: "${MYSQL_USER}"
# DB_PASS: "${MYSQL_PASSWORD}"
# DB_DATABASE: statup
# NAME: Trade Wars Status
# DESCRIPTION: Trade Wars Status
# ports:
# - "9102:8080"
# volumes:
# - "${DATA_DIR}/${COMPOSE_PROJECT_NAME}/statup/app:/app"
# networks:
# - default
# - databases
# depends_on:
# - mysql
# labels:
# - "com.centurylinklabs.watchtower.enable=true"
# - traefik.docker.network=gateway
# - "traefik.frontend.rule=Host:status.ba-rp.net"
# - traefik.frontend.headers.SSLRedirect=true
# - traefik.port=8080
# -
# databases
# -
# mongodb:
# image: "mongo:3.4"
# command:
# - "--storageEngine=${MONGODB_STORAGE_ENGINE}"
# environment:
# MONGO_INITDB_ROOT_USERNAME: "${MONGODB_USER}"
# MONGO_INITDB_ROOT_PASSWORD: "${MONGODB_PASS}"
# MONGO_INITDB_DATABASE: "${MONGODB_NAME}"
# volumes:
# - "${DATA_DIR}/${COMPOSE_PROJECT_NAME}/mongodb:/data/db"
# networks:
# - databases
# labels:
# - traefik.enable=false
# mysql:
# image: mysql:8
# restart: always
# environment:
# MYSQL_ROOT_PASSWORD: "${MYSQL_ROOT_PASSWORD}"
# MYSQL_DATABASE: statup
# MYSQL_USER: "${MYSQL_USER}"
# MYSQL_PASSWORD: "${MYSQL_PASSWORD}"
# volumes:
# - "${DATA_DIR}/${COMPOSE_PROJECT_NAME}/mysql:/var/lib/mysql"
# networks:
# - databases
# labels:
# - traefik.enable=false
# -
# gamemode stack
# -
gamemode:
image: bayarearoleplay/gamemode:master
environment:
DEBUG: "true"
WAREHOUSE_ENDPOINT: "http://warehouse:7788"
WAREHOUSE_AUTH: "${WAREHOUSE_AUTH}"
ports:
- "7777:7777/udp"
networks:
- default
- databases
labels:
- "com.centurylinklabs.watchtower.enable=true"
- traefik.enable=false
# -
# gitlab ci/cd runner
# -
runner:
image: gitlab/gitlab-runner
restart: always
environment:
- CI_SERVER_URL=https://tanuki.southcla.ws/
volumes:
- ${DATA_DIR}/barp/runner:/etc/gitlab-runner
- /var/run/docker.sock:/var/run/docker.sock:rw
networks:
- default
labels:
- com.centurylinklabs.watchtower.enable=true
FROM southclaws/sampctl:latest
ADD . .
RUN sampctl package ensure && \
sampctl package build && \
apt update && apt install -y libuuid1:i386 uuid-dev:i386
ENTRYPOINT [ "sampctl", "package", "run" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment