Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

Commit

Permalink
Merge pull request #333 from cagiti/added_simple_no-tmux_option
Browse files Browse the repository at this point in the history
feat: added simple parameter to disable tmux - removed non-required files and simplified build pipelines
  • Loading branch information
jenkins-x-bot authored Sep 23, 2019
2 parents 5af36eb + 854ffd3 commit 7bfbbb7
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 206 deletions.
124 changes: 0 additions & 124 deletions Dockerfile

This file was deleted.

13 changes: 0 additions & 13 deletions Makefile

This file was deleted.

13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,20 @@ The dev-env has only been verified on **MacOS**. It should _execute_ on other op
## prerequisites
You'll need [Docker](https://www.docker.com/) to use the dev-env, see [Docker for MacOS](https://hub.docker.com/editions/community/docker-ce-desktop-mac).

## build
Use the following command to build the docker image locally:
```
make build
```

## run
### TMUX
To execute the dev-env, perform the following:
```
$ git clone https://github.com/jenkins-x/dev-env
$ cd dev-env
$ ./dev-env
```
### NO TMUX
```
$ git clone https://github.com/jenkins-x/dev-env
$ cd dev-env
$ ./dev-env no-tmux
```

## tmux
This environment uses tmux to manage its window sessions. The environment is configured with the configuration from [here](https://github.com/gpakosz/.tmux), so a big thank you to [Gregory Pakosz](https://github.com/gpakosz) for the tmux configuration). The tmux key bindings can be found [here](https://github.com/gpakosz/.tmux#bindings), with the exception of the **horizontal split** _below_ (overridden within the environments `.tmux.conf.local` file):
Expand Down
16 changes: 15 additions & 1 deletion dev-env
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
DEV_ENV_BASE_VERSION=0.0.339
PORTS="/tmp/.ports-$(head -c 4 /dev/urandom | xxd -p)-$(date +'%Y%m%d-%H%M%S')"
touch "$PORTS"
TMUX=true
SCRIPT_HOME="$(dirname $BASH_SOURCE | sed 's:^\.$:'"$PWD"':g')"
DEFAULT_GCLOUD_BIN="\/usr\/local\/google-cloud-sdk\/bin\/gcloud"
[ ! -z "$CLOUD_SHELL" ] && ENV=cloud || ENV=mac
Expand All @@ -12,6 +13,11 @@ source ./env/env.sh $ENV
declare -a mounted_directories=("$WORKSPACE" "$GO_WORKSPACE" "${MOUNT}/.cache" "${MOUNT}/.config" "${MOUNT}/.docker" "${MOUNT}/.gnupg" "${MOUNT}/.groovy" "${MOUNT}/.gsutil" "${MOUNT}/.helm" "${MOUNT}/.jx" "${MOUNT}/.m2" "${MOUNT}/.terraform" "${MOUNT}/.terraform.d")
declare -a mounted_files=("${MOUNT}/.gitconfig" "${MOUNT}/.gitcookies" "${MOUNT}/.bash_history" "${MOUNT}/.boto")

if [ -n "$1" ] && [[ "$1" == "no-tmux" ]]
then
TMUX=false
fi

function setup_workspace(){
if [[ ! -d $GO_WORKSPACE ]]
then
Expand Down Expand Up @@ -80,6 +86,14 @@ function setup_environment(){
}

function run(){

if $TMUX
then
CONTAINER_COMMAND="tmux -u"
else
CONTAINER_COMMAND="bash"
fi

PORT_8080=$(get_unused_port)
PORT_8443=$(get_unused_port)
PORT_1313=$(get_unused_port)
Expand Down Expand Up @@ -119,7 +133,7 @@ function run(){
--volume $SSH:/home/developer/.ssh:rw \
--volume $DOCKER_SOCKET:/var/run/docker.sock \
${kube} \
gcr.io/jenkinsxio/dev-env-base:$DEV_ENV_BASE_VERSION-go-alpine tmux -u
gcr.io/jenkinsxio/dev-env-base:$DEV_ENV_BASE_VERSION-go-alpine $CONTAINER_COMMAND
}

setup_workspace
Expand Down
75 changes: 13 additions & 62 deletions jenkins-x.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,75 +13,26 @@ pipelineConfig:
agent:
image: gcr.io/kaniko-project
stages:
- name: build-and-push
environment:
- name: GKE_SA
value: /builder/home/jenkinsx-dev-07b8e95876b1.json
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /builder/home/kaniko-secret.json
- name: script check
steps:
- image: jenkinsxio/jx:1.3.1106
command: jx
- image: bash:5.0.11
command: bash
args:
- step
- credential
- -s
- kaniko-secret
- -k
- kaniko-secret
- -f
- /builder/home/kaniko-secret.json
- image: gcr.io/kaniko-project/executor:9912ccbf8d22bbafbf971124600fbb0b13b9cbd6
command: /kaniko/executor
args:
- --dockerfile=Dockerfile
- --destination=gcr.io/jenkinsxio/dev-env:${inputs.params.version}
- --context=/workspace/source
- --cache-repo=gcr.io/jenkinsxio/cache
- --cache=true
- --cache-dir=/workspace
- -n
- dev-env
release:
pipeline:
options:
containerOptions:
resources:
limits:
memory: 8Gi
requests:
memory: 4Gi
agent:
image: gcr.io/kaniko-project/executor:9912ccbf8d22bbafbf971124600fbb0b13b9cbd6
image: gcr.io/jenkinsxio/builder-jx:0.1.786
stages:
- name: release
environment:
- name: GIT_COMMITTER_EMAIL
value: jenkins-x@googlegroups.com
- name: GIT_COMMITTER_NAME
value: jenkins-x-bot
- name: GIT_AUTHOR_EMAIL
value: jenkins-x@googlegroups.com
- name: GIT_AUTHOR_NAME
value: jenkins-x-bot
- name: GOOGLE_APPLICATION_CREDENTIALS
value: /builder/home/kaniko-secret.json
steps:
- image: jenkinsxio/jx:1.3.1106
command: jx
- command: jx
args:
- step
- credential
- -s
- kaniko-secret
- -k
- kaniko-secret
- -f
- /builder/home/kaniko-secret.json
- image: gcr.io/kaniko-project/executor:9912ccbf8d22bbafbf971124600fbb0b13b9cbd6
command: /kaniko/executor
args:
- --dockerfile=Dockerfile
- --destination=gcr.io/jenkinsxio/dev-env:${inputs.params.version}
- --context=/workspace/source
- --cache-repo=gcr.io/jenkinsxio/cache
- --cache=true
- --cache-dir=/workspace
- changelog
- --verbose
- --version
- ${VERSION}
- --rev
- ${PULL_BASE_SHA}

0 comments on commit 7bfbbb7

Please sign in to comment.