github.com/gobuffalo/buffalo-cli/v2@v2.0.0-alpha.15.0.20200919213536-a7350c8e6799/cli/internal/plugins/ci/templates/gitlab.yml.tmpl (about)

     1  before_script:
     2  {{- if eq .Database "postgres" }}
     3    - apt-get update && apt-get install -y postgresql-client
     4  {{- else if eq .Database "mysql" }}
     5    - apt-get update && apt-get install -y mysql-client
     6  {{- end }}
     7    - ln -s /builds /go/src/$(echo "{{.Name}}" | cut -d "/" -f1)
     8    - cd /go/src/{{.Name}}
     9    - mkdir -p public/assets
    10    - go get -u github.com/gobuffalo/buffalo/buffalo
    11    - go mod download
    12    - export PATH="$PATH:$GOPATH/bin"
    13  
    14  stages:
    15    - test
    16  
    17  test:
    18    <<: *test-vars
    19    
    20    image: golang:1.14
    21    stage: test
    22    variables:
    23      GO_ENV: "test"
    24  {{- if eq .Database "postgres" }}
    25      POSTGRES_DB: "{{.Name}}_test"
    26  {{- else if eq .Database "mysql" }}
    27      MYSQL_DATABASE: "{{.Name}}_test"
    28      MYSQL_ROOT_PASSWORD: "root"
    29  {{- end }}
    30      TEST_DATABASE_URL: ""
    31    services:
    32  {{- if eq .Database "mysql" }}
    33      - mysql:5
    34  {{- else if eq .Database "postgres" }}
    35      - postgres:latest
    36  {{- end }}
    37    script:
    38      - buffalo test