Skip to content
This repository was archived by the owner on Jan 17, 2025. It is now read-only.

Commit 3550afe

Browse files
authored
setup travis for push image (#8)
* setup travis for push image * update dockerfile openjdk
1 parent e8b191d commit 3550afe

File tree

23 files changed

+103
-288
lines changed

23 files changed

+103
-288
lines changed

.travis.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ sudo: required
22
group: deprecated-2017Q3
33
language: scala
44
scala:
5-
- 2.11.8
5+
- 2.11.11
66
services:
77
- docker
88
before_install:
9-
- 'if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then openssl aes-256-cbc -K $encrypted_a0b9052d7bd5_key -iv $encrypted_a0b9052d7bd5_iv -in tests/credentials.json.enc -out tests/credentials.json -d; fi'
109
- "./tools/travis/setup.sh"
1110
install: true
1211
script:
@@ -17,8 +16,11 @@ deploy:
1716
on:
1817
tags: true
1918
all_branches: true
19+
- provider: script
20+
script: "./tools/travis/publish.sh ibmfunctions kotlin latest"
21+
on:
22+
branch: master
2023
env:
2124
global:
22-
- secure: dndDlFixUN9sua36GlNYq43GucaPmQxQaGtqnRAToKDihTwXqDLksWw8OoXnBqnWMJu/X8j2cx1EAiFmDRO5RdOlILoOx2TqsIEN4Xeu6egLTqr9gri494AuhGC09MLOfVVXW5RsJY2I2D3PoehTNC4u9HxXYJMZp/0Y3kBok+ADp5O3TzC0e5DLFIsQcRxWo81tJ6qraI4xILej8LYPubLT1Zh9hmvWXtXl666gNTrV9vDAROtDU4fAfkv44tv5n5MJNUZWzyYhPpUcmnSetlBVxyX+SrTqvabCYmY0Vg7EvSc6a7fA5YoLpockA2K2VA9+q1Pzns3nDOdVUbt/rRiA5W6+Q5/JH5WkqnjZlGSoez0KXATA4CoSwBXCxuoqwfXlZyEnE71rZv/Kspeeb03I3GQbVihRN0NoAKJwK7AVJMPo4CLLz8WXBWd4Lg4BtTOasZi7gx4jitQ3akfNobxfA0YEb+jNQtRGFuP7KKwfyiz7xuuQoh6X+Q6mOgI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L3+YHE5ztuT9XLT8LZ12e2dUq6lj2zXrcV1DpjqIgAEktw3VbDSDUQsqYLt9puZpo8u04hey8PBlz+zmrN7/U5KGUlLqPaOUhELbFt9rPu+RuE875v9qZBWJbU=

README.md

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
# IBM Cloud Functions runtime for Kotlin
2-
WARNING: Work in Progress (WIP) not ready for production
1+
# IBM Cloud Functions (OpenWhisk) runtime for Kotlin
2+
3+
:warning: Work in Progress (WIP) not ready for production :warning:
34

45
[![Build Status](https://travis-ci.org/ibm-functions/runtime-kotlin.svg?branch=master)](https://travis-ci.org/ibm-functions/runtime-kotlin)
56

6-
The runtime provides Kotlin running on Java 8u131 b11.
7+
The runtime provides Kotlin running on Java adoptopenjdk/openjdk8-openj9:x86_64-ubuntu-jdk8u162-b12_openj9-0.8.0
78

89
## Hello World Kotlin Action
910

@@ -82,7 +83,7 @@ Build and Push image:
8283

8384
```sh
8485
docker login
85-
./gradlew core:kotlin:distDocker -PdockerImagePrefix=$prefix-user -PdockerRegistry=docker.io
86+
./gradlew kotlin:distDocker -PdockerImagePrefix=$prefix-user -PdockerRegistry=docker.io
8687
```
8788

8889
Deploy OpenWhisk using ansible environment that adds the new kind `kotlin`
@@ -118,14 +119,22 @@ wsk action update myAction myAction.jar --docker $user_prefix/action-kotlin
118119
The `$user_prefix` is usually your dockerhub user id.
119120

120121
### Testing
122+
Install dependencies from the root directory on $OPENWHISK_HOME repository
123+
```
124+
./gradlew install
125+
```
121126

122-
123-
To run all tests: `./gradlew tests:test` this include tests depending on credentials
124-
125-
To run all tests except those which do not rely on credentials `./gradlew tests:testWithoutCredentials`
126-
127-
To run a single test-class: `./gradlew tests:test --tests <SomeGradleTestFilter>`
128-
127+
Using gradle to run all tests
128+
```
129+
./gradlew :tests:test
130+
```
131+
Using gradle to run some tests
132+
```
133+
./gradlew :tests:test --tests *ActionContainerTests*
134+
```
135+
Using IntelliJ:
136+
- Import project as gradle project.
137+
- Make sure working directory is root of the project/repo
129138

130139
# License
131140
[Apache 2.0](LICENSE.txt)

ansible/environments/local/group_vars/all

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,7 @@ apigw_auth_user: ""
2222
apigw_auth_pwd: ""
2323
apigw_host_v2: "http://{{ groups['apigateway']|first }}:{{apigateway.port.api}}/v2"
2424

25-
controller_arguments: '-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=1098'
26-
invoker_arguments: "{{ controller_arguments }}"
27-
2825
invoker_allow_multiple_instances: true
29-
3026
env_hosts_dir: "{{ playbook_dir }}/environments/local"
3127

3228
runtimes_manifest:
@@ -39,7 +35,7 @@ runtimes_manifest:
3935
image:
4036
name: "nodejs6action"
4137
deprecated: false
42-
java:
38+
kotlin:
4339
- kind: "kotlin"
4440
default: true
4541
image:
@@ -52,3 +48,5 @@ runtimes_manifest:
5248
requireMain: true
5349
blackboxes:
5450
- name: "dockerskeleton"
51+
52+
controller_protocol: "http"

core/kotlin/Dockerfile

Lines changed: 0 additions & 38 deletions
This file was deleted.

core/kotlin/build.gradle

Lines changed: 0 additions & 2 deletions
This file was deleted.

kotlin/Dockerfile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more contributor
3+
# license agreements. See the NOTICE file distributed with this work for additional
4+
# information regarding copyright ownership. The ASF licenses this file to you
5+
# under the Apache License, Version 2.0 (the # "License"); you may not use this
6+
# file except in compliance with the License. You may obtain a copy of the License
7+
# at:
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software distributed
12+
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
13+
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
14+
# specific language governing permissions and limitations under the License.
15+
#
16+
17+
FROM adoptopenjdk/openjdk8-openj9:x86_64-ubuntu-jdk8u162-b12_openj9-0.8.0
18+
19+
RUN rm -rf /var/lib/apt/lists/* && apt-get clean && apt-get update \
20+
&& apt-get install -y --no-install-recommends locales \
21+
&& rm -rf /var/lib/apt/lists/* \
22+
&& locale-gen en_US.UTF-8
23+
24+
ENV LANG="en_US.UTF-8" \
25+
LANGUAGE="en_US:en" \
26+
LC_ALL="en_US.UTF-8" \
27+
VERSION=8 \
28+
UPDATE=162 \
29+
BUILD=12
30+
31+
ADD proxy /kotlinAction
32+
33+
RUN rm -rf /kotlinAction/.classpath /kotlinAction/.gitignore /kotlinAction/.gradle /kotlinAction/.project /kotlinAction/.settings /kotlinAction/Dockerfile /kotlinAction/build
34+
35+
RUN cd /kotlinAction; ./gradlew oneJar
36+
37+
RUN rm -rf /kotlinAction/src
38+
39+
CMD ["java", "-jar", "/kotlinAction/build/libs/kotlinAction-all.jar"]

kotlin/build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ext.dockerImageName = 'action-kotlin'
2+
apply from: '../gradle/docker.gradle'
File renamed without changes.
File renamed without changes.
File renamed without changes.

settings.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
include 'tests'
22

3-
include 'core:kotlin'
3+
include 'kotlin'
44

55
rootProject.name = 'runtime-kotlin'
66

tests/build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ tasks.withType(Test) {
1717
outputs.upToDateWhen { false } // force tests to run every time
1818
}
1919

20-
task testWithoutCredentials(type: Test) {
21-
exclude '**/*Credentials*'
22-
}
23-
2420
dependencies {
2521
compile "org.scala-lang:scala-library:${gradle.scala.version}"
2622
compile "org.jetbrains.kotlin:kotlin-compiler-embeddable:1.2.0"

tests/src/test/scala/actionContainers/ActionContainer.scala

Lines changed: 0 additions & 175 deletions
This file was deleted.

0 commit comments

Comments
 (0)