Commit 075ddd95 authored by Marcus Thelin's avatar Marcus Thelin
Browse files

Re-arrangment and added two new dockerfiles

parent c2e8946b
......@@ -5,7 +5,7 @@ before_script:
- export TERM=xterm-256color
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry2.24hr.se
build-content:
build-shell-executor:
stage: build
script:
- make publish
......
VERSION := $(shell cat ./version.txt)
REGISTRY=registry2.24hr.se
SERVICE_NAME=gitlab-runners/node-aws-runner
SERVICE_RELEASE=$(VERSION)
SERVICE_VERSION_LATEST=latest
TAG_NAME=$(SERVICE_NAME):$(SERVICE_RELEASE)
TAG_NAME_LATEST=$(SERVICE_NAME):$(SERVICE_VERSION_LATEST)
build:
@echo "Building version $(REGISTRY)/$(SERVICE_NAME):$(SERVICE_RELEASE)"
docker build --build-arg VERSION="$(VERSION)" --rm=true -t $(TAG_NAME) -f Dockerfile .
docker tag $(TAG_NAME) $(REGISTRY)/$(TAG_NAME)
docker tag $(TAG_NAME) $(REGISTRY)/$(TAG_NAME_LATEST)
@echo ""
@echo "Done building."
@echo ""
publish:
$(MAKE) build
echo "Pushing $(TAG_NAME)"
docker push $(REGISTRY)/$(TAG_NAME)
docker push $(REGISTRY)/$(TAG_NAME_LATEST)
echo "Done."
echo ""
cd docker-executor/runner && $(MAKE) publish
\ No newline at end of file
version: '2.1'
services:
runner:
shell-runner:
image: registry2.24hr.se/gitlab-runners/node-aws-runner:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
- GITLAB_URL=https://gitlab.24hr.se
- GITLAB_RUNNER_TOKEN=${GITLAB_RUNNER_TOKEN}
- GITLAB_RUNNER_DESCRIPTION="24HR Gitlab Shared Runner 004"
docker-runner:
image: registry2.24hr.se/gitlab-runners/node-aws-runner:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock
......
FROM node:16-buster
RUN apt-get update
RUN apt-get install rsync build-essential wget -y
# Install gitlab runner
RUN wget -O /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64
RUN chmod +x /usr/local/bin/gitlab-runner
# Install AWS CLI
RUN apt-get install python3 python3-pip -y
RUN pip3 install awscli --upgrade --user
RUN ln -s ~/.local/bin/aws /usr/local/bin/aws
# Install kubectl
RUN curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl"
RUN chmod +x ./kubectl
RUN mv ./kubectl /usr/bin/kubectl
WORKDIR /app
\ No newline at end of file
VERSION := $(shell cat ./version.txt)
REGISTRY=registry2.24hr.se
SERVICE_NAME=gitlab-runners/node-aws-runner/docker-default-image
SERVICE_RELEASE=$(VERSION)
SERVICE_VERSION_LATEST=latest
TAG_NAME=$(SERVICE_NAME):$(SERVICE_RELEASE)
TAG_NAME_LATEST=$(SERVICE_NAME):$(SERVICE_VERSION_LATEST)
build:
@echo "Building version $(REGISTRY)/$(SERVICE_NAME):$(SERVICE_RELEASE)"
docker build --build-arg VERSION="$(VERSION)" --rm=true -t $(TAG_NAME) -f Dockerfile .
docker tag $(TAG_NAME) $(REGISTRY)/$(TAG_NAME)
docker tag $(TAG_NAME) $(REGISTRY)/$(TAG_NAME_LATEST)
@echo ""
@echo "Done building."
@echo ""
publish:
$(MAKE) build
echo "Pushing $(TAG_NAME)"
docker push $(REGISTRY)/$(TAG_NAME)
docker push $(REGISTRY)/$(TAG_NAME_LATEST)
echo "Done."
echo ""
0.0.1
\ No newline at end of file
FROM gitlab/gitlab-runner:latest
COPY ./start.sh /start.sh
CMD ["./start.sh"]
VERSION := $(shell cat ./version.txt)
REGISTRY=registry2.24hr.se
SERVICE_NAME=gitlab-runners/node-aws-runner/docker
SERVICE_RELEASE=$(VERSION)
SERVICE_VERSION_LATEST=latest
TAG_NAME=$(SERVICE_NAME):$(SERVICE_RELEASE)
TAG_NAME_LATEST=$(SERVICE_NAME):$(SERVICE_VERSION_LATEST)
build:
@echo "Building version $(REGISTRY)/$(SERVICE_NAME):$(SERVICE_RELEASE)"
docker build --build-arg VERSION="$(VERSION)" --rm=true -t $(TAG_NAME) -f Dockerfile .
docker tag $(TAG_NAME) $(REGISTRY)/$(TAG_NAME)
docker tag $(TAG_NAME) $(REGISTRY)/$(TAG_NAME_LATEST)
@echo ""
@echo "Done building."
@echo ""
publish:
$(MAKE) build
echo "Pushing $(TAG_NAME)"
docker push $(REGISTRY)/$(TAG_NAME)
docker push $(REGISTRY)/$(TAG_NAME_LATEST)
echo "Done."
echo ""
#!/bin/bash
#gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner
#gitlab-runner start
gitlab-runner register -n \
--url $GITLAB_URL \
--registration-token $GITLAB_RUNNER_TOKEN \
--executor docker \
--docker-image "registry2.24hr.se/gitlab-runners/node-aws-runner/docker-default-image:${GITLAB_RUNNER_DEFAULT_IMAGE:-latest}"
--description "$GITLAB_RUNNER_DESCRIPTION" \
--locked false
VERSION := $(shell cat ./version.txt)
REGISTRY=registry2.24hr.se
SERVICE_NAME=gitlab-runners/node-aws-runner
SERVICE_RELEASE=$(VERSION)
SERVICE_VERSION_LATEST=latest
TAG_NAME=$(SERVICE_NAME):$(SERVICE_RELEASE)
TAG_NAME_LATEST=$(SERVICE_NAME):$(SERVICE_VERSION_LATEST)
build:
@echo "Building version $(REGISTRY)/$(SERVICE_NAME):$(SERVICE_RELEASE)"
docker build --build-arg VERSION="$(VERSION)" --rm=true -t $(TAG_NAME) -f Dockerfile .
docker tag $(TAG_NAME) $(REGISTRY)/$(TAG_NAME)
docker tag $(TAG_NAME) $(REGISTRY)/$(TAG_NAME_LATEST)
@echo ""
@echo "Done building."
@echo ""
publish:
$(MAKE) build
echo "Pushing $(TAG_NAME)"
docker push $(REGISTRY)/$(TAG_NAME)
docker push $(REGISTRY)/$(TAG_NAME_LATEST)
echo "Done."
echo ""
......@@ -9,5 +9,3 @@ gitlab-runner register -n \
--executor shell \
--description "$GITLAB_RUNNER_DESCRIPTION" \
--locked false
gitlab-runner run
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment