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

Feature/publish docker on tag #2485

Merged
merged 2 commits into from
Nov 19, 2019
Merged
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
4 changes: 3 additions & 1 deletion .drone.starlark
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,9 @@ def buildDockerImage():
'DOCKER_HOST': 'tcp://docker:2375'
},
'commands': [
'docker build -t owncloud/phoenix:${DRONE_COMMIT_SHA}-${DRONE_BUILD_NUMBER} .'
'docker build -t owncloud/phoenix:${DRONE_COMMIT_SHA}-${DRONE_BUILD_NUMBER} .',
'docker tag owncloud/phoenix:${DRONE_COMMIT_SHA}-${DRONE_BUILD_NUMBER} owncloud/phoenix:latest',
'docker push owncloud/phoenix:latest'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to add docker tag owncloud/phoenix:${DRONE_COMMIT_SHA}-${DRONE_BUILD_NUMBER} owncloud/phoenix:latest

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

],
'when': {
'event': [
Expand Down
2 changes: 2 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4963,6 +4963,8 @@ steps:
image: toolhippie/docker:latest
commands:
- docker build -t owncloud/phoenix:${DRONE_COMMIT_SHA}-${DRONE_BUILD_NUMBER} .
- docker tag owncloud/phoenix:${DRONE_COMMIT_SHA}-${DRONE_BUILD_NUMBER} owncloud/phoenix:latest
- docker push owncloud/phoenix:latest
environment:
DOCKER_HOST: tcp://docker:2375
when:
Expand Down
16 changes: 2 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
# build stage
FROM node:10.15.3-alpine as build-stage
RUN apk update && apk upgrade && \
apk add --no-cache bash git
FROM webhippie/nginx:latest

WORKDIR /app
COPY . .
RUN yarn install
RUN yarn dist

# production stage
FROM nginx:1.13.12-alpine as production-stage
COPY --from=build-stage /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
COPY dist /srv/www
5 changes: 4 additions & 1 deletion Makefile.release
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ help:

.PHONY: dist
dist: ## Build distribution
dist: distdir javascript oc-app distconf sign package
dist: distdir javascript oc-app distconf sign package docker-image
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should that be part of the release makefile?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought when doing a release having a docker image being spit out is reasonable ....
... this all needs more automation and then the release makefile can die ...



.PHONY: javascript
Expand Down Expand Up @@ -74,3 +74,6 @@ package:
cp -R $(dist_dir) $(CURDIR)/phoenix
tar -czf $(CURDIR)/release/$(app_name).tar.gz -C $(CURDIR) phoenix

.PHONY: docker-image
docker-image:
docker build .