diff options
author | Gauvain Pocentek <gauvainpocentek@gmail.com> | 2019-06-20 08:07:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-20 08:07:45 +0200 |
commit | 50c53c034b4b8c0b408da47d3347f103e7f32493 (patch) | |
tree | 6f86387c8e90f0e53904613889b4ab7c69365c26 | |
parent | 722a6efb23c6e6b87a7354c1c6ae8e50ae14c709 (diff) | |
parent | 95c9b6dd489fc15c7dfceffca909917f4f3d4312 (diff) | |
download | gitlab-50c53c034b4b8c0b408da47d3347f103e7f32493.tar.gz |
Merge pull request #792 from python-gitlab/chore/enable-gitlab-ci-builds
chore(ci): add automatic GitLab image pushes
-rw-r--r-- | .gitlab-ci.yml | 37 | ||||
-rw-r--r-- | README.rst | 5 | ||||
-rw-r--r-- | tools/Dockerfile-test | 2 | ||||
-rwxr-xr-x | tools/build_test_env.sh | 2 |
4 files changed, 30 insertions, 16 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0421a4f..ae0c09c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,19 +26,19 @@ black_lint: except: - master -#build_test_image: # Currently hangs forever, because of GitLab Runner infrastructure issues -# stage: build-test-image -# image: -# name: gcr.io/kaniko-project/executor:debug -# entrypoint: [""] -# script: -# - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json -# - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/tools/Dockerfile-test --destination $CI_REGISTRY_IMAGE:test -# only: -# refs: -# - master -# changes: -# - tools/ +build_test_image: + stage: build-test-image + image: + name: gcr.io/kaniko-project/executor:debug + entrypoint: [""] + script: + - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json + - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/tools/Dockerfile-test --destination $CI_REGISTRY_IMAGE:test + only: + refs: + - master + changes: + - tools/ .tox_includes: &tox_includes stage: test @@ -103,3 +103,14 @@ deploy: - twine upload --skip-existing -u $TWINE_USERNAME -p $TWINE_PASSWORD dist/* only: - tags + +deploy_image: + stage: deploy + image: + name: gcr.io/kaniko-project/executor:debug + entrypoint: [""] + script: + - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json + - /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG + only: + - tags @@ -55,8 +55,11 @@ How to use ``docker run -it --rm -e GITLAB_PRIVATE_TOKEN=<your token> -v /path/to/python-gitlab.cfg:/python-gitlab.cfg python-gitlab <command> ...`` -To change the GitLab URL, use `-e GITLAB_URL=<your url>` +or run it directly from the upstream image: + +``docker run -it --rm -e GITLAB_PRIVATE_TOKEN=<your token> -v /path/to/python-gitlab.cfg:/python-gitlab.cfg registry.gitlab.com/python-gitlab/python-gitlab:v1.8.0 <command> ...`` +To change the GitLab URL, use `-e GITLAB_URL=<your url>` Bring your own config file: ``docker run -it --rm -v /path/to/python-gitlab.cfg:/python-gitlab.cfg -e GITLAB_CFG=/python-gitlab.cfg python-gitlab <command> ...`` diff --git a/tools/Dockerfile-test b/tools/Dockerfile-test index 7d491de..68ef467 100644 --- a/tools/Dockerfile-test +++ b/tools/Dockerfile-test @@ -11,7 +11,7 @@ RUN apt-get update \ tzdata \ && curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ce/script.deb.sh | bash \ && apt-get install -qy --no-install-recommends \ - gitlab-ce=11.10.0-ce.0 + gitlab-ce=11.11.2-ce.0 # Manage SSHD through runit RUN mkdir -p /opt/gitlab/sv/sshd/supervise \ diff --git a/tools/build_test_env.sh b/tools/build_test_env.sh index 3185f72..624f879 100755 --- a/tools/build_test_env.sh +++ b/tools/build_test_env.sh @@ -77,7 +77,7 @@ cleanup() { } try docker run --name gitlab-test --detach --publish 8080:80 \ - --publish 2222:22 pythongitlab/test-python-gitlab:latest >/dev/null + --publish 2222:22 registry.gitlab.com/python-gitlab/python-gitlab:test >/dev/null LOGIN='root' PASSWORD='5iveL!fe' |