A Gitlab Runner JSII construct lib for AWS CDK
Project description
Welcome to cdk-gitlab-runner
This repository template helps you create gitlab runner on your aws account via AWS CDK one line.
note
Will help create a vpc ( only public subnet ) , and one T3.large ec2 Runner (change type feature will update soon ...)
Before start your need gitlab runner token in your gitlab project
or gitlab group
In Group
Group > Settings > CI/CD
In Group
Project > Settings > CI/CD > Runners
Usage Replace your gitlab runner roken in $GITLABTOKEN
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
from cdk_gitlab_runner import GitlabContainerRunner
from aws_cdk.aws_ec2 import InstanceType, InstanceClass, InstanceSize
# If want change instance type to t3.large .
GitlabContainerRunner(stack, "testing", gitlabtoken="$GITLABTOKEN", ec2type=InstanceType.of(InstanceClass.T2, InstanceSize.LARGE))
# OR
# Just create a gitlab runner , by default instance type is t3.small .
GitlabContainerRunner(stack, "testing", gitlabtoken="$GITLABTOKEN")
see more instance class and size
Wait about 6 mins , If success you will see your runner in that page .
you can use tag gitlab
, runner
, awscdk
,
Example gitlab-ci.yaml
dockerjob:
image: docker:18.09-dind
variables:
tags:
- runner
- awscdk
- gitlab
variables:
DOCKER_TLS_CERTDIR: ""
before_script:
- docker info
script:
- docker info;
- echo 'test 123';
- echo 'hello world 1228'
If your want to debug your can go to aws console
In your runner region !!!
AWS Systems Manager > Session Manager > Start a session
click your runner
and click start session
in the brower console in put bash
# become to root
sudo -i
# list runner container .
root# docker ps -a
# modify gitlab-runner/config.toml
root# cd /home/ec2-user/.gitlab-runner/ && ls
config.toml
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cdk-gitlab-runner-0.0.8.tar.gz
(595.9 kB
view hashes)
Built Distribution
Close
Hashes for cdk_gitlab_runner-0.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a55099f4d4080a5220a2168be26dcb19c3fa79ada1d8f02da4f713a169c220ac |
|
MD5 | cba4140be80017b643be59879fd8156c |
|
BLAKE2b-256 | 0e0a0e7c74455f1726ab57244d6789a66cf35fec88dcc57b3e48b1bd3ea7d360 |