.gitlab-ci.yml 654 Bytes
Newer Older
David Blyth's avatar
David Blyth committed
1
before_script:
2 3 4 5
    - docker info

stages:
    - build
David Blyth's avatar
David Blyth committed
6
    - deploy
7
    - build_cleanup
David Blyth's avatar
David Blyth committed
8

David Blyth's avatar
David Blyth committed
9
build_test:
10 11
    stage: build
    script:
David Blyth's avatar
David Blyth committed
12
        - docker build -t argonneeic/base:$CI_COMMIT_REF_SLUG --build-arg BUILD_THREADS=20 .
13 14
    except:
        - master
David Blyth's avatar
David Blyth committed
15

David Blyth's avatar
David Blyth committed
16
build_latest:
17 18 19 20 21 22
    stage: build
    script:
        - docker build -t argonneeic/base --build-arg BUILD_THREADS=20 .
    only:
        - master

David Blyth's avatar
David Blyth committed
23 24 25 26 27 28 29 30
docker_hub_push:
    stage: deploy
    script:
        - bash deploy.sh
    only:
        - master

cleanup_docker_containers:
31 32 33 34
    stage: build_cleanup
    script:
        - docker rm $(docker ps -qa --no-trunc --filter "status=exited")
    when: on_failure