.gitlab-ci.yml 923 Bytes
Newer Older
1 2 3 4 5 6 7 8
image: docker:stable

stages:
  - build

variables:
  MYSQL_DATABASE: homestead
  MYSQL_ROOT_PASSWORD: secret
9
  DB_HOST: mysql
10
  DB_USERNAME: root
11 12 13
  DB_PASSWORD: secret
  DB_DATABASE: homestead
 
14 15 16 17 18 19 20 21 22

build:
  stage: build
  variables:
    DOCKER_DRIVER: overlay2
  allow_failure: true
  services:
    - docker:stable-dind
  script:
23
    - docker login git.gob.cl:4567 -u gitlab-ci-token -p $CI_JOB_TOKEN
24
    - docker build -t git.gob.cl:4567/simple/simple -t git.gob.cl:4567/simple/simple:$CI_COMMIT_REF_NAME .
25
    - docker push git.gob.cl:4567/simple/simple
26
    - docker push git.gob.cl:4567/simple/simple:$CI_COMMIT_REF_NAME
27 28 29 30 31 32 33 34 35 36 37 38

build site:
  stage: build
  image: node:10-stretch
  script:
    - apt-get update
    - apt-get -y install libpng16-16 libpng-tools libpng-dev
    - npm i npm@latest -g
    - npm install
    - npm audit fix --force
    - npm run prod
  artifacts:
39
    expire_in: 30 days
40 41
    paths:
      - public/*