Skip to content

Commit

Permalink
Merge pull request #1 from p2m2/develop
Browse files Browse the repository at this point in the history
1.0.0
  • Loading branch information
ofilangi authored Jul 9, 2021
2 parents 662f438 + b4c40ce commit 377bd7e
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 0 deletions.
75 changes: 75 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#
# ofilangi
#
# DOCKER_CONTEXT is a context global env variable for all application github p2m2 organization
# - DOCKER_USER -> login
# - DOCKER_PASS -> password
# - ORGANIZATION_NAME -> organization register on dockerhub
#
version: 2.1
workflows:
docker-publication-workflow:
jobs:
# only develop is build and push on dockerhub !
- build_branch:
context:
- DOCKER_CONTEXT
filters:
tags:
ignore: /.*/
branches:
only:
- develop

# all tags are build and push on dockerhub !
- build_tag_latest:
context:
- DOCKER_CONTEXT
filters:
tags:
only: /.*/
branches:
# nothing coming from branch are deployed as latest
ignore: /.*/

executors:
docker-publisher:
docker:
- image: circleci/buildpack-deps:stretch
auth:
username: ${DOCKER_USER}
password: ${DOCKER_PASS}

jobs:
build_branch:
executor: docker-publisher
steps:
- checkout
- setup_remote_docker
- run:
name: Publish Docker Image to Docker Hub
# publication of <application>:<application_branch>
command: |
IMAGE_NAME=${CIRCLE_PROJECT_REPONAME}:${CIRCLE_BRANCH}
docker build -t ${ORGANIZATION_NAME}/${IMAGE_NAME} .
echo ${DOCKER_PASS} | docker login -u ${DOCKER_USER} --password-stdin
docker push ${ORGANIZATION_NAME}/${IMAGE_NAME}
build_tag_latest:
executor: docker-publisher
steps:
- checkout
- setup_remote_docker
- run:
name: Publish Docker Tag to Docker Hub
# publication of <application>:<application_tag>
command: |
IMAGE_NAME=${CIRCLE_PROJECT_REPONAME}:${CIRCLE_TAG}
IMAGE_NAME_LATEST=${CIRCLE_PROJECT_REPONAME}:latest
docker build -t ${ORGANIZATION_NAME}/${IMAGE_NAME} .
docker build -t ${ORGANIZATION_NAME}/${IMAGE_NAME_LATEST} .
echo ${DOCKER_PASS} | docker login -u ${DOCKER_USER} --password-stdin
docker push ${ORGANIZATION_NAME}/${IMAGE_NAME}
docker push ${ORGANIZATION_NAME}/${IMAGE_NAME_LATEST}
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM adoptopenjdk:latest

RUN apt-get update && apt-get install -y gnupg

RUN echo "deb https://repo.scala-sbt.org/scalasbt/debian all main" | tee /etc/apt/sources.list.d/sbt.list
RUN echo "deb https://repo.scala-sbt.org/scalasbt/debian /" | tee /etc/apt/sources.list.d/sbt_old.list
RUN curl -sL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x2EE0EA64E40A89B84B2DF73499E82A75642AC823" | apt-key add

RUN apt-get update && apt-get install -y sbt

WORKDIR /workdir
RUN sbt --verbose --version
WORKDIR /



4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# image-scala-sbt
Docker image scala-sbt

```Dockerfile
FROM inraep2m2/image-scala-sbt:latest
```

0 comments on commit 377bd7e

Please sign in to comment.