Skip to content
This repository was archived by the owner on Apr 1, 2022. It is now read-only.

Commit 577f591

Browse files
author
Pavel Sobolev
authored
(#4) v0.1.0:
* (#1) Sketch a basic version; * (#2) Add a note on how to check this out; * (#3) Add the `binder` folder.
2 parents 61926df + 0ec37e8 commit 577f591

File tree

11 files changed

+281
-0
lines changed

11 files changed

+281
-0
lines changed

.github/config/release-drafter.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name-template: 'v$RESOLVED_VERSION'
2+
tag-template: 'v$RESOLVED_VERSION'
3+
template: |
4+
## Diff
5+
6+
$CHANGES
7+
version-resolver:
8+
major:
9+
labels:
10+
- 'major'
11+
minor:
12+
labels:
13+
- 'minor'
14+
patch:
15+
labels:
16+
- 'patch'
17+
default: patch

.github/scripts/build.bash

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
# A script to build the image and test a container based on it
4+
5+
# Download dive
6+
echo -e '\n\e[1;36mDownloading dive...\e[0m\n'
7+
wget https://github.com/wagoodman/dive/releases/download/v0.9.2/dive_0.9.2_linux_amd64.deb
8+
9+
# Install dive
10+
echo -e '\e[1;36mInstalling dive...\e[0m\n'
11+
sudo apt install ./dive_0.9.2_linux_amd64.deb
12+
13+
# Activate experimental features
14+
echo -e '\n\e[1;36mActivating experimental features...\e[0m\n'
15+
sudo tee /etc/docker/daemon.json > /dev/null << EOF
16+
{
17+
"experimental": true
18+
}
19+
EOF
20+
sudo service docker restart
21+
22+
# Build the image
23+
echo -e '\e[1;36mBuilding the image...\e[0m\n'
24+
docker build -t image --squash .
25+
26+
# Analyse the image
27+
echo -e '\n\e[1;36mAnalyzing the image...\e[0m\n'
28+
CI=true dive image
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/bin/bash
2+
3+
# A script to decide what version to upload
4+
5+
# Set current repository variable
6+
REPOSITORY=paveloom-d/binder-julia
7+
8+
# Get last published version
9+
LAST_VERSION=$(curl --silent "https://api.github.com/repos/$REPOSITORY/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
10+
11+
# Check if there is some tag
12+
if [ ! -z "$LAST_VERSION" ]; then
13+
14+
# Get current tag
15+
CURRENT_TAG=$(echo ${GITHUB_REF#refs/*/})
16+
17+
# Print info
18+
echo -e "\n\e[1;36mLast version: $LAST_VERSION\e[0m"
19+
echo -e "\e[1;36mCurrent tag: $CURRENT_TAG\e[0m\n"
20+
21+
# Check if the tag is a semantic version
22+
if echo "$CURRENT_TAG" | grep -E "^v[0-9]+\.[0-9]+\.[0-9]+$"; then
23+
24+
# Print information
25+
echo -e "\e[1;36mCurrent tag is a semantic version. Tagged image will be published.\e[0m\n"
26+
27+
# Set environment variable
28+
echo ::set-env name=RELEASE_VERSION::$(echo ${CURRENT_TAG} | sed 's/v//')
29+
30+
# Publish tagged image
31+
echo ::set-env name=PUBLISH_RELEASE_VERSION::$(echo true)
32+
33+
else
34+
35+
# Print information
36+
echo -e "\e[1;36mCurrent tag is not a semantic version. Tagged image will not be published.\e[0m\n"
37+
38+
# Don't publish tagged image
39+
echo ::set-env name=PUBLISH_RELEASE_VERSION::$(echo false)
40+
41+
fi
42+
43+
else
44+
45+
# Print information
46+
echo -e "\n\e[1;36mNo release has been found, tagged version will not be published.\e[0m\n"
47+
48+
# Don't publish tagged image
49+
echo ::set-env name=PUBLISH_RELEASE_VERSION::$(echo false)
50+
51+
fi
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Publish Docker
2+
3+
on:
4+
release:
5+
types: [published]
6+
push:
7+
branches:
8+
- develop
9+
10+
jobs:
11+
Update:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@master
15+
- name: Get release version
16+
run: bash .github/scripts/publish-docker.bash
17+
18+
- name: Publish to Registry (with a tagged image)
19+
if: ${{ env.PUBLISH_RELEASE_VERSION == 'true' }}
20+
uses: elgohr/Publish-Docker-Github-Action@master
21+
with:
22+
name: paveloom-d/binder-julia/binder-julia
23+
username: ${{ github.actor }}
24+
password: ${{ secrets.GITHUB_TOKEN }}
25+
registry: docker.pkg.github.com
26+
tags: "latest,${{ env.RELEASE_VERSION }}"
27+
28+
- name: Publish to Registry (without a tagged image)
29+
if: ${{ env.PUBLISH_RELEASE_VERSION == 'false' }}
30+
uses: elgohr/Publish-Docker-Github-Action@master
31+
with:
32+
name: paveloom-d/binder-julia/binder-julia
33+
username: ${{ github.actor }}
34+
password: ${{ secrets.GITHUB_TOKEN }}
35+
registry: docker.pkg.github.com
36+
tags: "latest"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
8+
jobs:
9+
Update:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: release-drafter/release-drafter@v5
13+
with:
14+
config-name: config/release-drafter.yml
15+
env:
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.travis.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
language: shell
2+
dist: bionic
3+
4+
os:
5+
- linux
6+
7+
branches:
8+
except:
9+
- master
10+
- develop
11+
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/
12+
13+
services:
14+
- docker
15+
16+
jobs:
17+
include:
18+
- stage: "Build"
19+
name: "Build Docker Image"
20+
script: bash .github/scripts/build.bash
21+
22+
notifications:
23+
email: false

Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Base image
2+
FROM paveloom/binder-base:0.1.1
3+
4+
# Meta information
5+
LABEL maintainer="Pavel Sobolev (https://github.com/Paveloom)"
6+
LABEL version="0.1.0"
7+
LABEL description="Basically, `paveloom/binder-base` + Julia."
8+
LABEL github-repository="https://github.com/paveloom-d/binder-julia"
9+
LABEL docker-repository="https://hub.docker.com/r/paveloom/binder-julia"
10+
11+
# Copy the scripts to the root
12+
COPY scripts /scripts
13+
14+
# Allow their execution
15+
RUN sudo chmod -R +x /scripts
16+
17+
# Add `/usr/other/$USER/julia/bin` to the `PATH`
18+
ENV PATH=$PATH:/usr/other/$USER/julia/bin
19+
20+
# Install Julia
21+
RUN /scripts/user/julia/install-julia.sh
22+
23+
# Remove scripts
24+
RUN sudo rm -rf /scripts

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Pavel Sobolev
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Description
2+
3+
### A notice
4+
If you are unsure, please refer to the description on the last commit on the
5+
[`master`](https://github.com/paveloom-d/binder-julia/tree/master) branch.
6+
7+
### What is this?
8+
9+
This is a Docker image from
10+
[the series of images](https://github.com/orgs/paveloom-d/projects/1) based on the
11+
[`paveloom/binder-base`](https://github.com/paveloom-d/binder-base) image. It adds
12+
[the Julia programming language](https://julialang.org/) to the system. For a more formal
13+
description, see under the spoiler:
14+
15+
<details>
16+
<summary>Content of the image</summary>
17+
<ul>
18+
<li>
19+
Base image:
20+
<a href="https://github.com/paveloom-d/binder-base">paveloom/binder-base</a>
21+
(0.1.1)
22+
</li>
23+
<li>Julia (1.5.0)</li>
24+
</ul>
25+
</details>
26+
27+
### How do I use it?
28+
29+
The image is hosted on [Docker Hub](https://hub.docker.com/r/paveloom/binder-julia).
30+
To get it, in your `Dockerfile` just specify:
31+
32+
```dockerfile
33+
FROM paveloom/binder-julia:tag
34+
```
35+
36+
where the `tag` is one of the following:
37+
38+
* [0.1.0](https://github.com/paveloom-d/binder-julia/releases/tag/v0.1.0)
39+
40+
### Can I easily see what it looks like?
41+
42+
Absolutely. For example, here's a
43+
[link](https://mybinder.org/v2/gh/paveloom-d/binder-base/master?urlpath=lab) to run a
44+
Binder instance from the stable `master` branch. You may notice that a new kernel has been
45+
added.

binder/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Base image
2+
FROM paveloom/binder-julia:0.1.0

0 commit comments

Comments
 (0)