Commit f4f33a33 authored by Camilo Tapia's avatar Camilo Tapia
Browse files

Initial commit

parents
Pipeline #6235 failed with stages
in 0 seconds
FROM node:10.15
RUN apt-get update
RUN apt-get install 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
RUN curl -sSL https://get.docker.com/ | sh
WORKDIR /app
COPY ./start.sh /app/start.sh
CMD ["./start.sh"]
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 ""
version: '2.1'
services:
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"
#!/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 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