Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: docker login command #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .semaphore/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ blocks:
- name: Push to dockerhub
commands:
- checkout
- docker login docker.io
- docker login
- make setup
- make build
- make push
Expand Down
19 changes: 19 additions & 0 deletions .semaphore/push_parametrised_versions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
version: v1.0
name: Push to Dockerhub - elixir ${{parameters.ELIXIR_IMAGE_TAG}}
agent:
machine:
type: e1-standard-2
os_image: ubuntu1804
blocks:
- name: Push
task:
jobs:
- name: build and push parametrised versions
commands:
- checkout
- docker login
- make setup
- make build ELIXIR_IMAGE_TAG=$ELIXIR_IMAGE_TAG
- make push ELIXIR_IMAGE_TAG=$ELIXIR_IMAGE_TAG
secrets:
- name: dockerhub-robot
8 changes: 8 additions & 0 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,11 @@ promotions:
pipeline_file: push.yml
auto_promote:
when: branch = 'master' AND result = 'passed'

- name: Push Parametrised versions to Dockerhub
pipeline_file: push_parametrised_versions.yml
parameters:
env_vars:
- required: true
name: ELIXIR_IMAGE_TAG
default_value: 1.13.4-alpine
10 changes: 4 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
FROM elixir:1.13.4-alpine
MAINTAINER Rendered Text <[email protected]>
ARG ELIXIR_IMAGE_TAG=1.13.4-alpine
FROM elixir:$ELIXIR_IMAGE_TAG

ENV MIX_ENV test

RUN apk add --update git && mix local.hex --force

RUN mix archive.install hex bunt 0.2.0 --force
RUN mix archive.install hex bunt --force
RUN mix archive.install hex poison --force
RUN mix archive.install hex credo 1.6.5 --force
RUN mix archive.install hex credo --force

RUN mkdir -p /home/credo
ADD .credo.exs /home/credo/.credo.exs
Expand Down
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
.PHONY: build push

DOCKER_IMAGE_TAG=$(shell git rev-parse --short HEAD)
ELIXIR_IMAGE_TAG?=1.13.4-alpine

build:
docker build -t renderedtext/credo .
docker build -t renderedtext/credo --build-arg ELIXIR_IMAGE_TAG=$(ELIXIR_IMAGE_TAG) .

push:
docker tag renderedtext/credo:latest renderedtext/credo:$(DOCKER_IMAGE_TAG)
docker push renderedtext/credo:$(DOCKER_IMAGE_TAG)
docker push renderedtext/credo:latest
docker tag renderedtext/credo:latest renderedtext/credo:elixir-$(ELIXIR_IMAGE_TAG)
docker push renderedtext/credo:elixir-$(ELIXIR_IMAGE_TAG)

setup:
docker run --privileged --rm tonistiigi/binfmt --install all
docker buildx create --name mybuilder
docker buildx use mybuilder
docker buildx use mybuilder