Skip to content

Commit d730411

Browse files
fgeckfwilhe
authored andcommitted
Bootstrap the repository (#2)
1 parent 583aa29 commit d730411

7 files changed

Lines changed: 163 additions & 0 deletions

File tree

.github/main.workflow

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
workflow "Lint all Dockerfiles" {
2+
on = "push"
3+
resolves = ["Haskell Dockerfile Linter"]
4+
}
5+
6+
action "Haskell Dockerfile Linter" {
7+
uses = "docker://cdssnc/docker-lint-github-action"
8+
# https://github.com/hadolint/hadolint/wiki/DL3008
9+
# https://github.com/hadolint/hadolint/wiki/DL3013
10+
# https://github.com/hadolint/hadolint/wiki/DL3016
11+
# https://github.com/hadolint/hadolint/wiki/DL3018
12+
args = "--ignore DL3008 --ignore DL3013 --ignore DL3016 --ignore DL3018"
13+
}

.travis.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
branches:
2+
only:
3+
- master
4+
- /^it\/.*$/
5+
language: minimal
6+
services:
7+
- docker
8+
script: chmod +x runTests.sh && ./runTests.sh

CONTRIBUTING.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Guidance on how to contribute
2+
3+
There are two primary ways to help:
4+
* using the issue tracker, and
5+
* changing the code-base.
6+
7+
## Using the issue tracker
8+
9+
Use the issue tracker to suggest feature requests, report bugs, and ask
10+
questions. This is also a great way to connect with the developers of the
11+
project as well as others who are interested in this solution.
12+
13+
Use the issue tracker to find ways to contribute. Find a bug or a feature,
14+
mention in the issue that you will take on that effort, then follow the
15+
guidance below.
16+
17+
## Changing the code-base
18+
19+
Generally speaking, you should fork this repository, make changes in your own
20+
fork, and then submit a pull-request. All new code should have been thoroughly
21+
tested end-to-end in order to validate implemented features and the presence or
22+
lack of defects. All new scripts and docker files _must_ come with automated (unit)
23+
tests.
24+
25+
The contract of functionality exposed by docker files functionality needs
26+
to be documented, so it can be properly used. Implementation of a functionality
27+
and its documentation shall happen within the same commit(s).
28+
29+
#### Consistent USER Instruction in the Dockerfile
30+
31+
Set the user name (or UID) and the user group (or GID) to UID 1000 and GID 1000 to be consistent ith the Jenkins image.
32+
33+
````
34+
USER 1000:1000
35+
````

Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM maven:3.5-jdk-8-alpine
2+
3+
RUN mvn com.sap.cloud:neo-javaee6-wp-maven-plugin:2.164.4:install-sdk -DsdkInstallPath=sdk -Dincludes=tools/**,license/**,sdk.version && \
4+
chmod -R 777 sdk && \
5+
ln -s /sdk/tools/neo.sh /usr/bin/neo.sh && \
6+
rm -rf /var/lib/apt/lists/*

NOTICE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved.

README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Neo CLI
2+
3+
Dockerfile for an image with SAP Cloud Platform Tools for Neo.
4+
This image is intended to be used in Jenkins pipelines.
5+
6+
## Download
7+
8+
This image is published to Docker Hub and can be pulled via the command
9+
10+
```
11+
docker pull ppiper/neo-cli
12+
```
13+
14+
## Build
15+
16+
To build this image locally, open a terminal in the directory of the Dockerfile an run
17+
18+
```
19+
docker build -t ppiper/neo-cli .
20+
```
21+
22+
## Usage
23+
24+
Recommended usage of this image is via [`neoDeploy`](https://sap.github.io/jenkins-library/steps/neoDeploy/) pipeline step.
25+
26+
For using the `neo.sh` tool via this image, it can be invoked like in this command
27+
28+
```
29+
docker run ppiper/neo-cli neo.sh help
30+
```
31+
32+
## Testing
33+
34+
### Running as a Service
35+
36+
See `.travis.yml` file for configuration.
37+
38+
Configure the following variables (secrets)
39+
40+
* `CX_INFRA_IT_CF_USERNAME` (user name for deployment to SAP Cloud Platform)
41+
* `CX_INFRA_IT_CF_PASSWORD` (password for deployment to SAP Cloud Platform)
42+
43+
### Running locally
44+
45+
Docker is required, and at least 4 GB of memory assigned to Docker.
46+
47+
```bash
48+
export CX_INFRA_IT_CF_USERNAME="myusername"
49+
export CX_INFRA_IT_CF_PASSWORD="mypassword"
50+
./runTests.sh
51+
```
52+
53+
## License
54+
55+
Copyright (c) 2018 SAP SE or an SAP affiliate company. All rights reserved.
56+
This file is licensed under the Apache Software License, v. 2 except as noted
57+
otherwise in the [LICENSE file](https://github.com/SAP/devops-docker-images/blob/master/LICENSE).
58+
59+
Please note that Docker images can contain other software which may be licensed under different licenses. This License file is also included in the Docker image. For any usage of built Docker images please make sure to check the licenses of the artifacts contained in the images.
60+
61+
This image contains the [SAP Cloud Platform Tools for Neo](https://mvnrepository.com/artifact/com.sap.cloud/neo-javaee6-wp-maven-plugin).
62+
These tools are licensed under the [SAP DEVELOPER LICENSE AGREEMENT](https://tools.hana.ondemand.com/developer-license-3_1.txt).
63+
This License file is also included in the `/sdk` folder in the Docker image.
64+
For any usage of built Docker images please make sure to check the licenses of the artifacts contained in the images.

runTests.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash -e
2+
3+
# Sanity check
4+
if [ -z "$CX_INFRA_IT_CF_USERNAME" ]; then
5+
echo "Failure: Variable CX_INFRA_IT_CF_USERNAME is unset"
6+
exit 1
7+
fi
8+
9+
if [ -z "$CX_INFRA_IT_CF_PASSWORD" ]; then
10+
echo "Failure: Variable CX_INFRA_IT_CF_PASSWORD is unset"
11+
exit 1
12+
fi
13+
14+
set -x
15+
16+
# Start a local registry, to which we push the images built in this test, and from which they will be consumed in the test
17+
docker run -d -p 5000:5000 --restart always --name registry registry:2 || true
18+
19+
docker build -t localhost:5000/ppiper/neo-cli .
20+
docker tag localhost:5000/ppiper/neo-cli ppiper/neo-cli:latest
21+
docker push localhost:5000/ppiper/neo-cli:latest
22+
23+
git clone https://github.com/piper-validation/cloud-s4-sdk-book -b validate-neo-cli test-project
24+
pushd test-project
25+
26+
docker run -v //var/run/docker.sock:/var/run/docker.sock -v $(pwd):/workspace -v /tmp\
27+
-e CX_INFRA_IT_CF_PASSWORD -e CX_INFRA_IT_CF_USERNAME -e BRANCH_NAME=master \
28+
-e CASC_JENKINS_CONFIG=/workspace/jenkins.yml -e HOST=$(hostname) \
29+
ppiper/jenkinsfile-runner
30+
31+
popd
32+
33+
function cleanup {
34+
rm -rf test-project
35+
}
36+
trap cleanup EXIT

0 commit comments

Comments
 (0)