Skip to content
This repository has been archived by the owner on Dec 5, 2023. It is now read-only.

Bobiesco #72

Open
wants to merge 17 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
35 changes: 35 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: push go app
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@master
- name: setup go
uses: actions/setup-go@v3
with:
go-version: 1.19
- name: check go version
run: go version
- name: go mod init
run: go mod init github.com/thedevopsschool/user-service
- name: go mod tidy
run: go mod tidy
- name: go build
run: go build -o user-service
# - name: remove go mod init
# run: rm go.mod

- name: Build and Push Docker Image
uses: mr-smithers-excellent/docker-build-push@v4
with:
image: thedevopsschool/user-service
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}


88 changes: 0 additions & 88 deletions .github/workflows/main.yaml

This file was deleted.

20 changes: 9 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
FROM golang:1.7-alpine
ENV sourcesdir /go/src/github.com/microservices-demo/user/
ENV MONGO_HOST mytestdb:27017
ENV HATEAOS user
ENV USER_DATABASE mongodb
From golang:1.19-alpine

COPY . ${sourcesdir}
RUN apk update
RUN apk add git
RUN go get -v github.com/Masterminds/glide && cd ${sourcesdir} && glide install && go install
WORKDIR /app
COPY . /app
RUN whoami

RUN go mod init github.com/thedevopsschool/user-service
RUN go mod tidy
RUN go build .
CMD ["/app/user-service"]

ENTRYPOINT user
EXPOSE 8084
34 changes: 0 additions & 34 deletions docker/user/Dockerfile-release

This file was deleted.

13 changes: 13 additions & 0 deletions doesntexist
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM golang:1.7-alpine
ENV sourcesdir /go/src/github.com/microservices-demo/user/
ENV MONGO_HOST mytestdb:27017
ENV HATEAOS user
ENV USER_DATABASE mongodb

COPY . ${sourcesdir}
RUN apk update
RUN apk add git
RUN go get -v github.com/Masterminds/glide && cd ${sourcesdir} && glide install && go install

ENTRYPOINT user
EXPOSE 8084