36 Commits

Author SHA1 Message Date
CrazyMax
6d4c483aa5 JetBrains License Server 20267 2019-07-19 11:46:30 +02:00
CrazyMax
2916fa7f0b Add FUNDING 2019-06-23 22:37:09 +02:00
CrazyMax
5fafea24ad Remove MicroBadger 2019-05-01 17:40:23 +02:00
CrazyMax
f514d57a24 GitHub bug report tpl 2019-04-28 20:05:10 +02:00
CrazyMax
6bdad5262c TravisCI notif 2019-04-28 20:04:57 +02:00
CrazyMax
63f898255f Update CHANGELOG 2019-04-02 21:08:10 +02:00
CrazyMax
894524f1dd Merge pull request #16 from crazy-max/19488
JetBrains License Server 19488
2019-04-02 21:05:17 +02:00
CrazyMax
b75cc3adf5 JetBrains License Server 19488 2019-04-02 21:03:57 +02:00
CrazyMax
0add8fa593 Linguist 2019-03-20 00:16:35 +01:00
Joseph Petersen
f5a5f6fd7e Upgrade to JetBrains License Server 19340 (#15) 2019-03-15 19:10:44 +01:00
CrazyMax
9f98240b42 Switch to Travis CI (com) 2019-02-04 21:55:51 +01:00
CrazyMax
04f8c23aad Bind to unprivileged port : 8000 2019-01-22 19:49:15 +01:00
CrazyMax
9789c073b4 Fix vcs ref 2019-01-22 19:48:30 +01:00
CrazyMax
75d3a4974a New year 2019-01-08 21:51:11 +01:00
CrazyMax
f8638dfeef Update build script 2019-01-08 21:51:11 +01:00
CrazyMax
72d583858d Update build script 2019-01-08 21:51:07 +01:00
CrazyMax
e3bacc0eae Merge pull request #10 from casz/master
Upgrade to JetBrains License Server 18692
2018-12-25 11:16:43 +00:00
Joseph Petersen
cd4f386e11 Upgrade to JetBrains License Server 18692 2018-12-25 09:35:20 +01:00
CrazyMax
0dcb334e40 Typo 2018-12-03 04:47:48 +01:00
CrazyMax
f719222449 Chmod build script 2018-12-03 04:47:10 +01:00
CrazyMax
216258c4d1 Review build script 2018-12-03 04:46:49 +01:00
CrazyMax
8883354cfc Optimize layers
Coding style
2018-12-03 04:46:31 +01:00
CrazyMax
09dfb38e2c Update travis 2018-11-25 20:46:46 +01:00
CrazyMax
a24a1d4ecc Codacy 2018-11-18 04:03:54 +01:00
CrazyMax
0821935fea Update travis 2018-09-27 21:27:05 +02:00
CrazyMax
91cb09fbf8 Upgrade to JetBrains License Server 17955 2018-09-26 15:48:49 +02:00
CrazyMax
a8406d7692 Update CHANGELOG 2018-09-05 16:48:04 +02:00
CrazyMax
d2cb392713 Upgrade to JetBrains License Server 17768 2018-09-05 16:45:22 +02:00
CrazyMax
26ab7144ac Spelling 2018-09-01 18:56:41 +02:00
CrazyMax
c626cd1693 Random token 2018-09-01 18:56:33 +02:00
CrazyMax
2f35822bed Formatting travis 2018-09-01 18:56:19 +02:00
CrazyMax
8f52ba7c7b Dockerfile maintainer deprecated 2018-09-01 18:50:20 +02:00
CrazyMax
8c65605ef4 Bump 2018-07-30 16:18:20 +02:00
CrazyMax
ac739e60cf Upgrade to JetBrains License Server 17437 2018-07-30 16:17:47 +02:00
CrazyMax
9752d4b930 Move files 2018-06-29 16:57:39 +02:00
CrazyMax
82d6205bbc Force ACME HTTP challenge since Traefik 1.6 2018-06-29 16:54:35 +02:00
16 changed files with 345 additions and 137 deletions

14
.dockerignore Normal file
View File

@@ -0,0 +1,14 @@
/.dev
/.idea
/*.iml
/.git
/.res
/examples
/.editorconfig
/.gitignore
/.travis.yml
/build.sh
/CHANGELOG.md
/LICENSE
/README.md

View File

@@ -3,14 +3,11 @@ root = true
[*]
indent_style = space
indent_size = 4
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[{Dockerfile,*.sh,*.yml}]
indent_size = 2
[*.md]
trim_trailing_whitespace = false

1
.gitattributes vendored Normal file
View File

@@ -0,0 +1 @@
/*.sh linguist-detectable=false

1
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1 @@
custom: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3BXL8EBDJALHQ

39
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,39 @@
---
name: Bug report
about: Create a report to help us improve
---
### Behaviour
#### Steps to reproduce this issue
1.
2.
3.
#### Expected behaviour
> Tell me what should happen
#### Actual behaviour
> Tell me what happens instead
### Configuration
* Docker version (type `docker --version`) :
* Docker compose version if applicable (type `docker-compose --version`) :
* Platform (Debian 9, Ubuntu 18.04, ...) :
* Include all necessary configuration files : `docker-compose.yml`, `.env`, ...
### Docker info
```
> Output of command `docker info`
```
### Logs
```
> Container logs (set LOG_LEVEL to debug if applicable)
```

30
.github/SUPPORT.md vendored Normal file
View File

@@ -0,0 +1,30 @@
# Support [![](https://isitmaintained.com/badge/resolution/crazy-max/docker-jetbrains-license-server.svg)](https://isitmaintained.com/project/crazy-max/docker-jetbrains-license-server)
## Reporting an issue
Please do a search in [open issues](https://github.com/crazy-max/docker-jetbrains-license-server/issues?utf8=%E2%9C%93&q=) to see if the issue or feature request has already been filed.
If you find your issue already exists, make relevant comments and add your [reaction](https://github.com/blog/2119-add-reactions-to-pull-requests-issues-and-comments). Use a reaction in place of a "+1" comment.
:+1: - upvote
:-1: - downvote
If you cannot find an existing issue that describes your bug or feature, submit an issue using the guidelines below.
## Writing good bug reports and feature requests
File a single issue per problem and feature request.
* Do not enumerate multiple bugs or feature requests in the same issue.
* Do not add your issue as a comment to an existing issue unless it's for the identical input. Many issues look similar, but have different causes.
The more information you can provide, the more likely someone will be successful reproducing the issue and finding a fix.
You are now ready to [create a new issue](https://github.com/crazy-max/docker-jetbrains-license-server/issues/new/choose)!
## Closure policy
* Support directly related to JetBrains License Server will not be provided if your problem is not related to the operation of this image.
* Issues that don't have the information requested above (when applicable) will be closed immediately and the poster directed to the support guidelines.
* Issues that go a week without a response from original poster are subject to closure at my discretion.

View File

@@ -5,56 +5,25 @@ services:
env:
global:
- VERSION=17211
- GITHUB_REPO=crazy-max/docker-jetbrains-license-server
- VERSION=20267
- DOCKER_LOGIN=crazymax
- DOCKER_USERNAME=crazymax
- DOCKER_REPONAME=jetbrains-license-server
- QUAY_LOGIN=crazymax
- QUAY_USERNAME=crazymax
- QUAY_REPONAME=jetbrains-license-server
- MICROBADGER_HOOK=https://hooks.microbadger.com/images/crazymax/jetbrains-license-server/PWF7sHnaK1djP4E9r5VY5suUqVk=
- secure: JwfXiiIM4c6E+80O6XHQBhw6IdkerfGxlKo+YHvmtkHyz5Fvpc1ZRvWSZYHZhxE1gocThbKUCy4GsgIyiq+dsER27kdAnnvp6JLw8SZ5OSqtOOLjqCKilN2hwFaS/g6Xc3mGvTo+4ScAc9CDJamDCwGY+6r2g/+IdmCbgqOo8yaD4VkhP4eVB3f4el6F7jEwjo626QDzFZ1LVS0qmmeVBSU+xxfL5HolG+j//hLQ/49XIIGnsWtQmHbX1u2trSESyNRTFdY/KZ7qaW8l+BgLhplKu+YXAExb1POGcKJnffSJjCl22ggX1JUHANMgrcQfZe2DKkUJFqr8FvTCktj+lfAuMYwl3k24zcZHe8eTyBFh8YLs7pn++tOFWg0XcKCWO9vzHgbTf/m95F6tpDMx4Y49jRclJIslxkjf8YIuNvDOO4kPKp2bw4ymqjsayPLx3P4xB8vgvyAZeFBQevUkh3ia/3uCfwEwzWimlT1FTeDUj8h4A9y+zRy/AqGf35LneC/Sbwt5dNaCujAwOGFeCvTp43uYd10S5Rz026ecH/8XlcHzuH4+nUvXDnesRI79+6NkaKl8PdcTx0ZC44jIAULn60rur5ybNkQmv5GWjem1C24izosPuC8bLHYY6BSRPn+vacNZH9SYTw2wHiVunxZORWz4FsYAidFkoaygt9E= # DOCKER_PASSWORD
- secure: Z+SIP2bLs70GcInLxGdYv68vXD47RIfowafFP8KpVt7EHki6AsIVJxrEH4/noj0jsx0Zyi93xAo+Z9Ms+BDsjUKeLjODS/mHjRQBrnryenjAnS8cRVvJUUDYcoY95SIOO4j6OSEIb+aI2d+6T2QX/iEgnEFDjiia2mLJ60orsWDtgoU7dgITB7ci4WkSMZl8VXtX7SUWKgVPRKkapfYX/AFUS41MZTnJvGQHCtTYlOMcS7fsf6ahjMvbTmf+otv2n688Mbg8Tz3cEw6YD5BHemfDq5qEJqjjnCtMIr5VSZttDwKwHsgmHrVEoiPq+Cdo+xwq3XCdfKu/qAD7NalBjNVaf6UjLjhkk4CWwLxQFnon1e8EC8GodXob4jQTGVOQX47lkPCvf6zM14GI1YxGMtofkv5ND7Ul/g+9fsn+b/QJFsuQb3ZA34pufjQQ5HRaj0ZU7izXIpUOu5EVo5ffrmUnrTisVNaSuIUonEt0p1WPFhdr1ScUc/VukF+wapDdSrSu/t8a5MXp0q3nZ+20NHlkm90o8umQqS8U1oo/n1hlEWTpC4PtRd4wggz0YNGTIKLpuxUt8HolU9rSPbGcbMLC53bNxnWd9KFaaFmRj5Np1GsBm2CDAPFYb3n/Dqyww+tg9Nk4MnCLMwROyZ+5Y7UQLtG5Tsh9tCtwPtT7Juk= # QUAY_PASSWORD
- secure: CRv5ONsqQ7WPkj/AzVId/EnQJVLcnlrAtCACsPisKWgA6QMACaIeVMKrSLP16/GyvERLmyzIGhIlprfmpiNkPeKlzGpJZBjvQ9gyK6YbexITEFjoBOH+rc27kFALCSKxGhr8m+BpHHmcGqCr79v7bFXE0p5TVFn00WbP7CfDjqAiwpcCF1JSDzA0e1mpHk3z7JXceQg9cdhPmhb1GiPMgbONSeTO3ASA9Hmi2JpwYCMaFcDsevVAA+eKSrQEkjYU3L0O4BRVlxUlWHYPSUEZ7vUlgH2imca6pD/WFYEzULj72MLeI9hpLkuXYUVaxLCBPiNoLKCyMIDsAiq5zyhmQyJFFjPo2l/JTKwtO8JCXR7B6sYp8j5gIir4Izbpm8r6VC8SBtafNcgynfehqs9Ov0yBsKKogo3fb/dSWdwANf36jQ766HaBQkp9NN0PFMLzbeXHaQA248MOP6ObqKsFg1c4iJ1UCY9A59hAUyXT+yAm0Y4auxq21/FEZ8pZFqan5qNaxvo0dP8WfeoVdsQAdZ3u7T4wtsxsO8PWKUA4FEoC3Ic9g5DBVte4SQJ5n6Ni2+DFnq4PZhBdCVwWnHh648sUfKncHdmbqTnIq6bN+RI9ZlY8MyeRKVVbbDU9mrmdM2aWlTeu4HQWd7J6ErHrTRDgkRJxKGbPDUemkX4Nhws= # GITHUB_TOKEN
before_install:
- sudo apt-get update
- docker --version
- export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi)
- export DOCKER_TAG=$(if [ "$BRANCH" == "master" ]; then echo "latest"; else echo $BRANCH; fi)
- export WAN_IP=$(dig +short myip.opendns.com @resolver1.opendns.com)
- echo "WAN_IP=$WAN_IP, TRAVIS_BRANCH=$TRAVIS_BRANCH, PR=$PR, BRANCH=$BRANCH, DOCKER_TAG=$DOCKER_TAG"
install:
- |
docker build --build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
--build-arg VCS_REF=${TRAVIS_COMMIT::8} \
--build-arg VERSION=${VERSION} \
-t $DOCKER_USERNAME/$DOCKER_REPONAME -f ./docker/Dockerfile ./docker
before_script:
- docker run -d -p 8000:80 -e JLS_VIRTUAL_HOSTS=$WAN_IP --name $DOCKER_REPONAME $DOCKER_USERNAME/$DOCKER_REPONAME
- sleep 20
- docker logs $DOCKER_REPONAME
script:
- docker ps | grep $DOCKER_REPONAME
after_success:
- test $TRAVIS_PULL_REQUEST = false
&& echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin
&& docker tag $DOCKER_USERNAME/$DOCKER_REPONAME $DOCKER_USERNAME/$DOCKER_REPONAME:$DOCKER_TAG
&& docker tag $DOCKER_USERNAME/$DOCKER_REPONAME $DOCKER_USERNAME/$DOCKER_REPONAME:$VERSION
&& docker push $DOCKER_USERNAME/$DOCKER_REPONAME
&& echo "$QUAY_PASSWORD" | docker login quay.io --username "$QUAY_USERNAME" --password-stdin
&& docker tag $DOCKER_USERNAME/$DOCKER_REPONAME quay.io/$DOCKER_USERNAME/$DOCKER_REPONAME:$DOCKER_TAG
&& docker tag $DOCKER_USERNAME/$DOCKER_REPONAME quay.io/$DOCKER_USERNAME/$DOCKER_REPONAME:$VERSION
&& docker push quay.io/$QUAY_USERNAME/$QUAY_REPONAME
&& curl -X POST $MICROBADGER_HOOK
branches:
except:
- /^[0-9]/
script: ./build.sh
notifications:
webhooks:
secure: aSAfpOXZ2sZF4lR+e0Pi8O1/ePVft0wwSQm6L2nugmk+bIkZO/iC+SaNTK1rbbiba/zEjSmxvtA+3Sx+Sw9eOPZaP3sm6PvaVycukmZeUeVMlDUDDiV1xKshAisYuheVSO4kvRFzqoSo/IwClukHbGtYO9bquxgfy+Nan5wkzx0rzFDNsSChDbAEcnZKXxSrXSlOYVtY1fRcBTq52BwnBJzE4+6zDDNJz47sJY3dhAToodOpg+LkiX6b8kY8iAtEf25HKGrJ+O7mGLJOrtZmHLBQXAhcMHLNGtajuP3xZe/1Nq/rezRzbD/Tv7breXoIABnHR6y7oGf2Iry46Uzeg758AEYNU4FymD2sDz1zF1362OFBDq50pZm/MG2K4YqrKcWoy+TzCm4+H/XzsXG1jootRj2vsy1/QFL6zI/vVk6ZsN2ISSEFrJ2T/SZZWHxhYihGemfaSLoLZ0o316KrJxmzj37YucYjJYY/b+iAQruAFPJLd3vtanHfTaFQdUiXJdU7rrolESKI1zg/1cx5rV8PrnUZJXrSNATXgoyXsEvDRsdekHg8w+6ml6OenhgrNoJYG1c+GFtCf/cUaKe9bw6WniiqXtgw75Tdz0BqzNTu9BibhnDdeKYFBzT6wgsBRs47fgWcnmy++CryMvWymTdiiDnTaljUGB/rikA9QTk=
email:
recipients:
- travisci@crazymax.dev
on_success: always
on_failure: always

View File

@@ -1,12 +1,44 @@
# Changelog
## 20267-RC1 (2019/07/19)
* JetBrains License Server 20267
## 19488-RC1 (2019/04/02)
* JetBrains License Server 19488
## 19340-RC1 (2019/03/15)
* JetBrains License Server 19340
## 18692-RC2 (2019/01/22)
* Bind to unprivileged port : `8000`
## 18692-RC1 (2018/12/25)
* JetBrains License Server 18692
## 17955-RC1 (2018/09/26)
* JetBrains License Server 17955
## 17768-RC1 (2018/09/05)
* JetBrains License Server 17768
## 17437-RC1 (2018/07/30)
* JetBrains License Server 17437
## 17211-RC1 (2018/06/29)
* Upgrade to JetBrains License Server 17211
* JetBrains License Server 17211
## 17043-RC1 (2018/05/31)
* Upgrade to JetBrains License Server 17043
* JetBrains License Server 17043
## 16429-RC2 (2018/04/20)
@@ -14,12 +46,12 @@
## 16743-RC1 (2018/04/20)
* Upgrade to JetBrains License Server 16743
* JetBrains License Server 16743
* Replace Nginx + Let's Encrypt with Traefik (see docker-compose)
## 16429-RC1 (2018/03/20)
* Upgrade to JetBrains License Server 16429
* JetBrains License Server 16429
## 15802-RC2 (2018/02/16)

View File

@@ -1,13 +1,13 @@
FROM openjdk:8-jre-alpine
MAINTAINER CrazyMax <crazy-max@users.noreply.github.com>
ARG BUILD_DATE
ARG VCS_REF
ARG VERSION
LABEL org.label-schema.build-date=$BUILD_DATE \
LABEL maintainer="CrazyMax" \
org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="jetbrains-license-server" \
org.label-schema.description="JetBrains License Server image based on Alpine Linux" \
org.label-schema.description="JetBrains License Server" \
org.label-schema.version=$VERSION \
org.label-schema.url="https://github.com/crazy-max/docker-jetbrains-license-server" \
org.label-schema.vcs-ref=$VCS_REF \
@@ -15,16 +15,15 @@ LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.vendor="CrazyMax" \
org.label-schema.schema-version="1.0"
RUN apk --update --no-cache add tzdata \
&& rm -rf /var/cache/apk/* /tmp/*
ENV JLS_PATH="/opt/jetbrains-license-server" \
JLS_VERSION="17211" \
JLS_SHA256="d935f4607cd281135b141773dfc188ff253ac5932b16ee288787036e8693dd41"
JLS_VERSION="20267" \
JLS_SHA256="5a32e66a05cc52c6ca030de4507b04afedff564e65c47e2fbfe3e7439ab611aa"
ADD entrypoint.sh /entrypoint.sh
COPY entrypoint.sh /entrypoint.sh
RUN apk --update --no-cache add -t build-dependencies \
RUN apk --update --no-cache add \
tzdata \
&& apk --update --no-cache add -t build-dependencies \
curl zip \
&& mkdir -p "$JLS_PATH" \
&& curl -L "https://download.jetbrains.com/lcsrv/license-server-installer.zip" -o "/tmp/jls.zip" \
@@ -37,7 +36,7 @@ RUN apk --update --no-cache add -t build-dependencies \
&& apk del build-dependencies \
&& rm -rf /var/cache/apk/* /tmp/*
EXPOSE 80
EXPOSE 8000
VOLUME [ "/data" ]
ENTRYPOINT [ "/entrypoint.sh" ]

View File

@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2018 CrazyMax
Copyright (c) 2018-2019 CrazyMax
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,11 +1,12 @@
<p align="center"><a href="https://github.com/crazy-max/docker-jetbrains-license-server" target="_blank"><img height="128"src="https://raw.githubusercontent.com/crazy-max/docker-jetbrains-license-server/master/.res/docker-jetbrains-license-server.jpg"></a></p>
<p align="center">
<a href="https://microbadger.com/images/crazymax/jetbrains-license-server"><img src="https://images.microbadger.com/badges/version/crazymax/jetbrains-license-server.svg?style=flat-square" alt="Version"></a>
<a href="https://travis-ci.org/crazy-max/docker-jetbrains-license-server"><img src="https://img.shields.io/travis/crazy-max/docker-jetbrains-license-server/master.svg?style=flat-square" alt="Build Status"></a>
<a href="https://hub.docker.com/r/crazymax/jetbrains-license-server/"><img src="https://img.shields.io/badge/dynamic/json.svg?label=version&query=$.results[1].name&url=https://hub.docker.com/v2/repositories/crazymax/jetbrains-license-server/tags&style=flat-square" alt="Latest Version"></a>
<a href="https://travis-ci.com/crazy-max/docker-jetbrains-license-server"><img src="https://img.shields.io/travis/com/crazy-max/docker-jetbrains-license-server/master.svg?style=flat-square" alt="Build Status"></a>
<a href="https://hub.docker.com/r/crazymax/jetbrains-license-server/"><img src="https://img.shields.io/docker/stars/crazymax/jetbrains-license-server.svg?style=flat-square" alt="Docker Stars"></a>
<a href="https://hub.docker.com/r/crazymax/jetbrains-license-server/"><img src="https://img.shields.io/docker/pulls/crazymax/jetbrains-license-server.svg?style=flat-square" alt="Docker Pulls"></a>
<a href="https://quay.io/repository/crazymax/jetbrains-license-server"><img src="https://quay.io/repository/crazymax/jetbrains-license-server/status?style=flat-square" alt="Docker Repository on Quay"></a>
<a href="https://www.codacy.com/app/crazy-max/docker-jetbrains-license-server"><img src="https://img.shields.io/codacy/grade/eb420bc3e6ed49ff97cc261602228efa.svg?style=flat-square" alt="Code Quality"></a>
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3BXL8EBDJALHQ"><img src="https://img.shields.io/badge/donate-paypal-7057ff.svg?style=flat-square" alt="Donate Paypal"></a>
</p>
@@ -48,11 +49,13 @@ If you are interested, [check out](https://hub.docker.com/r/crazymax/) my other
### Ports
* `80` : Jetbrains License Server HTTP port
* `8000` : Jetbrains License Server HTTP port
## Usage
## Use this image
Docker compose is the recommended way to run this image. You can use the following [docker compose template](docker/docker-compose.yml), then run the container :
### Docker Compose
Docker compose is the recommended way to run this image. Copy the content of folder [examples/compose](examples/compose) in `/var/jls/` on your host for example. Edit the compose and env files with your preferences and run the following commands :
```bash
touch acme.json
@@ -61,10 +64,12 @@ docker-compose up -d
docker-compose logs -f
```
Or use the following minimal command :
### Command line
You can also use the following minimal command :
```bash
$ docker run -d -p 8000:80 --name jetbrains-license-server \
$ docker run -d -p 8000:8000 --name jetbrains_license_server \
-e TZ="Europe/Paris" \
-e JLS_VIRTUAL_HOSTS=jetbrains-license-server.example.com \
-v $(pwd)/data:/data \
@@ -94,9 +99,9 @@ Passed value of header "Host" is not allowed. Please contact your license server
That's because the license server is running behind a reverse proxy. Please configure virtual hosts using the `JLS_VIRTUAL_HOSTS` variable.
## How can i help ?
## How can I help ?
All kinds of contributions are welcomed :raised_hands:!<br />
All kinds of contributions are welcome :raised_hands:!<br />
The most basic way to show your support is to star :star2: the project, or to raise issues :speech_balloon:<br />
But we're not gonna lie to each other, I'd rather you buy me a beer or two :beers:!

121
build.sh Executable file
View File

@@ -0,0 +1,121 @@
#!/usr/bin/env bash
set -e
PROJECT=jetbrains-license-server
BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
BUILD_TAG=docker_build
BUILD_WORKINGDIR=${BUILD_WORKINGDIR:-.}
DOCKERFILE=${DOCKERFILE:-Dockerfile}
VCS_REF=${TRAVIS_COMMIT::7}
RUNNING_TIMEOUT=120
RUNNING_LOG_CHECK="is listening on"
PUSH_LATEST=${PUSH_LATEST:-true}
DOCKER_USERNAME=${DOCKER_USERNAME:-crazymax}
DOCKER_LOGIN=${DOCKER_LOGIN:-crazymax}
DOCKER_REPONAME=${DOCKER_REPONAME:-jetbrains-license-server}
QUAY_USERNAME=${QUAY_USERNAME:-crazymax}
QUAY_LOGIN=${QUAY_LOGIN:-crazymax}
QUAY_REPONAME=${QUAY_REPONAME:-jetbrains-license-server}
# Check local or travis
BRANCH=${TRAVIS_BRANCH:-local}
if [[ ${TRAVIS_PULL_REQUEST} == "true" ]]; then
BRANCH=${TRAVIS_PULL_REQUEST_BRANCH}
fi
DOCKER_TAG=${BRANCH:-local}
if [[ "$BRANCH" == "master" ]]; then
DOCKER_TAG=latest
elif [[ "$BRANCH" == "local" ]]; then
BUILD_DATE=
VERSION=local
fi
echo "PROJECT=${PROJECT}"
echo "VERSION=${VERSION}"
echo "BUILD_DATE=${BUILD_DATE}"
echo "BUILD_TAG=${BUILD_TAG}"
echo "BUILD_WORKINGDIR=${BUILD_WORKINGDIR}"
echo "DOCKERFILE=${DOCKERFILE}"
echo "VCS_REF=${VCS_REF}"
echo "PUSH_LATEST=${PUSH_LATEST}"
echo "DOCKER_LOGIN=${DOCKER_LOGIN}"
echo "DOCKER_USERNAME=${DOCKER_USERNAME}"
echo "DOCKER_REPONAME=${DOCKER_REPONAME}"
echo "QUAY_LOGIN=${QUAY_LOGIN}"
echo "QUAY_USERNAME=${QUAY_USERNAME}"
echo "QUAY_REPONAME=${QUAY_REPONAME}"
echo "TRAVIS_BRANCH=${TRAVIS_BRANCH}"
echo "TRAVIS_PULL_REQUEST=${TRAVIS_PULL_REQUEST}"
echo "BRANCH=${BRANCH}"
echo "DOCKER_TAG=${DOCKER_TAG}"
echo
# Build
echo "### Build"
docker build \
--build-arg BUILD_DATE=${BUILD_DATE} \
--build-arg VCS_REF=${VCS_REF} \
--build-arg VERSION=${VERSION} \
-t ${BUILD_TAG} -f ${DOCKERFILE} ${BUILD_WORKINGDIR}
echo
echo "### Test"
docker rm -f ${PROJECT} > /dev/null 2>&1 || true
docker run -d -p 8000:8000 \
-e "JLS_VIRTUAL_HOSTS=docker.test" \
--name ${PROJECT} ${BUILD_TAG}
echo
echo "### Waiting for ${PROJECT} to be up..."
TIMEOUT=$((SECONDS + RUNNING_TIMEOUT))
while read LOGLINE; do
echo ${LOGLINE}
if [[ ${LOGLINE} == *"${RUNNING_LOG_CHECK}"* ]]; then
echo "Container up!"
break
fi
if [[ $SECONDS -gt ${TIMEOUT} ]]; then
>&2 echo "ERROR: Failed to run ${PROJECT} container"
docker rm -f ${PROJECT} > /dev/null 2>&1 || true
exit 1
fi
done < <(docker logs -f ${PROJECT} 2>&1)
echo
CONTAINER_STATUS=$(docker container inspect --format "{{.State.Status}}" ${PROJECT})
if [[ ${CONTAINER_STATUS} != "running" ]]; then
>&2 echo "ERROR: Container ${PROJECT} returned status '$CONTAINER_STATUS'"
docker rm -f ${PROJECT} > /dev/null 2>&1 || true
exit 1
fi
docker rm -f ${PROJECT} > /dev/null 2>&1 || true
if [ "${VERSION}" == "local" -o "${TRAVIS_PULL_REQUEST}" == "true" ]; then
echo "INFO: This is a PR or a local build, skipping push..."
exit 0
fi
if [[ ! -z ${DOCKER_PASSWORD} ]]; then
echo "### Push to Docker Hub..."
echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_LOGIN" --password-stdin > /dev/null 2>&1
if [ "${DOCKER_TAG}" == "latest" -a "${PUSH_LATEST}" == "true" ]; then
docker tag ${BUILD_TAG} ${DOCKER_USERNAME}/${DOCKER_REPONAME}:${DOCKER_TAG}
fi
if [[ "${VERSION}" != "latest" ]]; then
docker tag ${BUILD_TAG} ${DOCKER_USERNAME}/${DOCKER_REPONAME}:${VERSION}
fi
docker push ${DOCKER_USERNAME}/${DOCKER_REPONAME}
echo
fi
if [[ ! -z ${QUAY_PASSWORD} ]]; then
echo "### Push to Quay..."
echo "$QUAY_PASSWORD" | docker login quay.io --username "$QUAY_LOGIN" --password-stdin > /dev/null 2>&1
if [ "${DOCKER_TAG}" == "latest" -a "${PUSH_LATEST}" == "true" ]; then
docker tag ${BUILD_TAG} quay.io/${QUAY_USERNAME}/${QUAY_REPONAME}:${DOCKER_TAG}
fi
if [[ "${VERSION}" != "latest" ]]; then
docker tag ${BUILD_TAG} quay.io/${QUAY_USERNAME}/${QUAY_REPONAME}:${VERSION}
fi
docker push quay.io/${QUAY_USERNAME}/${QUAY_REPONAME}
echo
fi

View File

@@ -1 +0,0 @@
/docker-compose.yml

View File

@@ -1,62 +0,0 @@
version: '3.2'
services:
traefik:
image: traefik:1.6-alpine
command:
- --logLevel=INFO
- --defaultentrypoints=http,https
- --entryPoints=Name:http Address::80 Redirect.EntryPoint:https
- --entryPoints=Name:https Address::443 TLS
- --docker
- --docker.exposedbydefault=false
- --docker.domain=example.com
- --acme=false
- --acme.acmelogging=true
- --acme.email=webmaster@example.com
- --acme.storage=acme.json
- --acme.entryPoint=https
- --acme.onhostrule=true
- --acme.httpchallenge=true
ports:
- target: 80
published: 80
protocol: tcp
mode: host
- target: 443
published: 443
protocol: tcp
mode: host
volumes:
- ./acme.json:/acme.json
- /var/run/docker.sock:/var/run/docker.sock
restart: always
app:
image: crazymax/jetbrains-license-server:latest
depends_on:
- traefik
volumes:
- jetbrains-license-server:/data
labels:
- traefik.enable=true
- traefik.backend=jetbrains-license-server
- traefik.port=80
- traefik.frontend.rule=Host:jetbrains-license-server.example.com,an-other-host.example.com
environment:
- TZ=Europe/Paris
- JLS_VIRTUAL_HOSTS=jetbrains-license-server.example.com,an-other-host.example.com
- JLS_CONTEXT=/
- JLS_ACCESS_CONFIG=/data/access-config.json
- JLS_STATS_RECIPIENTS=webmaster@example.com,an-other-address@example.com
- JLS_REPORT_OUT_OF_LICENSE=90
- JLS_SMTP_SERVER=smtp.example.com
- JLS_SMTP_PORT=25
- JLS_SMTP_USERNAME=smtp@example.com
- JLS_SMTP_PASSWORD=
- JLS_STATS_FROM=jetbrains@example.com
- JLS_STATS_TOKEN=1BFC67F51AAF99E85C2347B72E62C
restart: always
volumes:
jetbrains-license-server:

View File

@@ -1,11 +1,11 @@
#!/bin/sh
TZ=${TZ:-"UTC"}
TZ=${TZ:-UTC}
JLS_PATH="/opt/jetbrains-license-server"
JLS_LISTEN_ADDRESS="0.0.0.0"
JLS_PORT=80
JLS_CONTEXT=${JLS_CONTEXT:-"/"}
JLS_ACCESS_CONFIG=${JLS_ACCESS_CONFIG:-"/data/access-config.json"}
JLS_PORT=8000
JLS_CONTEXT=${JLS_CONTEXT:-/}
JLS_ACCESS_CONFIG=${JLS_ACCESS_CONFIG:-/data/access-config.json}
# Timezone
echo "Setting timezone to ${TZ}..."
@@ -39,7 +39,7 @@ fi
# https://www.jetbrains.com/help/license_server/detailed_server_usage_statistics.html
if [ ! -z "$JLS_SMTP_SERVER" -a ! -z "$JLS_STATS_RECIPIENTS" ] ; then
JLS_SMTP_PORT=${JLS_SMTP_PORT:-"25"}
JLS_SMTP_PORT=${JLS_SMTP_PORT:-25}
echo "Enabling User Reporting via SMTP at $JLS_SMTP_SERVER:$JLS_SMTP_PORT..."
license-server configure --smtp.server ${JLS_SMTP_SERVER} --smtp.server.port ${JLS_SMTP_PORT}

View File

@@ -0,0 +1,63 @@
version: "3.2"
services:
traefik:
image: traefik:1.7-alpine
container_name: traefik
command:
- "--logLevel=INFO"
- "--defaultentrypoints=http,https"
- "--entryPoints=Name:http Address::80 Redirect.EntryPoint:https"
- "--entryPoints=Name:https Address::443 TLS"
- "--docker"
- "--docker.exposedbydefault=false"
- "--docker.domain=example.com"
- "--acme=false"
- "--acme.acmelogging=true"
- "--acme.email=webmaster@example.com"
- "--acme.storage=acme.json"
- "--acme.entryPoint=https"
- "--acme.onhostrule=true"
- "--acme.httpchallenge=true"
- "--acme.httpchallenge.entrypoint=http"
ports:
- target: 80
published: 80
protocol: tcp
- target: 443
published: 443
protocol: tcp
volumes:
- "./acme.json:/acme.json"
- "/var/run/docker.sock:/var/run/docker.sock"
restart: always
app:
image: crazymax/jetbrains-license-server:latest
container_name: jetbrains_license_server
depends_on:
- traefik
volumes:
- "jetbrains-license-server:/data"
labels:
- "traefik.enable=true"
- "traefik.backend=jetbrains-license-server"
- "traefik.port=8000"
- "traefik.frontend.rule=Host:jetbrains-license-server.example.com,an-other-host.example.com"
environment:
- "TZ=Europe/Paris"
- "JLS_VIRTUAL_HOSTS=jetbrains-license-server.example.com,an-other-host.example.com"
- "JLS_CONTEXT=/"
- "JLS_ACCESS_CONFIG=/data/access-config.json"
- "JLS_STATS_RECIPIENTS=webmaster@example.com,an-other-address@example.com"
- "JLS_REPORT_OUT_OF_LICENSE=90"
- "JLS_SMTP_SERVER=smtp.example.com"
- "JLS_SMTP_PORT=25"
- "JLS_SMTP_USERNAME=smtp@example.com"
- "JLS_SMTP_PASSWORD="
- "JLS_STATS_FROM=jetbrains@example.com"
- "JLS_STATS_TOKEN=0123456789ABCDEF"
restart: always
volumes:
jetbrains-license-server: