-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from p2m2/develop
1.0.0
- Loading branch information
Showing
3 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 / | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |