.gitlab-ci.yml 1.16 KB
Newer Older
David's avatar
Argh  
David committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
# build-snuffleupagus:
#   image: alpine:3.10
#   services:
#     - docker:dind
#   variables:
#     DOCKER_HOST: tcp://docker:2375
#     DOCKER_DRIVER: overlay2
#   stage: package
#   script:
#     - apk --no-cache add alpine-sdk coreutils cmake
#     - adduser -G abuild -g "Alpine Package Builder" -s /bin/ash -D builder
#     - echo "builder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
#     - mkdir /packages
#     - chown builder:abuild /packages
#     - su - builder
#     - cd /packages
#     - git clone https://github.com/nbs-system/snuffleupagus
#     - cd snuffleupagus
#     - git checkout v0.5.0
#     - abuild-keygen -a
#     - abuild -r
#   artifacts:
#     paths:
#       - 

David's avatar
David committed
26 27 28 29 30 31 32 33 34 35
build:
  image: docker:stable
  services:
    - docker:dind
  variables:
    DOCKER_HOST: tcp://docker:2375
    DOCKER_DRIVER: overlay2
  stage: build
  script:
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
David's avatar
David committed
36
    - docker pull $CI_REGISTRY_IMAGE:latest || true
David's avatar
David committed
37
    - cd wordpress-container
David's avatar
David committed
38
    - docker build --cache-from $CI_REGISTRY_IMAGE:latest --tag $CI_REGISTRY_IMAGE:$CI_COMMIT_SHA --tag $CI_REGISTRY_IMAGE:latest .
David's avatar
David committed
39
    - docker push $CI_REGISTRY_IMAGE:latest